From a8b95e997b8e56e33a4169634e3ab74b69a31b32 Mon Sep 17 00:00:00 2001 From: Liang Shi Date: Thu, 19 May 2022 21:59:49 +1000 Subject: [PATCH] first commit --- .github/workflows/php.yml | 29 + .gitignore | 3 + .phan/config.php | 57 + CHANGELOG.md | 4 + README.md | 210 + composer.json | 43 + composer.lock | 5781 +++++++++++++++++ examples/spot/blvt/blvtInfo.php | 17 + examples/spot/blvt/blvtRedeem.php | 19 + examples/spot/blvt/blvtRedemptionRecord.php | 23 + examples/spot/blvt/blvtSubscribe.php | 19 + examples/spot/blvt/blvtSubscriptionRecord.php | 24 + examples/spot/blvt/blvtUserLimitInfo.php | 20 + examples/spot/bswap/swapAddLiquidity.php | 20 + .../spot/bswap/swapAddLiquidityPreview.php | 19 + examples/spot/bswap/swapClaimRewards.php | 20 + examples/spot/bswap/swapClaimedHistory.php | 25 + examples/spot/bswap/swapHistory.php | 26 + examples/spot/bswap/swapLiquidity.php | 20 + .../bswap/swapLiquidityOperationRecord.php | 25 + examples/spot/bswap/swapListAllPools.php | 13 + examples/spot/bswap/swapPoolConfigure.php | 20 + examples/spot/bswap/swapRemoveLiquidity.php | 20 + .../spot/bswap/swapRemoveLiquidityPreview.php | 19 + examples/spot/bswap/swapRequestQuote.php | 19 + examples/spot/bswap/swapSend.php | 19 + examples/spot/bswap/swapUnclaimedRewards.php | 20 + examples/spot/c2c/c2cTradeHistory.php | 21 + examples/spot/convert/convertTradeHistory.php | 20 + .../cryptoloans/cryptoLoansIncomeHistory.php | 23 + .../spot/fiat/fiatDepositWithdrawHistory.php | 23 + examples/spot/fiat/fiatPaymentsHistory.php | 23 + .../spot/giftcard/giftCardRsaPublicKey.php | 19 + examples/spot/giftcard/giftcardCreateCode.php | 19 + examples/spot/giftcard/giftcardRedeemCode.php | 19 + examples/spot/giftcard/giftcardVerifyCode.php | 19 + .../isolatedMarginCloseListenKey.php | 13 + .../isolatedMarginNewListenKey.php | 13 + .../isolatedMarginRenewListenKey.php | 13 + examples/spot/margin/bnbBurnStatus.php | 19 + .../spot/margin/isolatedMarginAccount.php | 20 + .../margin/isolatedMarginAccountLimit.php | 19 + .../spot/margin/isolatedMarginAllSymbols.php | 19 + .../margin/isolatedMarginDisableAccount.php | 19 + .../margin/isolatedMarginEnableAccount.php | 19 + .../spot/margin/isolatedMarginFeeData.php | 20 + examples/spot/margin/isolatedMarginSymbol.php | 19 + .../spot/margin/isolatedMarginTierData.php | 20 + .../spot/margin/isolatedMarginTransfer.php | 19 + .../margin/isolatedMarginTransferHistory.php | 24 + examples/spot/margin/marginAccount.php | 19 + examples/spot/margin/marginAllAssets.php | 13 + examples/spot/margin/marginAllOCOOrder.php | 19 + examples/spot/margin/marginAllOrders.php | 20 + examples/spot/margin/marginAllPairs.php | 13 + examples/spot/margin/marginAsset.php | 13 + examples/spot/margin/marginBorrow.php | 20 + examples/spot/margin/marginCancelOCOOrder.php | 20 + .../spot/margin/marginCancelOpenOrders.php | 19 + examples/spot/margin/marginCancelOrder.php | 20 + examples/spot/margin/marginFeeData.php | 20 + .../margin/marginForceLiquidationRecord.php | 21 + .../spot/margin/marginInterestHistory.php | 22 + .../spot/margin/marginInterestRateHistory.php | 19 + examples/spot/margin/marginLoanRecord.php | 22 + examples/spot/margin/marginMaxBorrowable.php | 19 + .../spot/margin/marginMaxTransferable.php | 19 + examples/spot/margin/marginMyTrades.php | 20 + examples/spot/margin/marginNewOCOOrder.php | 21 + examples/spot/margin/marginNewOrder.php | 23 + examples/spot/margin/marginOCOOrder.php | 21 + examples/spot/margin/marginOpenOCOOrder.php | 21 + examples/spot/margin/marginOpenOrders.php | 20 + examples/spot/margin/marginOrder.php | 20 + .../spot/margin/marginOrderCountUsage.php | 19 + examples/spot/margin/marginPair.php | 13 + examples/spot/margin/marginPriceIndex.php | 13 + examples/spot/margin/marginRepay.php | 20 + examples/spot/margin/marginRepayRecord.php | 22 + examples/spot/margin/marginTransfer.php | 19 + .../spot/margin/marginTransferHistory.php | 22 + examples/spot/margin/toggleBnbBurn.php | 21 + .../marginstream/marginCloseListenKey.php | 13 + .../spot/marginstream/marginNewListenKey.php | 13 + .../marginstream/marginRenewListenKey.php | 13 + examples/spot/market/aggTrades.php | 16 + examples/spot/market/avgPrice.php | 9 + examples/spot/market/bookTicker.php | 13 + examples/spot/market/depth.php | 17 + examples/spot/market/exchangeInfo.php | 14 + examples/spot/market/historicalTrades.php | 18 + examples/spot/market/klines.php | 15 + examples/spot/market/ping.php | 9 + examples/spot/market/ticker24hr.php | 13 + examples/spot/market/tickerPrice.php | 13 + examples/spot/market/time.php | 13 + examples/spot/market/trades.php | 13 + examples/spot/mining/miningAccountList.php | 19 + examples/spot/mining/miningAlgoList.php | 13 + examples/spot/mining/miningCancelConfig.php | 19 + examples/spot/mining/miningCoinList.php | 13 + examples/spot/mining/miningEarning.php | 19 + examples/spot/mining/miningEarningList.php | 24 + examples/spot/mining/miningExtraBonusList.php | 24 + .../mining/miningHashrateResaleDetails.php | 21 + .../spot/mining/miningHashrateResaleList.php | 21 + .../mining/miningHashrateResaleRequest.php | 21 + examples/spot/mining/miningStatisticsList.php | 19 + examples/spot/mining/miningWorker.php | 19 + examples/spot/mining/miningWorkerList.php | 23 + examples/spot/nft/nftDepositHistory.php | 23 + examples/spot/nft/nftTransactionHistory.php | 23 + examples/spot/nft/nftUserAsset.php | 21 + examples/spot/nft/nftWithdrawHistory.php | 23 + examples/spot/pay/payTradeHistory.php | 22 + .../portfolioMarginAccount.php | 19 + .../spot/rebate/rebateSpotHistoryRecords.php | 22 + .../spot/savings/SavingsFlexibleRedeem.php | 19 + examples/spot/savings/savingsAccount.php | 19 + .../savings/savingsChangeDailyPosition.php | 20 + .../savings/savingsCustomizedPosition.php | 19 + .../savingsFlexibleProductPosition.php | 19 + .../spot/savings/savingsFlexibleProducts.php | 21 + .../savings/savingsFlexiblePurchaseQuota.php | 19 + .../savingsFlexibleRedemptionQuota.php | 19 + .../spot/savings/savingsInterestHistory.php | 22 + examples/spot/savings/savingsProductList.php | 22 + .../savingsPurchaseCustomizedProject.php | 19 + .../savingsPurchaseFlexibleProduct.php | 19 + .../spot/savings/savingsPurchaseRecord.php | 22 + .../spot/savings/savingsRedemptionRecord.php | 22 + examples/spot/staking/stakingHistory.php | 19 + examples/spot/staking/stakingProductList.php | 19 + .../spot/staking/stakingProductPosition.php | 19 + examples/spot/staking/stakingProductQuota.php | 15 + .../spot/staking/stakingPurchaseProduct.php | 19 + .../spot/staking/stakingRedeemProduct.php | 19 + .../spot/staking/stakingSetAutoStaking.php | 19 + examples/spot/stream/closeListenkey.php | 13 + examples/spot/stream/newListenkey.php | 13 + examples/spot/stream/renewListenkey.php | 13 + .../subaccount/managedSubAccountDeposit.php | 19 + .../managedSubaccountAssetDetails.php | 19 + .../subaccount/managedSubaccountSnapshot.php | 22 + .../subaccount/managedSubaccountWithdraw.php | 20 + .../spot/subaccount/subAccountAddIPList.php | 19 + .../subAccountCreateVirtualAccount.php | 19 + .../subaccount/subAccountDeleteIPList.php | 19 + .../subaccount/subAccountDepositAddress.php | 20 + .../subaccount/subAccountDepositHistory.php | 20 + .../subaccount/subAccountEnableFutures.php | 19 + .../subAccountEnableLeverageToken.php | 19 + .../subaccount/subAccountEnableMargin.php | 19 + .../subaccount/subAccountFuturesAccount.php | 19 + .../subAccountFuturesAccountSummary.php | 19 + .../subAccountFuturesAccountSummaryV2.php | 20 + .../subaccount/subAccountFuturesAccountV2.php | 19 + .../subAccountFuturesPositionRisk.php | 19 + .../subAccountFuturesPositionRiskV2.php | 19 + .../subaccount/subAccountFuturesTransfer.php | 19 + .../subaccount/subAccountIPRestriction.php | 19 + examples/spot/subaccount/subAccountList.php | 21 + .../subaccount/subAccountMarginAccount.php | 19 + .../subAccountMarginAccountSummary.php | 19 + .../subaccount/subAccountMarginTransfer.php | 19 + examples/spot/subaccount/subAccountStatus.php | 19 + .../subAccountToggleIPRestriction.php | 19 + .../subaccount/subAccountTransferHistory.php | 21 + .../subAccountTransferHistoryBySubAccount.php | 21 + .../subaccount/subAccountTransferToMaster.php | 19 + .../subAccountTransferToSubAccount.php | 19 + .../subAccountUniversalTransfer.php | 19 + .../subAccountUniversalTransferHistory.php | 20 + examples/spot/subaccount/subaccountAssets.php | 19 + .../subaccountFuturesAssetTransfer.php | 19 + .../subaccountFuturesAssetTransferHistory.php | 23 + .../subaccountSpotAssetsSummary.php | 22 + examples/spot/trade/account.php | 19 + examples/spot/trade/allOrders.php | 20 + examples/spot/trade/cancelOCOOrder.php | 20 + examples/spot/trade/cancelOpenOrders.php | 19 + examples/spot/trade/cancelOrder.php | 20 + examples/spot/trade/getOCOOrder.php | 20 + examples/spot/trade/getOCOOrders.php | 21 + examples/spot/trade/getOpenOcoOrders.php | 19 + examples/spot/trade/getOrder.php | 20 + examples/spot/trade/myTrades.php | 20 + examples/spot/trade/newOCOOrder.php | 21 + examples/spot/trade/newOrder.php | 46 + examples/spot/trade/newOrderTest.php | 20 + examples/spot/trade/openOrders.php | 20 + examples/spot/trade/orderLimitUsage.php | 19 + examples/spot/wallet/accountSnapshot.php | 19 + examples/spot/wallet/accountStatus.php | 19 + examples/spot/wallet/apiKeyPermission.php | 19 + examples/spot/wallet/apiTradingStatus.php | 19 + examples/spot/wallet/assetDetail.php | 20 + examples/spot/wallet/assetDividendRecord.php | 23 + examples/spot/wallet/coinInfo.php | 20 + examples/spot/wallet/depositAddress.php | 20 + examples/spot/wallet/depositHistory.php | 21 + examples/spot/wallet/disableFastWithdraw.php | 19 + examples/spot/wallet/dustLog.php | 19 + examples/spot/wallet/dustTransfer.php | 19 + examples/spot/wallet/dustableAssets.php | 19 + examples/spot/wallet/enableFastWithdraw.php | 19 + examples/spot/wallet/fundingWallet.php | 21 + examples/spot/wallet/systemStatus.php | 9 + examples/spot/wallet/tradeFee.php | 20 + examples/spot/wallet/universalTransfer.php | 21 + .../spot/wallet/universalTransferHistory.php | 25 + examples/spot/wallet/withdraw.php | 19 + examples/spot/wallet/withdrawHistory.php | 21 + examples/websocket/spot/aggTrade.php | 16 + examples/websocket/spot/bookTicker.php | 20 + examples/websocket/spot/combined.php | 16 + examples/websocket/spot/diffBookDepth.php | 43 + examples/websocket/spot/kline.php | 16 + examples/websocket/spot/miniTicker.php | 20 + examples/websocket/spot/partialBookDepth.php | 16 + examples/websocket/spot/ticker.php | 33 + examples/websocket/spot/trade.php | 16 + examples/websocket/spot/userData.php | 17 + phpunit.xml.dist | 13 + src/Binance/APIClient.php | 160 + src/Binance/Exception/BinanceException.php | 7 + src/Binance/Exception/ClientException.php | 7 + .../Exception/InvalidArgumentException.php | 24 + .../Exception/MissingArgumentException.php | 15 + src/Binance/Exception/ServerException.php | 7 + src/Binance/Spot.php | 37 + src/Binance/Spot/BLVT.php | 121 + src/Binance/Spot/BSwap.php | 335 + src/Binance/Spot/C2C.php | 36 + src/Binance/Spot/Convert.php | 30 + src/Binance/Spot/CryptoLoans.php | 36 + src/Binance/Spot/Fiat.php | 57 + src/Binance/Spot/GiftCard.php | 118 + src/Binance/Spot/IsolatedMarginStream.php | 92 + src/Binance/Spot/Margin.php | 1006 +++ src/Binance/Spot/MarginStream.php | 72 + src/Binance/Spot/Market.php | 282 + src/Binance/Spot/Mining.php | 341 + src/Binance/Spot/NFT.php | 77 + src/Binance/Spot/Pay.php | 24 + src/Binance/Spot/PortfolioMargin.php | 20 + src/Binance/Spot/Rebate.php | 24 + src/Binance/Spot/Savings.php | 354 + src/Binance/Spot/Staking.php | 215 + src/Binance/Spot/Stream.php | 72 + src/Binance/Spot/SubAccount.php | 943 +++ src/Binance/Spot/Trade.php | 409 ++ src/Binance/Spot/Wallet.php | 459 ++ src/Binance/Util/Arrays.php | 19 + src/Binance/Util/Strings.php | 11 + src/Binance/Util/Url.php | 28 + src/Binance/Websocket.php | 78 + src/Binance/Websocket/Spot.php | 198 + tests/BaseTestCase.php | 48 + tests/bootstrap.php | 5 + tests/spot/blvt/BlvtInfoTest.php | 35 + tests/spot/blvt/BlvtRedeemTest.php | 44 + tests/spot/blvt/BlvtRedemptionRecordTest.php | 43 + tests/spot/blvt/BlvtSubscribeTest.php | 44 + .../spot/blvt/BlvtSubscriptionRecordTest.php | 45 + tests/spot/blvt/BlvtUserLimitInfoTest.php | 37 + .../bswap/SwapAddLiquidityPreviewTest.php | 52 + tests/spot/bswap/SwapAddLiquidityTest.php | 47 + tests/spot/bswap/SwapClaimRewardsTest.php | 37 + tests/spot/bswap/SwapClaimedHistoryTest.php | 47 + tests/spot/bswap/SwapHistoryTest.php | 49 + .../SwapLiquidityOperationRecordTest.php | 47 + tests/spot/bswap/SwapLiquidityTest.php | 37 + tests/spot/bswap/SwapListAllPoolsTest.php | 30 + tests/spot/bswap/SwapPoolConfigureTest.php | 37 + .../bswap/SwapRemoveLiquidityPreviewTest.php | 52 + tests/spot/bswap/SwapRemoveLiquidityTest.php | 47 + tests/spot/bswap/SwapRequestQuoteTest.php | 51 + tests/spot/bswap/SwapSendTest.php | 51 + tests/spot/bswap/SwapUnclaimedRewardsTest.php | 37 + tests/spot/c2c/C2cTradeHistoryTest.php | 47 + .../spot/convert/convertTradeHistoryTest.php | 39 + .../CryptoLoansIncomeHistoryTest.php | 51 + .../fiat/FiatDepositWithdrawHistoryTest.php | 51 + tests/spot/fiat/FiatPaymentsHistoryTest.php | 44 + .../giftcard/GiftCardRsaPublicKeyTest.php | 35 + .../spot/giftcard/GiftcardCreateCodeTest.php | 44 + .../spot/giftcard/GiftcardRedeemCodeTest.php | 43 + .../spot/giftcard/GiftcardVerifyCodeTest.php | 43 + .../IsolatedMarginCloseListenKeyTest.php | 47 + .../IsolatedMarginNewListenKeyTest.php | 40 + .../IsolatedMarginRenewListenKeyTest.php | 47 + tests/spot/margin/BNBBurnStatusTest.php | 35 + .../margin/IsolatedMarginAccountLimitTest.php | 35 + .../spot/margin/IsolatedMarginAccountTest.php | 37 + .../margin/IsolatedMarginAllSymbolsTest.php | 35 + .../IsolatedMarginDisableAccountTest.php | 43 + .../IsolatedMarginEnableAccountTest.php | 43 + .../spot/margin/IsolatedMarginFeeDataTest.php | 37 + .../spot/margin/IsolatedMarginSymbolTest.php | 43 + .../margin/IsolatedMarginTierDataTest.php | 45 + .../IsolatedMarginTransferHistoryTest.php | 53 + .../margin/IsolatedMarginTransferTest.php | 65 + tests/spot/margin/MarginAccountTest.php | 35 + tests/spot/margin/MarginAllAssetsTest.php | 30 + tests/spot/margin/MarginAllOCOOrderTest.php | 35 + tests/spot/margin/MarginAllOrdersTest.php | 45 + tests/spot/margin/MarginAllPairsTest.php | 30 + tests/spot/margin/MarginAssetTest.php | 40 + tests/spot/margin/MarginBorrowTest.php | 46 + .../spot/margin/MarginCancelOcoOrderTest.php | 45 + .../margin/MarginCancelOpenOrdersTest.php | 43 + tests/spot/margin/MarginCancelOrderTest.php | 45 + tests/spot/margin/MarginFeeDataTest.php | 37 + .../MarginForceLiquidationRecordTest.php | 39 + .../spot/margin/MarginInterestHistoryTest.php | 41 + .../margin/MarginInterestRateHistoryTest.php | 43 + tests/spot/margin/MarginLoanRecordTest.php | 49 + tests/spot/margin/MarginMaxBorrowableTest.php | 43 + .../spot/margin/MarginMaxTransferableTest.php | 43 + tests/spot/margin/MarginMyTradesTest.php | 45 + tests/spot/margin/MarginNewOcoOrderTest.php | 57 + tests/spot/margin/MarginNewOrderTest.php | 65 + tests/spot/margin/MarginOCOOrderTest.php | 39 + tests/spot/margin/MarginOpenOCOOrderTest.php | 39 + tests/spot/margin/MarginOpenOrdersTest.php | 37 + .../spot/margin/MarginOrderCountUsageTest.php | 35 + tests/spot/margin/MarginOrderTest.php | 45 + tests/spot/margin/MarginPairTest.php | 40 + tests/spot/margin/MarginPriceIndexTest.php | 40 + tests/spot/margin/MarginRepayRecordTest.php | 49 + tests/spot/margin/MarginRepayTest.php | 46 + .../spot/margin/MarginTransferHistoryTest.php | 41 + tests/spot/margin/MarginTransferTest.php | 45 + tests/spot/margin/ToggleBNBBurnTest.php | 39 + .../marginstream/MarginCloseListenKeyTest.php | 40 + .../marginstream/MarginNewListenKeyTest.php | 30 + .../marginstream/MarginRenewListenKeyTest.php | 40 + tests/spot/market/AggTradesTest.php | 49 + tests/spot/market/AvgPriceTest.php | 40 + tests/spot/market/BookTickerTest.php | 35 + tests/spot/market/DepthTest.php | 43 + tests/spot/market/ExchangeInfoTest.php | 37 + tests/spot/market/HistoricalTradesTest.php | 45 + tests/spot/market/KlinesTest.php | 54 + tests/spot/market/PingTest.php | 30 + tests/spot/market/Ticker24hrTest.php | 35 + tests/spot/market/TickerPriceTest.php | 35 + tests/spot/market/TimeTest.php | 30 + tests/spot/market/TradesTest.php | 43 + tests/spot/mining/MiningAccountListTest.php | 50 + tests/spot/mining/MiningAlgoListTest.php | 30 + tests/spot/mining/MiningCancelConfigTest.php | 44 + tests/spot/mining/MiningCoinListTest.php | 30 + tests/spot/mining/MiningEarningTest.php | 43 + .../spot/mining/MiningExtraBonusListTest.php | 60 + .../MiningHashrateResaleDetailsTest.php | 54 + .../mining/MiningHashrateResaleListTest.php | 39 + .../MiningHashrateResaleRequestTest.php | 62 + .../spot/mining/MiningStatisticsListTest.php | 50 + tests/spot/mining/MiningWorkerListTest.php | 58 + tests/spot/mining/MiningWorkerTest.php | 57 + tests/spot/mining/miningEarningListTest.php | 60 + tests/spot/nft/NftDepositHistoryTest.php | 43 + tests/spot/nft/NftTransactionHistoryTest.php | 44 + tests/spot/nft/NftUserAssetTest.php | 39 + tests/spot/nft/NftWithdrawHistoryTest.php | 43 + tests/spot/pay/PayTradeHistoryTest.php | 41 + .../PortfolioMarginAccountTest.php | 35 + .../rebate/RebateSpotHistoryRecordsTest.php | 41 + tests/spot/savings/SavingsAccountTest.php | 35 + .../SavingsChangeDailyPositionTest.php | 46 + .../savings/SavingsCustomizedPositionTest.php | 43 + .../SavingsFlexibleProductPositionTest.php | 43 + .../savings/SavingsFlexibleProductsTest.php | 39 + .../SavingsFlexiblePurchaseQuotaTest.php | 43 + .../savings/SavingsFlexibleRedeemTest.php | 51 + .../SavingsFlexibleRedemptionQuotaTest.php | 50 + .../savings/SavingsInterestHistoryTest.php | 49 + tests/spot/savings/SavingsProductListTest.php | 49 + .../SavingsPurchaseCustomizedProjectTest.php | 44 + .../SavingsPurchaseFlexibleProductTest.php | 44 + .../savings/SavingsPurchaseRecordTest.php | 49 + .../savings/SavingsRedemptionRecordTest.php | 49 + tests/spot/staking/StakingHistoryTest.php | 50 + tests/spot/staking/StakingProductListTest.php | 43 + .../staking/StakingProductPositionTest.php | 43 + .../spot/staking/StakingProductQuotaTest.php | 49 + .../staking/StakingPurchaseProductTest.php | 51 + .../spot/staking/StakingRedeemProductTest.php | 50 + .../staking/StakingSetAutoStakingTest.php | 57 + tests/spot/stream/CloseListenkeyTest.php | 40 + tests/spot/stream/NewListenkeyTest.php | 30 + tests/spot/stream/RenewListenkeyTest.php | 40 + .../ManagedSubAccountDepositTest.php | 51 + .../ManagedSubaccountAssetDetailsTest.php | 43 + .../ManagedSubaccountSnapshotTest.php | 56 + .../ManagedSubaccountWithdrawTest.php | 53 + .../subaccount/SubAccountAddIPListTest.php | 57 + .../subaccount/SubAccountDeleteIPListTest.php | 57 + .../SubAccountDepositAddressTest.php | 52 + .../SubAccountDepositHistoryTest.php | 45 + .../SubAccountEnableFuturesTest.php | 43 + .../SubAccountEnableLeverageTokenTest.php | 44 + .../subaccount/SubAccountEnableMarginTest.php | 43 + .../SubAccountFuturesAccountSummaryTest.php | 35 + .../SubAccountFuturesAccountSummaryV2Test.php | 38 + .../SubAccountFuturesAccountTest.php | 43 + .../SubAccountFuturesAccountV2Test.php | 44 + .../SubAccountFuturesPositionRiskTest.php | 43 + .../SubAccountFuturesPositionRiskV2Test.php | 44 + .../SubAccountFuturesTransferTest.php | 52 + .../SubAccountIPRestrictionTest.php | 50 + tests/spot/subaccount/SubAccountListTest.php | 39 + .../SubAccountMarginAccountSummaryTest.php | 35 + .../SubAccountMarginAccountTest.php | 43 + .../SubAccountMarginTransferTest.php | 52 + .../spot/subaccount/SubAccountStatusTest.php | 35 + .../SubAccountToggleIPRestrictionTest.php | 51 + ...AccountTransferHistoryBySubAccountTest.php | 39 + .../SubAccountTransferHistoryTest.php | 39 + .../SubAccountTransferToMasterTest.php | 44 + ...SubAccountUniversalTransferHistoryTest.php | 37 + .../SubAccountUniversalTransferTest.php | 58 + .../spot/subaccount/SubaccountAssetsTest.php | 43 + .../SubaccountCreateVirtualAccountTest.php | 43 + ...accountFuturesAssetTransferHistoryTest.php | 52 + .../SubaccountFuturesAssetTransferTest.php | 59 + .../SubaccountSpotAssetsSummaryTest.php | 41 + .../subAccountTransferToSubAccountTest.php | 51 + tests/spot/trade/AccountTest.php | 35 + tests/spot/trade/AllOrdersTest.php | 45 + tests/spot/trade/CancelOCOOrderTest.php | 45 + tests/spot/trade/CancelOpenOrdersTest.php | 43 + tests/spot/trade/CancelOrderTest.php | 45 + tests/spot/trade/GetOCOOrderTest.php | 37 + tests/spot/trade/GetOCOOrdersTest.php | 39 + tests/spot/trade/GetOpenOCOOrdersTest.php | 35 + tests/spot/trade/GetOrderTest.php | 45 + tests/spot/trade/MyTradesTest.php | 45 + tests/spot/trade/NewOCOOrderTest.php | 57 + tests/spot/trade/NewOrderTest.php | 59 + tests/spot/trade/NewOrderTestTest.php | 59 + tests/spot/trade/OpenOrdersTest.php | 37 + tests/spot/trade/OrderLimitUsageTest.php | 35 + tests/spot/wallet/AccountSnapshotTest.php | 43 + tests/spot/wallet/AccountStatusTest.php | 35 + tests/spot/wallet/ApiKeyPermissionTest.php | 35 + tests/spot/wallet/ApiTradingStatusTest.php | 35 + tests/spot/wallet/AssetDetailTest.php | 37 + tests/spot/wallet/AssetDividendRecordTest.php | 43 + tests/spot/wallet/CoinInfoTest.php | 35 + tests/spot/wallet/DepositAddressTest.php | 45 + tests/spot/wallet/DepositHistoryTest.php | 39 + tests/spot/wallet/DisableFastWithdrawTest.php | 35 + tests/spot/wallet/DustLogTest.php | 35 + tests/spot/wallet/DustTransferTest.php | 36 + tests/spot/wallet/DustableAssetsTest.php | 35 + tests/spot/wallet/EnableFastWithdrawTest.php | 35 + tests/spot/wallet/FundingWalletTest.php | 39 + tests/spot/wallet/SystemStatusTest.php | 30 + tests/spot/wallet/TradeFeeTest.php | 37 + .../wallet/UniversalTransferHistoryTest.php | 55 + tests/spot/wallet/UniversalTransferTest.php | 55 + tests/spot/wallet/WithdrawHistoryTest.php | 39 + tests/spot/wallet/WithdrawTest.php | 51 + tests/util/ArraysTest.php | 15 + tests/util/StringsTest.php | 14 + tests/util/UriTest.php | 24 + 469 files changed, 25096 insertions(+) create mode 100644 .github/workflows/php.yml create mode 100644 .gitignore create mode 100644 .phan/config.php create mode 100644 CHANGELOG.md create mode 100644 README.md create mode 100644 composer.json create mode 100644 composer.lock create mode 100644 examples/spot/blvt/blvtInfo.php create mode 100644 examples/spot/blvt/blvtRedeem.php create mode 100644 examples/spot/blvt/blvtRedemptionRecord.php create mode 100644 examples/spot/blvt/blvtSubscribe.php create mode 100644 examples/spot/blvt/blvtSubscriptionRecord.php create mode 100644 examples/spot/blvt/blvtUserLimitInfo.php create mode 100644 examples/spot/bswap/swapAddLiquidity.php create mode 100644 examples/spot/bswap/swapAddLiquidityPreview.php create mode 100644 examples/spot/bswap/swapClaimRewards.php create mode 100644 examples/spot/bswap/swapClaimedHistory.php create mode 100644 examples/spot/bswap/swapHistory.php create mode 100644 examples/spot/bswap/swapLiquidity.php create mode 100644 examples/spot/bswap/swapLiquidityOperationRecord.php create mode 100644 examples/spot/bswap/swapListAllPools.php create mode 100644 examples/spot/bswap/swapPoolConfigure.php create mode 100644 examples/spot/bswap/swapRemoveLiquidity.php create mode 100644 examples/spot/bswap/swapRemoveLiquidityPreview.php create mode 100644 examples/spot/bswap/swapRequestQuote.php create mode 100644 examples/spot/bswap/swapSend.php create mode 100644 examples/spot/bswap/swapUnclaimedRewards.php create mode 100644 examples/spot/c2c/c2cTradeHistory.php create mode 100644 examples/spot/convert/convertTradeHistory.php create mode 100644 examples/spot/cryptoloans/cryptoLoansIncomeHistory.php create mode 100644 examples/spot/fiat/fiatDepositWithdrawHistory.php create mode 100644 examples/spot/fiat/fiatPaymentsHistory.php create mode 100644 examples/spot/giftcard/giftCardRsaPublicKey.php create mode 100644 examples/spot/giftcard/giftcardCreateCode.php create mode 100644 examples/spot/giftcard/giftcardRedeemCode.php create mode 100644 examples/spot/giftcard/giftcardVerifyCode.php create mode 100644 examples/spot/isolatedmarginstream/isolatedMarginCloseListenKey.php create mode 100644 examples/spot/isolatedmarginstream/isolatedMarginNewListenKey.php create mode 100644 examples/spot/isolatedmarginstream/isolatedMarginRenewListenKey.php create mode 100644 examples/spot/margin/bnbBurnStatus.php create mode 100644 examples/spot/margin/isolatedMarginAccount.php create mode 100644 examples/spot/margin/isolatedMarginAccountLimit.php create mode 100644 examples/spot/margin/isolatedMarginAllSymbols.php create mode 100644 examples/spot/margin/isolatedMarginDisableAccount.php create mode 100644 examples/spot/margin/isolatedMarginEnableAccount.php create mode 100644 examples/spot/margin/isolatedMarginFeeData.php create mode 100644 examples/spot/margin/isolatedMarginSymbol.php create mode 100644 examples/spot/margin/isolatedMarginTierData.php create mode 100644 examples/spot/margin/isolatedMarginTransfer.php create mode 100644 examples/spot/margin/isolatedMarginTransferHistory.php create mode 100644 examples/spot/margin/marginAccount.php create mode 100644 examples/spot/margin/marginAllAssets.php create mode 100644 examples/spot/margin/marginAllOCOOrder.php create mode 100644 examples/spot/margin/marginAllOrders.php create mode 100644 examples/spot/margin/marginAllPairs.php create mode 100644 examples/spot/margin/marginAsset.php create mode 100644 examples/spot/margin/marginBorrow.php create mode 100644 examples/spot/margin/marginCancelOCOOrder.php create mode 100644 examples/spot/margin/marginCancelOpenOrders.php create mode 100644 examples/spot/margin/marginCancelOrder.php create mode 100644 examples/spot/margin/marginFeeData.php create mode 100644 examples/spot/margin/marginForceLiquidationRecord.php create mode 100644 examples/spot/margin/marginInterestHistory.php create mode 100644 examples/spot/margin/marginInterestRateHistory.php create mode 100644 examples/spot/margin/marginLoanRecord.php create mode 100644 examples/spot/margin/marginMaxBorrowable.php create mode 100644 examples/spot/margin/marginMaxTransferable.php create mode 100644 examples/spot/margin/marginMyTrades.php create mode 100644 examples/spot/margin/marginNewOCOOrder.php create mode 100644 examples/spot/margin/marginNewOrder.php create mode 100644 examples/spot/margin/marginOCOOrder.php create mode 100644 examples/spot/margin/marginOpenOCOOrder.php create mode 100644 examples/spot/margin/marginOpenOrders.php create mode 100644 examples/spot/margin/marginOrder.php create mode 100644 examples/spot/margin/marginOrderCountUsage.php create mode 100644 examples/spot/margin/marginPair.php create mode 100644 examples/spot/margin/marginPriceIndex.php create mode 100644 examples/spot/margin/marginRepay.php create mode 100644 examples/spot/margin/marginRepayRecord.php create mode 100644 examples/spot/margin/marginTransfer.php create mode 100644 examples/spot/margin/marginTransferHistory.php create mode 100644 examples/spot/margin/toggleBnbBurn.php create mode 100644 examples/spot/marginstream/marginCloseListenKey.php create mode 100644 examples/spot/marginstream/marginNewListenKey.php create mode 100644 examples/spot/marginstream/marginRenewListenKey.php create mode 100644 examples/spot/market/aggTrades.php create mode 100644 examples/spot/market/avgPrice.php create mode 100644 examples/spot/market/bookTicker.php create mode 100644 examples/spot/market/depth.php create mode 100644 examples/spot/market/exchangeInfo.php create mode 100644 examples/spot/market/historicalTrades.php create mode 100644 examples/spot/market/klines.php create mode 100644 examples/spot/market/ping.php create mode 100644 examples/spot/market/ticker24hr.php create mode 100644 examples/spot/market/tickerPrice.php create mode 100644 examples/spot/market/time.php create mode 100644 examples/spot/market/trades.php create mode 100644 examples/spot/mining/miningAccountList.php create mode 100644 examples/spot/mining/miningAlgoList.php create mode 100644 examples/spot/mining/miningCancelConfig.php create mode 100644 examples/spot/mining/miningCoinList.php create mode 100644 examples/spot/mining/miningEarning.php create mode 100644 examples/spot/mining/miningEarningList.php create mode 100644 examples/spot/mining/miningExtraBonusList.php create mode 100644 examples/spot/mining/miningHashrateResaleDetails.php create mode 100644 examples/spot/mining/miningHashrateResaleList.php create mode 100644 examples/spot/mining/miningHashrateResaleRequest.php create mode 100644 examples/spot/mining/miningStatisticsList.php create mode 100644 examples/spot/mining/miningWorker.php create mode 100644 examples/spot/mining/miningWorkerList.php create mode 100644 examples/spot/nft/nftDepositHistory.php create mode 100644 examples/spot/nft/nftTransactionHistory.php create mode 100644 examples/spot/nft/nftUserAsset.php create mode 100644 examples/spot/nft/nftWithdrawHistory.php create mode 100644 examples/spot/pay/payTradeHistory.php create mode 100644 examples/spot/portfoliomargin/portfolioMarginAccount.php create mode 100644 examples/spot/rebate/rebateSpotHistoryRecords.php create mode 100644 examples/spot/savings/SavingsFlexibleRedeem.php create mode 100644 examples/spot/savings/savingsAccount.php create mode 100644 examples/spot/savings/savingsChangeDailyPosition.php create mode 100644 examples/spot/savings/savingsCustomizedPosition.php create mode 100644 examples/spot/savings/savingsFlexibleProductPosition.php create mode 100644 examples/spot/savings/savingsFlexibleProducts.php create mode 100644 examples/spot/savings/savingsFlexiblePurchaseQuota.php create mode 100644 examples/spot/savings/savingsFlexibleRedemptionQuota.php create mode 100644 examples/spot/savings/savingsInterestHistory.php create mode 100644 examples/spot/savings/savingsProductList.php create mode 100644 examples/spot/savings/savingsPurchaseCustomizedProject.php create mode 100644 examples/spot/savings/savingsPurchaseFlexibleProduct.php create mode 100644 examples/spot/savings/savingsPurchaseRecord.php create mode 100644 examples/spot/savings/savingsRedemptionRecord.php create mode 100644 examples/spot/staking/stakingHistory.php create mode 100644 examples/spot/staking/stakingProductList.php create mode 100644 examples/spot/staking/stakingProductPosition.php create mode 100644 examples/spot/staking/stakingProductQuota.php create mode 100644 examples/spot/staking/stakingPurchaseProduct.php create mode 100644 examples/spot/staking/stakingRedeemProduct.php create mode 100644 examples/spot/staking/stakingSetAutoStaking.php create mode 100644 examples/spot/stream/closeListenkey.php create mode 100644 examples/spot/stream/newListenkey.php create mode 100644 examples/spot/stream/renewListenkey.php create mode 100644 examples/spot/subaccount/managedSubAccountDeposit.php create mode 100644 examples/spot/subaccount/managedSubaccountAssetDetails.php create mode 100644 examples/spot/subaccount/managedSubaccountSnapshot.php create mode 100644 examples/spot/subaccount/managedSubaccountWithdraw.php create mode 100644 examples/spot/subaccount/subAccountAddIPList.php create mode 100644 examples/spot/subaccount/subAccountCreateVirtualAccount.php create mode 100644 examples/spot/subaccount/subAccountDeleteIPList.php create mode 100644 examples/spot/subaccount/subAccountDepositAddress.php create mode 100644 examples/spot/subaccount/subAccountDepositHistory.php create mode 100644 examples/spot/subaccount/subAccountEnableFutures.php create mode 100644 examples/spot/subaccount/subAccountEnableLeverageToken.php create mode 100644 examples/spot/subaccount/subAccountEnableMargin.php create mode 100644 examples/spot/subaccount/subAccountFuturesAccount.php create mode 100644 examples/spot/subaccount/subAccountFuturesAccountSummary.php create mode 100644 examples/spot/subaccount/subAccountFuturesAccountSummaryV2.php create mode 100644 examples/spot/subaccount/subAccountFuturesAccountV2.php create mode 100644 examples/spot/subaccount/subAccountFuturesPositionRisk.php create mode 100644 examples/spot/subaccount/subAccountFuturesPositionRiskV2.php create mode 100644 examples/spot/subaccount/subAccountFuturesTransfer.php create mode 100644 examples/spot/subaccount/subAccountIPRestriction.php create mode 100644 examples/spot/subaccount/subAccountList.php create mode 100644 examples/spot/subaccount/subAccountMarginAccount.php create mode 100644 examples/spot/subaccount/subAccountMarginAccountSummary.php create mode 100644 examples/spot/subaccount/subAccountMarginTransfer.php create mode 100644 examples/spot/subaccount/subAccountStatus.php create mode 100644 examples/spot/subaccount/subAccountToggleIPRestriction.php create mode 100644 examples/spot/subaccount/subAccountTransferHistory.php create mode 100644 examples/spot/subaccount/subAccountTransferHistoryBySubAccount.php create mode 100644 examples/spot/subaccount/subAccountTransferToMaster.php create mode 100644 examples/spot/subaccount/subAccountTransferToSubAccount.php create mode 100644 examples/spot/subaccount/subAccountUniversalTransfer.php create mode 100644 examples/spot/subaccount/subAccountUniversalTransferHistory.php create mode 100644 examples/spot/subaccount/subaccountAssets.php create mode 100644 examples/spot/subaccount/subaccountFuturesAssetTransfer.php create mode 100644 examples/spot/subaccount/subaccountFuturesAssetTransferHistory.php create mode 100644 examples/spot/subaccount/subaccountSpotAssetsSummary.php create mode 100644 examples/spot/trade/account.php create mode 100644 examples/spot/trade/allOrders.php create mode 100644 examples/spot/trade/cancelOCOOrder.php create mode 100644 examples/spot/trade/cancelOpenOrders.php create mode 100644 examples/spot/trade/cancelOrder.php create mode 100644 examples/spot/trade/getOCOOrder.php create mode 100644 examples/spot/trade/getOCOOrders.php create mode 100644 examples/spot/trade/getOpenOcoOrders.php create mode 100644 examples/spot/trade/getOrder.php create mode 100644 examples/spot/trade/myTrades.php create mode 100644 examples/spot/trade/newOCOOrder.php create mode 100644 examples/spot/trade/newOrder.php create mode 100644 examples/spot/trade/newOrderTest.php create mode 100644 examples/spot/trade/openOrders.php create mode 100644 examples/spot/trade/orderLimitUsage.php create mode 100644 examples/spot/wallet/accountSnapshot.php create mode 100644 examples/spot/wallet/accountStatus.php create mode 100644 examples/spot/wallet/apiKeyPermission.php create mode 100644 examples/spot/wallet/apiTradingStatus.php create mode 100644 examples/spot/wallet/assetDetail.php create mode 100644 examples/spot/wallet/assetDividendRecord.php create mode 100644 examples/spot/wallet/coinInfo.php create mode 100644 examples/spot/wallet/depositAddress.php create mode 100644 examples/spot/wallet/depositHistory.php create mode 100644 examples/spot/wallet/disableFastWithdraw.php create mode 100644 examples/spot/wallet/dustLog.php create mode 100644 examples/spot/wallet/dustTransfer.php create mode 100644 examples/spot/wallet/dustableAssets.php create mode 100644 examples/spot/wallet/enableFastWithdraw.php create mode 100644 examples/spot/wallet/fundingWallet.php create mode 100644 examples/spot/wallet/systemStatus.php create mode 100644 examples/spot/wallet/tradeFee.php create mode 100644 examples/spot/wallet/universalTransfer.php create mode 100644 examples/spot/wallet/universalTransferHistory.php create mode 100644 examples/spot/wallet/withdraw.php create mode 100644 examples/spot/wallet/withdrawHistory.php create mode 100644 examples/websocket/spot/aggTrade.php create mode 100644 examples/websocket/spot/bookTicker.php create mode 100644 examples/websocket/spot/combined.php create mode 100644 examples/websocket/spot/diffBookDepth.php create mode 100644 examples/websocket/spot/kline.php create mode 100644 examples/websocket/spot/miniTicker.php create mode 100644 examples/websocket/spot/partialBookDepth.php create mode 100644 examples/websocket/spot/ticker.php create mode 100644 examples/websocket/spot/trade.php create mode 100644 examples/websocket/spot/userData.php create mode 100644 phpunit.xml.dist create mode 100644 src/Binance/APIClient.php create mode 100644 src/Binance/Exception/BinanceException.php create mode 100644 src/Binance/Exception/ClientException.php create mode 100644 src/Binance/Exception/InvalidArgumentException.php create mode 100644 src/Binance/Exception/MissingArgumentException.php create mode 100644 src/Binance/Exception/ServerException.php create mode 100644 src/Binance/Spot.php create mode 100644 src/Binance/Spot/BLVT.php create mode 100644 src/Binance/Spot/BSwap.php create mode 100644 src/Binance/Spot/C2C.php create mode 100644 src/Binance/Spot/Convert.php create mode 100644 src/Binance/Spot/CryptoLoans.php create mode 100644 src/Binance/Spot/Fiat.php create mode 100644 src/Binance/Spot/GiftCard.php create mode 100644 src/Binance/Spot/IsolatedMarginStream.php create mode 100644 src/Binance/Spot/Margin.php create mode 100644 src/Binance/Spot/MarginStream.php create mode 100644 src/Binance/Spot/Market.php create mode 100644 src/Binance/Spot/Mining.php create mode 100644 src/Binance/Spot/NFT.php create mode 100644 src/Binance/Spot/Pay.php create mode 100644 src/Binance/Spot/PortfolioMargin.php create mode 100644 src/Binance/Spot/Rebate.php create mode 100644 src/Binance/Spot/Savings.php create mode 100644 src/Binance/Spot/Staking.php create mode 100644 src/Binance/Spot/Stream.php create mode 100644 src/Binance/Spot/SubAccount.php create mode 100644 src/Binance/Spot/Trade.php create mode 100644 src/Binance/Spot/Wallet.php create mode 100644 src/Binance/Util/Arrays.php create mode 100644 src/Binance/Util/Strings.php create mode 100644 src/Binance/Util/Url.php create mode 100644 src/Binance/Websocket.php create mode 100644 src/Binance/Websocket/Spot.php create mode 100644 tests/BaseTestCase.php create mode 100644 tests/bootstrap.php create mode 100644 tests/spot/blvt/BlvtInfoTest.php create mode 100644 tests/spot/blvt/BlvtRedeemTest.php create mode 100644 tests/spot/blvt/BlvtRedemptionRecordTest.php create mode 100644 tests/spot/blvt/BlvtSubscribeTest.php create mode 100644 tests/spot/blvt/BlvtSubscriptionRecordTest.php create mode 100644 tests/spot/blvt/BlvtUserLimitInfoTest.php create mode 100644 tests/spot/bswap/SwapAddLiquidityPreviewTest.php create mode 100644 tests/spot/bswap/SwapAddLiquidityTest.php create mode 100644 tests/spot/bswap/SwapClaimRewardsTest.php create mode 100644 tests/spot/bswap/SwapClaimedHistoryTest.php create mode 100644 tests/spot/bswap/SwapHistoryTest.php create mode 100644 tests/spot/bswap/SwapLiquidityOperationRecordTest.php create mode 100644 tests/spot/bswap/SwapLiquidityTest.php create mode 100644 tests/spot/bswap/SwapListAllPoolsTest.php create mode 100644 tests/spot/bswap/SwapPoolConfigureTest.php create mode 100644 tests/spot/bswap/SwapRemoveLiquidityPreviewTest.php create mode 100644 tests/spot/bswap/SwapRemoveLiquidityTest.php create mode 100644 tests/spot/bswap/SwapRequestQuoteTest.php create mode 100644 tests/spot/bswap/SwapSendTest.php create mode 100644 tests/spot/bswap/SwapUnclaimedRewardsTest.php create mode 100644 tests/spot/c2c/C2cTradeHistoryTest.php create mode 100644 tests/spot/convert/convertTradeHistoryTest.php create mode 100644 tests/spot/cryptoloans/CryptoLoansIncomeHistoryTest.php create mode 100644 tests/spot/fiat/FiatDepositWithdrawHistoryTest.php create mode 100644 tests/spot/fiat/FiatPaymentsHistoryTest.php create mode 100644 tests/spot/giftcard/GiftCardRsaPublicKeyTest.php create mode 100644 tests/spot/giftcard/GiftcardCreateCodeTest.php create mode 100644 tests/spot/giftcard/GiftcardRedeemCodeTest.php create mode 100644 tests/spot/giftcard/GiftcardVerifyCodeTest.php create mode 100644 tests/spot/isolatedmarginstream/IsolatedMarginCloseListenKeyTest.php create mode 100644 tests/spot/isolatedmarginstream/IsolatedMarginNewListenKeyTest.php create mode 100644 tests/spot/isolatedmarginstream/IsolatedMarginRenewListenKeyTest.php create mode 100644 tests/spot/margin/BNBBurnStatusTest.php create mode 100644 tests/spot/margin/IsolatedMarginAccountLimitTest.php create mode 100644 tests/spot/margin/IsolatedMarginAccountTest.php create mode 100644 tests/spot/margin/IsolatedMarginAllSymbolsTest.php create mode 100644 tests/spot/margin/IsolatedMarginDisableAccountTest.php create mode 100644 tests/spot/margin/IsolatedMarginEnableAccountTest.php create mode 100644 tests/spot/margin/IsolatedMarginFeeDataTest.php create mode 100644 tests/spot/margin/IsolatedMarginSymbolTest.php create mode 100644 tests/spot/margin/IsolatedMarginTierDataTest.php create mode 100644 tests/spot/margin/IsolatedMarginTransferHistoryTest.php create mode 100644 tests/spot/margin/IsolatedMarginTransferTest.php create mode 100644 tests/spot/margin/MarginAccountTest.php create mode 100644 tests/spot/margin/MarginAllAssetsTest.php create mode 100644 tests/spot/margin/MarginAllOCOOrderTest.php create mode 100644 tests/spot/margin/MarginAllOrdersTest.php create mode 100644 tests/spot/margin/MarginAllPairsTest.php create mode 100644 tests/spot/margin/MarginAssetTest.php create mode 100644 tests/spot/margin/MarginBorrowTest.php create mode 100644 tests/spot/margin/MarginCancelOcoOrderTest.php create mode 100644 tests/spot/margin/MarginCancelOpenOrdersTest.php create mode 100644 tests/spot/margin/MarginCancelOrderTest.php create mode 100644 tests/spot/margin/MarginFeeDataTest.php create mode 100644 tests/spot/margin/MarginForceLiquidationRecordTest.php create mode 100644 tests/spot/margin/MarginInterestHistoryTest.php create mode 100644 tests/spot/margin/MarginInterestRateHistoryTest.php create mode 100644 tests/spot/margin/MarginLoanRecordTest.php create mode 100644 tests/spot/margin/MarginMaxBorrowableTest.php create mode 100644 tests/spot/margin/MarginMaxTransferableTest.php create mode 100644 tests/spot/margin/MarginMyTradesTest.php create mode 100644 tests/spot/margin/MarginNewOcoOrderTest.php create mode 100644 tests/spot/margin/MarginNewOrderTest.php create mode 100644 tests/spot/margin/MarginOCOOrderTest.php create mode 100644 tests/spot/margin/MarginOpenOCOOrderTest.php create mode 100644 tests/spot/margin/MarginOpenOrdersTest.php create mode 100644 tests/spot/margin/MarginOrderCountUsageTest.php create mode 100644 tests/spot/margin/MarginOrderTest.php create mode 100644 tests/spot/margin/MarginPairTest.php create mode 100644 tests/spot/margin/MarginPriceIndexTest.php create mode 100644 tests/spot/margin/MarginRepayRecordTest.php create mode 100644 tests/spot/margin/MarginRepayTest.php create mode 100644 tests/spot/margin/MarginTransferHistoryTest.php create mode 100644 tests/spot/margin/MarginTransferTest.php create mode 100644 tests/spot/margin/ToggleBNBBurnTest.php create mode 100644 tests/spot/marginstream/MarginCloseListenKeyTest.php create mode 100644 tests/spot/marginstream/MarginNewListenKeyTest.php create mode 100644 tests/spot/marginstream/MarginRenewListenKeyTest.php create mode 100644 tests/spot/market/AggTradesTest.php create mode 100644 tests/spot/market/AvgPriceTest.php create mode 100644 tests/spot/market/BookTickerTest.php create mode 100644 tests/spot/market/DepthTest.php create mode 100644 tests/spot/market/ExchangeInfoTest.php create mode 100644 tests/spot/market/HistoricalTradesTest.php create mode 100644 tests/spot/market/KlinesTest.php create mode 100644 tests/spot/market/PingTest.php create mode 100644 tests/spot/market/Ticker24hrTest.php create mode 100644 tests/spot/market/TickerPriceTest.php create mode 100644 tests/spot/market/TimeTest.php create mode 100644 tests/spot/market/TradesTest.php create mode 100644 tests/spot/mining/MiningAccountListTest.php create mode 100644 tests/spot/mining/MiningAlgoListTest.php create mode 100644 tests/spot/mining/MiningCancelConfigTest.php create mode 100644 tests/spot/mining/MiningCoinListTest.php create mode 100644 tests/spot/mining/MiningEarningTest.php create mode 100644 tests/spot/mining/MiningExtraBonusListTest.php create mode 100644 tests/spot/mining/MiningHashrateResaleDetailsTest.php create mode 100644 tests/spot/mining/MiningHashrateResaleListTest.php create mode 100644 tests/spot/mining/MiningHashrateResaleRequestTest.php create mode 100644 tests/spot/mining/MiningStatisticsListTest.php create mode 100644 tests/spot/mining/MiningWorkerListTest.php create mode 100644 tests/spot/mining/MiningWorkerTest.php create mode 100644 tests/spot/mining/miningEarningListTest.php create mode 100644 tests/spot/nft/NftDepositHistoryTest.php create mode 100644 tests/spot/nft/NftTransactionHistoryTest.php create mode 100644 tests/spot/nft/NftUserAssetTest.php create mode 100644 tests/spot/nft/NftWithdrawHistoryTest.php create mode 100644 tests/spot/pay/PayTradeHistoryTest.php create mode 100644 tests/spot/portfoliomargin/PortfolioMarginAccountTest.php create mode 100644 tests/spot/rebate/RebateSpotHistoryRecordsTest.php create mode 100644 tests/spot/savings/SavingsAccountTest.php create mode 100644 tests/spot/savings/SavingsChangeDailyPositionTest.php create mode 100644 tests/spot/savings/SavingsCustomizedPositionTest.php create mode 100644 tests/spot/savings/SavingsFlexibleProductPositionTest.php create mode 100644 tests/spot/savings/SavingsFlexibleProductsTest.php create mode 100644 tests/spot/savings/SavingsFlexiblePurchaseQuotaTest.php create mode 100644 tests/spot/savings/SavingsFlexibleRedeemTest.php create mode 100644 tests/spot/savings/SavingsFlexibleRedemptionQuotaTest.php create mode 100644 tests/spot/savings/SavingsInterestHistoryTest.php create mode 100644 tests/spot/savings/SavingsProductListTest.php create mode 100644 tests/spot/savings/SavingsPurchaseCustomizedProjectTest.php create mode 100644 tests/spot/savings/SavingsPurchaseFlexibleProductTest.php create mode 100644 tests/spot/savings/SavingsPurchaseRecordTest.php create mode 100644 tests/spot/savings/SavingsRedemptionRecordTest.php create mode 100644 tests/spot/staking/StakingHistoryTest.php create mode 100644 tests/spot/staking/StakingProductListTest.php create mode 100644 tests/spot/staking/StakingProductPositionTest.php create mode 100644 tests/spot/staking/StakingProductQuotaTest.php create mode 100644 tests/spot/staking/StakingPurchaseProductTest.php create mode 100644 tests/spot/staking/StakingRedeemProductTest.php create mode 100644 tests/spot/staking/StakingSetAutoStakingTest.php create mode 100644 tests/spot/stream/CloseListenkeyTest.php create mode 100644 tests/spot/stream/NewListenkeyTest.php create mode 100644 tests/spot/stream/RenewListenkeyTest.php create mode 100644 tests/spot/subaccount/ManagedSubAccountDepositTest.php create mode 100644 tests/spot/subaccount/ManagedSubaccountAssetDetailsTest.php create mode 100644 tests/spot/subaccount/ManagedSubaccountSnapshotTest.php create mode 100644 tests/spot/subaccount/ManagedSubaccountWithdrawTest.php create mode 100644 tests/spot/subaccount/SubAccountAddIPListTest.php create mode 100644 tests/spot/subaccount/SubAccountDeleteIPListTest.php create mode 100644 tests/spot/subaccount/SubAccountDepositAddressTest.php create mode 100644 tests/spot/subaccount/SubAccountDepositHistoryTest.php create mode 100644 tests/spot/subaccount/SubAccountEnableFuturesTest.php create mode 100644 tests/spot/subaccount/SubAccountEnableLeverageTokenTest.php create mode 100644 tests/spot/subaccount/SubAccountEnableMarginTest.php create mode 100644 tests/spot/subaccount/SubAccountFuturesAccountSummaryTest.php create mode 100644 tests/spot/subaccount/SubAccountFuturesAccountSummaryV2Test.php create mode 100644 tests/spot/subaccount/SubAccountFuturesAccountTest.php create mode 100644 tests/spot/subaccount/SubAccountFuturesAccountV2Test.php create mode 100644 tests/spot/subaccount/SubAccountFuturesPositionRiskTest.php create mode 100644 tests/spot/subaccount/SubAccountFuturesPositionRiskV2Test.php create mode 100644 tests/spot/subaccount/SubAccountFuturesTransferTest.php create mode 100644 tests/spot/subaccount/SubAccountIPRestrictionTest.php create mode 100644 tests/spot/subaccount/SubAccountListTest.php create mode 100644 tests/spot/subaccount/SubAccountMarginAccountSummaryTest.php create mode 100644 tests/spot/subaccount/SubAccountMarginAccountTest.php create mode 100644 tests/spot/subaccount/SubAccountMarginTransferTest.php create mode 100644 tests/spot/subaccount/SubAccountStatusTest.php create mode 100644 tests/spot/subaccount/SubAccountToggleIPRestrictionTest.php create mode 100644 tests/spot/subaccount/SubAccountTransferHistoryBySubAccountTest.php create mode 100644 tests/spot/subaccount/SubAccountTransferHistoryTest.php create mode 100644 tests/spot/subaccount/SubAccountTransferToMasterTest.php create mode 100644 tests/spot/subaccount/SubAccountUniversalTransferHistoryTest.php create mode 100644 tests/spot/subaccount/SubAccountUniversalTransferTest.php create mode 100644 tests/spot/subaccount/SubaccountAssetsTest.php create mode 100644 tests/spot/subaccount/SubaccountCreateVirtualAccountTest.php create mode 100644 tests/spot/subaccount/SubaccountFuturesAssetTransferHistoryTest.php create mode 100644 tests/spot/subaccount/SubaccountFuturesAssetTransferTest.php create mode 100644 tests/spot/subaccount/SubaccountSpotAssetsSummaryTest.php create mode 100644 tests/spot/subaccount/subAccountTransferToSubAccountTest.php create mode 100644 tests/spot/trade/AccountTest.php create mode 100644 tests/spot/trade/AllOrdersTest.php create mode 100644 tests/spot/trade/CancelOCOOrderTest.php create mode 100644 tests/spot/trade/CancelOpenOrdersTest.php create mode 100644 tests/spot/trade/CancelOrderTest.php create mode 100644 tests/spot/trade/GetOCOOrderTest.php create mode 100644 tests/spot/trade/GetOCOOrdersTest.php create mode 100644 tests/spot/trade/GetOpenOCOOrdersTest.php create mode 100644 tests/spot/trade/GetOrderTest.php create mode 100644 tests/spot/trade/MyTradesTest.php create mode 100644 tests/spot/trade/NewOCOOrderTest.php create mode 100644 tests/spot/trade/NewOrderTest.php create mode 100644 tests/spot/trade/NewOrderTestTest.php create mode 100644 tests/spot/trade/OpenOrdersTest.php create mode 100644 tests/spot/trade/OrderLimitUsageTest.php create mode 100644 tests/spot/wallet/AccountSnapshotTest.php create mode 100644 tests/spot/wallet/AccountStatusTest.php create mode 100644 tests/spot/wallet/ApiKeyPermissionTest.php create mode 100644 tests/spot/wallet/ApiTradingStatusTest.php create mode 100644 tests/spot/wallet/AssetDetailTest.php create mode 100644 tests/spot/wallet/AssetDividendRecordTest.php create mode 100644 tests/spot/wallet/CoinInfoTest.php create mode 100644 tests/spot/wallet/DepositAddressTest.php create mode 100644 tests/spot/wallet/DepositHistoryTest.php create mode 100644 tests/spot/wallet/DisableFastWithdrawTest.php create mode 100644 tests/spot/wallet/DustLogTest.php create mode 100644 tests/spot/wallet/DustTransferTest.php create mode 100644 tests/spot/wallet/DustableAssetsTest.php create mode 100644 tests/spot/wallet/EnableFastWithdrawTest.php create mode 100644 tests/spot/wallet/FundingWalletTest.php create mode 100644 tests/spot/wallet/SystemStatusTest.php create mode 100644 tests/spot/wallet/TradeFeeTest.php create mode 100644 tests/spot/wallet/UniversalTransferHistoryTest.php create mode 100644 tests/spot/wallet/UniversalTransferTest.php create mode 100644 tests/spot/wallet/WithdrawHistoryTest.php create mode 100644 tests/spot/wallet/WithdrawTest.php create mode 100644 tests/util/ArraysTest.php create mode 100644 tests/util/StringsTest.php create mode 100644 tests/util/UriTest.php diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..742a605 --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,29 @@ +name: PHP Composer + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + run: + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + operating-system: [ubuntu-latest] + php-versions: ['7.4', '8.0', '8.1'] + name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + - name: Install dependencies + run: composer install --prefer-dist --no-progress + - name: php lint + run: vendor/bin/php-cs-fixer fix --stop-on-violation . + - name: php unit test + run: vendor/bin/phpunit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0c03720 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/vendor/ +*.cache +build/ diff --git a/.phan/config.php b/.phan/config.php new file mode 100644 index 0000000..92ec2d7 --- /dev/null +++ b/.phan/config.php @@ -0,0 +1,57 @@ + '7.4', + + // A list of directories that should be parsed for class and + // method information. After excluding the directories + // defined in exclude_analysis_directory_list, the remaining + // files will be statically analyzed for errors. + // + // Thus, both first-party and third-party code being used by + // your application should be included in this list. + 'directory_list' => [ + 'src', + 'tests', + 'vendor', + 'examples', + ], + + // A regex used to match every file name that you want to + // exclude from parsing. Actual value will exclude every + // "test", "tests", "Test" and "Tests" folders found in + // "vendor/" directory. + 'exclude_file_regex' => '@^vendor/.*/(tests?|Tests?)/@', + + // A directory list that defines files that will be excluded + // from static analysis, but whose class and method + // information should be included. + // + // Generally, you'll want to include the directories for + // third-party code (such as "vendor/") in this list. + // + // n.b.: If you'd like to parse but not analyze 3rd + // party code, directories containing that code + // should be added to both the `directory_list` + // and `exclude_analysis_directory_list` arrays. + 'exclude_analysis_directory_list' => [ + 'vendor/' + ], + 'suppress_issue_types' => [ + 'PhanUndeclaredMethod' + ] +]; diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..6273d25 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,4 @@ +# CHANGELOG + +## 1.0.0 - 2022-05-19 +- First release \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..b1b6434 --- /dev/null +++ b/README.md @@ -0,0 +1,210 @@ +# Binance Connector PHP + +This is a thin library that working as a connector to the Binance public API. + + +## Installation + +```php + +composer require binance/binance-connector-php + +``` + +## How to use + +```php + +require_once 'vendor/autoload.php'; + +$client = new \Binance\Spot(); +$response = $client->time(); +echo json_encode($response); + + +$client = new \Binance\Spot($key, $secret); +$response = $client->account(); +echo json_encode($response); +``` + +Please find `examples` folder for more endpoints + +### Testnet + +The [spot testnet](https://testnet.binance.vision/) is available. In order to test on testnet: + +```php + +$client = new \Binance\Spot([ + 'baseURL' => 'https://testnet.binance.vision' +]); +``` + +### RecvWindow + +From Binance API, recvWindow is available for all endpoints require signature. By default, it's 5000ms. You are allowed to set this parameter to any value less than 60000, number beyond this limit will receive error from Binance server. + +```php + +$client = new \Binance\Spot($key, $secret); +$response = $client->getOrder('BNBUSDT', [ + 'orderId' => '11', + 'recvWindow' => 10000 + ] +); + +``` + +### Optional parameters + +For the optional parameters in the endpoint, pass exactly the field name from API document into the optional parameter array. e.g + +```php + +$response = $client->cancelOCOOrder('BNBUSDT', + [ + 'orderListId' => '12' + ] +); + +``` + +The mandartory parameter is validated in the library level, missing required parameter will throw `Binance\Exception\MissingArgumentException`. + +### Timeout + +Time out in seconds. + +```php + +$client = new \Binance\Spot(['timeout' => 0.5]); + +$response = $client->time(); + +echo json_encode($response); + +``` + +### Display meta info + +Binance API server returns weight usage in the header of each response. This is very useful to indentify the current usage. To reveal this value, simpily intial the client with show_weight_usage=True as: + +```php + +$client = new \Binance\Spot(['showWeightUsage' => true]); +$response = $client->time(); +echo json_encode($response); +``` + +this will returns: + +```json +{"data":{"serverTime":1590579807751},"weight_usage":{"x-mbx-used-weight":["2"],"x-mbx-used-weight-1m":["2"]}} +``` + +It's also able to print out all headers, which may be very helpful for debug: + +```php + +$client = new \Binance\Spot(['showHeader' => true]); +$response = $client->time(); +echo json_encode($response); +``` +the returns will be like: + +```json + +{"data":{"serverTime":1590579942001},"header":{"Content-Type":["application/json;charset=utf-8"],"Transfer-Encoding":["chunked"],...}} +``` + +## Websocket + +```php + +$client = new \Binance\Websocket\Spot(); + +$callbacks = [ + 'message' => function($conn, $msg){ + echo $msg.PHP_EOL; + }, + 'ping' => function($conn, $msg) { + echo "received ping from server".PHP_EOL; + } +]; + +$client->aggTrade('btcusdt', $callbacks); + +``` + +It's able to provide a customlized websocket connector. + +```php + +$loop = \React\EventLoop\Factory::create(); +$reactConnector = new \React\Socket\Connector($loop); +$connector = new \Ratchet\Client\Connector($loop, $reactConnector); +$client = new \Binance\Websocket\Spot(['wsConnector' => $connector]); + +$callbacks = [ + 'message' => function($conn, $msg){ + echo "received message".PHP_EOL; + }, + 'pong' => function($conn) { + echo "received pong from server".PHP_EOL; + }, + 'ping' => function($conn) { + echo "received ping from server".PHP_EOL; + }, + 'close' => function($conn) { + echo "receive closed.".PHP_EOL; + } +]; + +$client->miniTicker('btcusdt', $callbacks); + +# send ping to server intervally +$loop->addPeriodicTimer(2, function () use ($client) { + $client->ping(); + echo "ping sent ".PHP_EOL; +}); + +$loop->run(); + +``` + +Listen to combined stream: +```php + +$client->combined([ + 'btcusdt@miniTicker', + 'ethusdt@miniTicker' +], $callbacks); + +``` + +## Test + +```shell + +# install the packages +composer install + +vendor/bin/phpunit +``` + +## Limitation +Futures and Vanilla Options APIs are not supported: + +- /fapi/* +- /dapi/* +- /vapi/* +- Associated Websocket Market and User Data Streams + + +## Contributing +Contributions are welcome. +If you've found a bug within this project, please open an issue to discuss what you would like to change. +If it's an issue with the API, please open a topic at Binance Developer Community + +## License +MIT diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..73ed392 --- /dev/null +++ b/composer.json @@ -0,0 +1,43 @@ +{ + "name": "binance/binance-connector-php", + "description": "A thin layer for Binance API in PHP", + "homepage": "https://github.com/binance/binance-connector-php", + "type": "library", + "minimum-stability": "stable", + "license": "MIT", + "authors": [ + { + "name": "Binance", + "email": "contact@binance.com" + } + ], + "require": { + "php": ">=7.4.0", + "psr/log": "^1.1", + "guzzlehttp/guzzle": "^7.4", + "ratchet/pawl": "^0.4" + }, + "require-dev": { + "phpunit/phpunit": "^9.5", + "2pd/guzzle-http-mock": "^4.0", + "friendsofphp/php-cs-fixer": "^3.0", + "phan/phan": "5.x" + }, + "autoload": { + "psr-4": { + "Binance\\": "src/Binance/" + } + }, + "autoload-dev": { + "psr-4": { + "Binance\\Tests\\": "tests/" + } + }, + "scripts": { + "test": "phpunit", + "test-coverage": "XDEBUG_MODE=coverage phpunit --coverage-html=build/artifacts/coverage", + "lint-fix": "php-cs-fixer fix --using-cache=no src/", + "analyze": "phan --allow-polyfill-parser" + } + +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..c3282a2 --- /dev/null +++ b/composer.lock @@ -0,0 +1,5781 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "87a559ea183286918b183cea6ae2d320", + "packages": [ + { + "name": "evenement/evenement", + "version": "v3.0.1", + "source": { + "type": "git", + "url": "https://github.com/igorw/evenement.git", + "reference": "531bfb9d15f8aa57454f5f0285b18bec903b8fb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/igorw/evenement/zipball/531bfb9d15f8aa57454f5f0285b18bec903b8fb7", + "reference": "531bfb9d15f8aa57454f5f0285b18bec903b8fb7", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "Evenement": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + } + ], + "description": "Événement is a very simple event dispatching library for PHP", + "keywords": [ + "event-dispatcher", + "event-emitter" + ], + "support": { + "issues": "https://github.com/igorw/evenement/issues", + "source": "https://github.com/igorw/evenement/tree/master" + }, + "time": "2017-07-23T21:35:13+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "7.4.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "ac1ec1cd9b5624694c3a40be801d94137afb12b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ac1ec1cd9b5624694c3a40be801d94137afb12b4", + "reference": "ac1ec1cd9b5624694c3a40be801d94137afb12b4", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.5", + "guzzlehttp/psr7": "^1.8.3 || ^2.1", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "ext-curl": "*", + "php-http/client-integration-tests": "^3.0", + "phpunit/phpunit": "^8.5.5 || ^9.3.5", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.4-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.4.2" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2022-03-20T14:16:28+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "symfony/phpunit-bridge": "^4.4 || ^5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/1.5.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2021-10-22T20:56:57+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.2.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "c94a94f120803a18554c1805ef2e539f8285f9a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/c94a94f120803a18554c1805ef2e539f8285f9a2", + "reference": "c94a94f120803a18554c1805ef2e539f8285f9a2", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^8.5.8 || ^9.3.10" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.2.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2022-03-20T21:55:58+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client/tree/master" + }, + "time": "2020-06-29T06:28:15+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "shasum": "" + }, + "require": { + "php": ">=7.0.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory/tree/master" + }, + "time": "2019-04-30T12:38:16+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/master" + }, + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "psr/log", + "version": "1.1.4", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, + "time": "2021-05-03T11:20:27+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "ratchet/pawl", + "version": "v0.4.1", + "source": { + "type": "git", + "url": "https://github.com/ratchetphp/Pawl.git", + "reference": "af70198bab77a582b31169d3cc3982bed25c161f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ratchetphp/Pawl/zipball/af70198bab77a582b31169d3cc3982bed25c161f", + "reference": "af70198bab77a582b31169d3cc3982bed25c161f", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0", + "guzzlehttp/psr7": "^2.0 || ^1.7", + "php": ">=5.4", + "ratchet/rfc6455": "^0.3.1", + "react/socket": "^1.9" + }, + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8" + }, + "suggest": { + "reactivex/rxphp": "~2.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "Ratchet\\Client\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Asynchronous WebSocket client", + "keywords": [ + "Ratchet", + "async", + "client", + "websocket", + "websocket client" + ], + "support": { + "issues": "https://github.com/ratchetphp/Pawl/issues", + "source": "https://github.com/ratchetphp/Pawl/tree/v0.4.1" + }, + "time": "2021-12-10T14:32:34+00:00" + }, + { + "name": "ratchet/rfc6455", + "version": "v0.3.1", + "source": { + "type": "git", + "url": "https://github.com/ratchetphp/RFC6455.git", + "reference": "7c964514e93456a52a99a20fcfa0de242a43ccdb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ratchetphp/RFC6455/zipball/7c964514e93456a52a99a20fcfa0de242a43ccdb", + "reference": "7c964514e93456a52a99a20fcfa0de242a43ccdb", + "shasum": "" + }, + "require": { + "guzzlehttp/psr7": "^2 || ^1.7", + "php": ">=5.4.2" + }, + "require-dev": { + "phpunit/phpunit": "^5.7", + "react/socket": "^1.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Ratchet\\RFC6455\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "role": "Developer" + }, + { + "name": "Matt Bonneau", + "role": "Developer" + } + ], + "description": "RFC6455 WebSocket protocol handler", + "homepage": "http://socketo.me", + "keywords": [ + "WebSockets", + "rfc6455", + "websocket" + ], + "support": { + "chat": "https://gitter.im/reactphp/reactphp", + "issues": "https://github.com/ratchetphp/RFC6455/issues", + "source": "https://github.com/ratchetphp/RFC6455/tree/v0.3.1" + }, + "time": "2021-12-09T23:20:49+00:00" + }, + { + "name": "react/cache", + "version": "v1.1.1", + "source": { + "type": "git", + "url": "https://github.com/reactphp/cache.git", + "reference": "4bf736a2cccec7298bdf745db77585966fc2ca7e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/cache/zipball/4bf736a2cccec7298bdf745db77585966fc2ca7e", + "reference": "4bf736a2cccec7298bdf745db77585966fc2ca7e", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/promise": "^3.0 || ^2.0 || ^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async, Promise-based cache interface for ReactPHP", + "keywords": [ + "cache", + "caching", + "promise", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/cache/issues", + "source": "https://github.com/reactphp/cache/tree/v1.1.1" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2021-02-02T06:47:52+00:00" + }, + { + "name": "react/dns", + "version": "v1.9.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/dns.git", + "reference": "6d38296756fa644e6cb1bfe95eff0f9a4ed6edcb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/dns/zipball/6d38296756fa644e6cb1bfe95eff0f9a4ed6edcb", + "reference": "6d38296756fa644e6cb1bfe95eff0f9a4ed6edcb", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/cache": "^1.0 || ^0.6 || ^0.5", + "react/event-loop": "^1.2", + "react/promise": "^3.0 || ^2.7 || ^1.2.1", + "react/promise-timer": "^1.8" + }, + "require-dev": { + "clue/block-react": "^1.2", + "phpunit/phpunit": "^9.3 || ^4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Dns\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async DNS resolver for ReactPHP", + "keywords": [ + "async", + "dns", + "dns-resolver", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/dns/issues", + "source": "https://github.com/reactphp/dns/tree/v1.9.0" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2021-12-20T08:46:54+00:00" + }, + { + "name": "react/event-loop", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/event-loop.git", + "reference": "187fb56f46d424afb6ec4ad089269c72eec2e137" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/187fb56f46d424afb6ec4ad089269c72eec2e137", + "reference": "187fb56f46d424afb6ec4ad089269c72eec2e137", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" + }, + "suggest": { + "ext-event": "~1.0 for ExtEventLoop", + "ext-pcntl": "For signal handling support when using the StreamSelectLoop", + "ext-uv": "* for ExtUvLoop" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\EventLoop\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", + "keywords": [ + "asynchronous", + "event-loop" + ], + "support": { + "issues": "https://github.com/reactphp/event-loop/issues", + "source": "https://github.com/reactphp/event-loop/tree/v1.3.0" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-03-17T11:10:22+00:00" + }, + { + "name": "react/promise", + "version": "v2.9.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/234f8fd1023c9158e2314fa9d7d0e6a83db42910", + "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "React\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ], + "support": { + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v2.9.0" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-02-11T10:27:51+00:00" + }, + { + "name": "react/promise-timer", + "version": "v1.8.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise-timer.git", + "reference": "0bbbcc79589e5bfdddba68a287f1cb805581a479" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise-timer/zipball/0bbbcc79589e5bfdddba68a287f1cb805581a479", + "reference": "0bbbcc79589e5bfdddba68a287f1cb805581a479", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "react/event-loop": "^1.2", + "react/promise": "^3.0 || ^2.7.0 || ^1.2.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "React\\Promise\\Timer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "A trivial implementation of timeouts for Promises, built on top of ReactPHP.", + "homepage": "https://github.com/reactphp/promise-timer", + "keywords": [ + "async", + "event-loop", + "promise", + "reactphp", + "timeout", + "timer" + ], + "support": { + "issues": "https://github.com/reactphp/promise-timer/issues", + "source": "https://github.com/reactphp/promise-timer/tree/v1.8.0" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2021-12-06T11:08:48+00:00" + }, + { + "name": "react/socket", + "version": "v1.11.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/socket.git", + "reference": "f474156aaab4f09041144fa8b57c7d70aed32a1c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/socket/zipball/f474156aaab4f09041144fa8b57c7d70aed32a1c", + "reference": "f474156aaab4f09041144fa8b57c7d70aed32a1c", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/dns": "^1.8", + "react/event-loop": "^1.2", + "react/promise": "^2.6.0 || ^1.2.1", + "react/promise-timer": "^1.8", + "react/stream": "^1.2" + }, + "require-dev": { + "clue/block-react": "^1.5", + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35", + "react/promise-stream": "^1.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Socket\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", + "keywords": [ + "Connection", + "Socket", + "async", + "reactphp", + "stream" + ], + "support": { + "issues": "https://github.com/reactphp/socket/issues", + "source": "https://github.com/reactphp/socket/tree/v1.11.0" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-01-14T10:14:32+00:00" + }, + { + "name": "react/stream", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/stream.git", + "reference": "7a423506ee1903e89f1e08ec5f0ed430ff784ae9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/stream/zipball/7a423506ee1903e89f1e08ec5f0ed430ff784ae9", + "reference": "7a423506ee1903e89f1e08ec5f0ed430ff784ae9", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.8", + "react/event-loop": "^1.2" + }, + "require-dev": { + "clue/stream-filter": "~1.2", + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Stream\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", + "keywords": [ + "event-driven", + "io", + "non-blocking", + "pipe", + "reactphp", + "readable", + "stream", + "writable" + ], + "support": { + "issues": "https://github.com/reactphp/stream/issues", + "source": "https://github.com/reactphp/stream/tree/v1.2.0" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2021-07-11T12:37:55+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.5.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:53:40+00:00" + } + ], + "packages-dev": [ + { + "name": "2pd/guzzle-http-mock", + "version": "4.0", + "source": { + "type": "git", + "url": "https://github.com/2pd/GuzzleHttpMock.git", + "reference": "b979260da69c544dc60645317dd23660f1eea080" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/2pd/GuzzleHttpMock/zipball/b979260da69c544dc60645317dd23660f1eea080", + "reference": "b979260da69c544dc60645317dd23660f1eea080", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^7.0", + "php": ">=7.1||^8.0" + }, + "conflict": { + "aeris/guzzle-http-mock": "*" + }, + "require-dev": { + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Aeris\\GuzzleHttpMock\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0-or-later" + ], + "authors": [ + { + "name": "Edan Schwartz", + "email": "edanschwartz@gmail.com", + "role": "Maintainer" + }, + { + "name": "Seth Miller", + "email": "seth@four43.com", + "role": "Maintainer" + }, + { + "name": "Nick Shipes", + "email": "nshipes@aerisweather.com", + "role": "Maintainer" + } + ], + "description": "A mock library for verifying requests made with the Guzzle Http Client, and mocking responses.", + "keywords": [ + "Guzzle", + "client", + "http", + "mock", + "mocking", + "testing" + ], + "support": { + "source": "https://github.com/2pd/GuzzleHttpMock/tree/4.0" + }, + "time": "2022-03-10T01:10:01+00:00" + }, + { + "name": "composer/pcre", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "e300eb6c535192decd27a85bc72a9290f0d6b3bd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/e300eb6c535192decd27a85bc72a9290f0d6b3bd", + "reference": "e300eb6c535192decd27a85bc72a9290f0d6b3bd", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.0.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-02-25T20:21:48+00:00" + }, + { + "name": "composer/semver", + "version": "3.3.2", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9", + "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.4", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.3.2" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-04-01T19:23:25+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "ced299686f41dce890debac69273b47ffe98a40c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", + "reference": "ced299686f41dce890debac69273b47ffe98a40c", + "shasum": "" + }, + "require": { + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-02-25T21:32:43+00:00" + }, + { + "name": "doctrine/annotations", + "version": "1.13.2", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "5b668aef16090008790395c02c893b1ba13f7e08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/5b668aef16090008790395c02c893b1ba13f7e08", + "reference": "5b668aef16090008790395c02c893b1ba13f7e08", + "shasum": "" + }, + "require": { + "doctrine/lexer": "1.*", + "ext-tokenizer": "*", + "php": "^7.1 || ^8.0", + "psr/cache": "^1 || ^2 || ^3" + }, + "require-dev": { + "doctrine/cache": "^1.11 || ^2.0", + "doctrine/coding-standard": "^6.0 || ^8.1", + "phpstan/phpstan": "^0.12.20", + "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5", + "symfony/cache": "^4.4 || ^5.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Docblock Annotations Parser", + "homepage": "https://www.doctrine-project.org/projects/annotations.html", + "keywords": [ + "annotations", + "docblock", + "parser" + ], + "support": { + "issues": "https://github.com/doctrine/annotations/issues", + "source": "https://github.com/doctrine/annotations/tree/1.13.2" + }, + "time": "2021-08-05T19:00:23+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", + "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.16 || ^1", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.22" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.4.1" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2022-03-03T08:28:38+00:00" + }, + { + "name": "doctrine/lexer", + "version": "1.2.3", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/c268e882d4dbdd85e36e4ad69e02dc284f89d229", + "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9.0", + "phpstan/phpstan": "^1.3", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.11" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "keywords": [ + "annotations", + "docblock", + "lexer", + "parser", + "php" + ], + "support": { + "issues": "https://github.com/doctrine/lexer/issues", + "source": "https://github.com/doctrine/lexer/tree/1.2.3" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", + "type": "tidelift" + } + ], + "time": "2022-02-28T11:07:21+00:00" + }, + { + "name": "felixfbecker/advanced-json-rpc", + "version": "v3.2.1", + "source": { + "type": "git", + "url": "https://github.com/felixfbecker/php-advanced-json-rpc.git", + "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/b5f37dbff9a8ad360ca341f3240dc1c168b45447", + "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447", + "shasum": "" + }, + "require": { + "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", + "php": "^7.1 || ^8.0", + "phpdocumentor/reflection-docblock": "^4.3.4 || ^5.0.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.0 || ^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "AdvancedJsonRpc\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Felix Becker", + "email": "felix.b@outlook.com" + } + ], + "description": "A more advanced JSONRPC implementation", + "support": { + "issues": "https://github.com/felixfbecker/php-advanced-json-rpc/issues", + "source": "https://github.com/felixfbecker/php-advanced-json-rpc/tree/v3.2.1" + }, + "time": "2021-06-11T22:34:44+00:00" + }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v3.8.0", + "source": { + "type": "git", + "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", + "reference": "cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3", + "reference": "cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3", + "shasum": "" + }, + "require": { + "composer/semver": "^3.2", + "composer/xdebug-handler": "^3.0.3", + "doctrine/annotations": "^1.13", + "ext-json": "*", + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0", + "php-cs-fixer/diff": "^2.0", + "symfony/console": "^5.4 || ^6.0", + "symfony/event-dispatcher": "^5.4 || ^6.0", + "symfony/filesystem": "^5.4 || ^6.0", + "symfony/finder": "^5.4 || ^6.0", + "symfony/options-resolver": "^5.4 || ^6.0", + "symfony/polyfill-mbstring": "^1.23", + "symfony/polyfill-php80": "^1.25", + "symfony/polyfill-php81": "^1.25", + "symfony/process": "^5.4 || ^6.0", + "symfony/stopwatch": "^5.4 || ^6.0" + }, + "require-dev": { + "justinrainbow/json-schema": "^5.2", + "keradus/cli-executor": "^1.5", + "mikey179/vfsstream": "^1.6.10", + "php-coveralls/php-coveralls": "^2.5.2", + "php-cs-fixer/accessible-object": "^1.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", + "phpspec/prophecy": "^1.15", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.5", + "phpunitgoodpractices/polyfill": "^1.5", + "phpunitgoodpractices/traits": "^1.9.1", + "symfony/phpunit-bridge": "^6.0", + "symfony/yaml": "^5.4 || ^6.0" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "support": { + "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", + "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v3.8.0" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2022-03-18T17:20:59+00:00" + }, + { + "name": "microsoft/tolerant-php-parser", + "version": "v0.1.1", + "source": { + "type": "git", + "url": "https://github.com/microsoft/tolerant-php-parser.git", + "reference": "6a965617cf484355048ac6d2d3de7b6ec93abb16" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/microsoft/tolerant-php-parser/zipball/6a965617cf484355048ac6d2d3de7b6ec93abb16", + "reference": "6a965617cf484355048ac6d2d3de7b6ec93abb16", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.15" + }, + "type": "library", + "autoload": { + "psr-4": { + "Microsoft\\PhpParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Rob Lourens", + "email": "roblou@microsoft.com" + } + ], + "description": "Tolerant PHP-to-AST parser designed for IDE usage scenarios", + "support": { + "issues": "https://github.com/microsoft/tolerant-php-parser/issues", + "source": "https://github.com/microsoft/tolerant-php-parser/tree/v0.1.1" + }, + "time": "2021-07-16T21:28:12+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.11.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", + "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3,<3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2022-03-03T13:19:32+00:00" + }, + { + "name": "netresearch/jsonmapper", + "version": "v4.0.0", + "source": { + "type": "git", + "url": "https://github.com/cweiske/jsonmapper.git", + "reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d", + "reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=7.1" + }, + "require-dev": { + "phpunit/phpunit": "~7.5 || ~8.0 || ~9.0", + "squizlabs/php_codesniffer": "~3.5" + }, + "type": "library", + "autoload": { + "psr-0": { + "JsonMapper": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "OSL-3.0" + ], + "authors": [ + { + "name": "Christian Weiske", + "email": "cweiske@cweiske.de", + "homepage": "http://github.com/cweiske/jsonmapper/", + "role": "Developer" + } + ], + "description": "Map nested JSON structures onto PHP classes", + "support": { + "email": "cweiske@cweiske.de", + "issues": "https://github.com/cweiske/jsonmapper/issues", + "source": "https://github.com/cweiske/jsonmapper/tree/v4.0.0" + }, + "time": "2020-12-01T19:48:11+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.13.2", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "210577fe3cf7badcc5814d99455df46564f3c077" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077", + "reference": "210577fe3cf7badcc5814d99455df46564f3c077", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2" + }, + "time": "2021-11-30T19:35:32+00:00" + }, + { + "name": "phan/phan", + "version": "5.3.2", + "source": { + "type": "git", + "url": "https://github.com/phan/phan.git", + "reference": "b7697eb811e912c038f709f8e1c4911c7ada3edc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phan/phan/zipball/b7697eb811e912c038f709f8e1c4911c7ada3edc", + "reference": "b7697eb811e912c038f709f8e1c4911c7ada3edc", + "shasum": "" + }, + "require": { + "composer/semver": "^1.4|^2.0|^3.0", + "composer/xdebug-handler": "^2.0|^3.0", + "ext-filter": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "felixfbecker/advanced-json-rpc": "^3.0.4", + "microsoft/tolerant-php-parser": "^0.1.0", + "netresearch/jsonmapper": "^1.6.0|^2.0|^3.0|^4.0", + "php": "^7.2.0|^8.0.0", + "sabre/event": "^5.1.3", + "symfony/console": "^3.2|^4.0|^5.0|^6.0", + "symfony/polyfill-mbstring": "^1.11.0", + "symfony/polyfill-php80": "^1.20.0", + "tysonandre/var_representation_polyfill": "^0.0.2|^0.1.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.0" + }, + "suggest": { + "ext-ast": "Needed for parsing ASTs (unless --use-fallback-parser is used). 1.0.1+ is needed, 1.0.16+ is recommended.", + "ext-iconv": "Either iconv or mbstring is needed to ensure issue messages are valid utf-8", + "ext-igbinary": "Improves performance of polyfill when ext-ast is unavailable", + "ext-mbstring": "Either iconv or mbstring is needed to ensure issue messages are valid utf-8", + "ext-tokenizer": "Needed for fallback/polyfill parser support and file/line-based suppressions.", + "ext-var_representation": "Suggested for converting values to strings in issue messages" + }, + "bin": [ + "phan", + "phan_client", + "tocheckstyle" + ], + "type": "project", + "autoload": { + "psr-4": { + "Phan\\": "src/Phan" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tyson Andre" + }, + { + "name": "Rasmus Lerdorf" + }, + { + "name": "Andrew S. Morrison" + } + ], + "description": "A static analyzer for PHP", + "keywords": [ + "analyzer", + "php", + "static" + ], + "support": { + "issues": "https://github.com/phan/phan/issues", + "source": "https://github.com/phan/phan/tree/5.3.2" + }, + "time": "2022-02-01T00:17:36+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.3" + }, + "time": "2021-07-20T11:28:43+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" + }, + { + "name": "php-cs-fixer/diff", + "version": "v2.0.2", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/diff.git", + "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/29dc0d507e838c4580d018bd8b5cb412474f7ec3", + "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0", + "symfony/process": "^3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "sebastian/diff v3 backport support for PHP 5.6+", + "homepage": "https://github.com/PHP-CS-Fixer", + "keywords": [ + "diff" + ], + "support": { + "issues": "https://github.com/PHP-CS-Fixer/diff/issues", + "source": "https://github.com/PHP-CS-Fixer/diff/tree/v2.0.2" + }, + "time": "2020-10-14T08:32:19+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, + "time": "2020-06-27T09:03:43+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "5.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" + }, + "require-dev": { + "mockery/mockery": "~1.3.2", + "psalm/phar": "^4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" + }, + "time": "2021-10-19T17:43:47+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.6.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "77a32518733312af16a44300404e945338981de3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", + "reference": "77a32518733312af16a44300404e945338981de3", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.0" + }, + "require-dev": { + "ext-tokenizer": "*", + "psalm/phar": "^4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" + }, + "time": "2022-03-15T21:29:03+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "v1.15.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.2", + "php": "^7.2 || ~8.0, <8.2", + "phpdocumentor/reflection-docblock": "^5.2", + "sebastian/comparator": "^3.0 || ^4.0", + "sebastian/recursion-context": "^3.0 || ^4.0" + }, + "require-dev": { + "phpspec/phpspec": "^6.0 || ^7.0", + "phpunit/phpunit": "^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Prophecy\\": "src/Prophecy" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" + }, + "time": "2021-12-08T12:19:24+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "9.2.15", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2e9da11878c4202f97915c1cb4bb1ca318a63f5f", + "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.13.0", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcov": "*", + "ext-xdebug": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.15" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-03-07T09:28:20+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-02T12:48:52+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "9.5.20", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "12bc8879fb65aef2138b26fc633cb1e3620cffba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/12bc8879fb65aef2138b26fc633cb1e3620cffba", + "reference": "12bc8879fb65aef2138b26fc633cb1e3620cffba", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.3.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpspec/prophecy": "^1.12.1", + "phpunit/php-code-coverage": "^9.2.13", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", + "sebastian/comparator": "^4.0.5", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.3", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^3.0", + "sebastian/version": "^3.0.2" + }, + "require-dev": { + "ext-pdo": "*", + "phpspec/prophecy-phpunit": "^2.0.1" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.5-dev" + } + }, + "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.20" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-04-01T12:37:26+00:00" + }, + { + "name": "psr/cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/master" + }, + "time": "2016-08-06T20:24:11+00:00" + }, + { + "name": "psr/container", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.2" + }, + "time": "2021-11-05T16:50:12+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "sabre/event", + "version": "5.1.4", + "source": { + "type": "git", + "url": "https://github.com/sabre-io/event.git", + "reference": "d7da22897125d34d7eddf7977758191c06a74497" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sabre-io/event/zipball/d7da22897125d34d7eddf7977758191c06a74497", + "reference": "d7da22897125d34d7eddf7977758191c06a74497", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~2.17.1", + "phpstan/phpstan": "^0.12", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.0" + }, + "type": "library", + "autoload": { + "files": [ + "lib/coroutine.php", + "lib/Loop/functions.php", + "lib/Promise/functions.php" + ], + "psr-4": { + "Sabre\\Event\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Evert Pot", + "email": "me@evertpot.com", + "homepage": "http://evertpot.com/", + "role": "Developer" + } + ], + "description": "sabre/event is a library for lightweight event-based programming", + "homepage": "http://sabre.io/event/", + "keywords": [ + "EventEmitter", + "async", + "coroutine", + "eventloop", + "events", + "hooks", + "plugin", + "promise", + "reactor", + "signal" + ], + "support": { + "forum": "https://groups.google.com/group/sabredav-discuss", + "issues": "https://github.com/sabre-io/event/issues", + "source": "https://github.com/fruux/sabre-event" + }, + "time": "2021-11-04T06:51:17+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:08:49+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" + }, + { + "name": "sebastian/comparator", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:49:45+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.7", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:52:27+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:10:38+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/1b5dff7bb151a4db11d49d90e5408e4e938270f7", + "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-04-03T09:37:03+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-11-11T14:18:36+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-02-14T08:28:10+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.6", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-28T06:42:11+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:17:30+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:45:17+00:00" + }, + { + "name": "sebastian/type", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", + "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/3.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-03-15T09:54:48+00:00" + }, + { + "name": "sebastian/version", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" + }, + { + "name": "symfony/console", + "version": "v5.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "ffe3aed36c4d60da2cf1b0a1cee6b8f2e5fa881b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/ffe3aed36c4d60da2cf1b0a1cee6b8f2e5fa881b", + "reference": "ffe3aed36c4d60da2cf1b0a1cee6b8f2e5fa881b", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.1|^6.0" + }, + "conflict": { + "psr/log": ">=3", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0" + }, + "require-dev": { + "psr/log": "^1|^2", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/lock": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v5.4.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-04-12T16:02:29+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v5.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "dec8a9f58d20df252b9cd89f1c6c1530f747685d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/dec8a9f58d20df252b9cd89f1c6c1530f747685d", + "reference": "dec8a9f58d20df252b9cd89f1c6c1530f747685d", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/event-dispatcher-contracts": "^2|^3", + "symfony/polyfill-php80": "^1.16" + }, + "conflict": { + "symfony/dependency-injection": "<4.4" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/http-foundation": "^4.4|^5.0|^6.0", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/stopwatch": "^4.4|^5.0|^6.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:53:40+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v2.5.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/f98b54df6ad059855739db6fcbc2d36995283fe1", + "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/event-dispatcher": "^1" + }, + "suggest": { + "symfony/event-dispatcher-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:53:40+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v5.4.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "3a4442138d80c9f7b600fb297534ac718b61d37f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/3a4442138d80c9f7b600fb297534ac718b61d37f", + "reference": "3a4442138d80c9f7b600fb297534ac718b61d37f", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v5.4.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-04-01T12:33:59+00:00" + }, + { + "name": "symfony/finder", + "version": "v5.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "9b630f3427f3ebe7cd346c277a1408b00249dad9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/9b630f3427f3ebe7cd346c277a1408b00249dad9", + "reference": "9b630f3427f3ebe7cd346c277a1408b00249dad9", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v5.4.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-04-15T08:07:45+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v5.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "cc1147cb11af1b43f503ac18f31aa3bec213aba8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/cc1147cb11af1b43f503ac18f31aa3bec213aba8", + "reference": "cc1147cb11af1b43f503ac18f31aa3bec213aba8", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php73": "~1.0", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an improved replacement for the array_replace PHP function", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "support": { + "source": "https://github.com/symfony/options-resolver/tree/v5.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:53:40+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "30885182c981ab175d4d034db0f6f469898070ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", + "reference": "30885182c981ab175d4d034db0f6f469898070ab", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-10-20T20:35:02+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/81b86b50cf841a64252b439e738e97f4a34e2783", + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-23T21:10:46+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-30T18:21:41+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-06-05T21:20:04+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c", + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-03-04T08:16:47+00:00" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", + "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-09-13T13:58:11+00:00" + }, + { + "name": "symfony/process", + "version": "v5.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "597f3fff8e3e91836bb0bd38f5718b56ddbde2f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/597f3fff8e3e91836bb0bd38f5718b56ddbde2f3", + "reference": "597f3fff8e3e91836bb0bd38f5718b56ddbde2f3", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v5.4.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-04-08T05:07:18+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v2.5.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/24d9dc654b83e91aa59f9d167b131bc3b5bea24c", + "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.1", + "symfony/deprecation-contracts": "^2.1|^3" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v2.5.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-03-13T20:07:29+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v5.4.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "4d04b5c24f3c9a1a168a131f6cbe297155bc0d30" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/4d04b5c24f3c9a1a168a131f6cbe297155bc0d30", + "reference": "4d04b5c24f3c9a1a168a131f6cbe297155bc0d30", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/service-contracts": "^1|^2|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v5.4.5" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-02-18T16:06:09+00:00" + }, + { + "name": "symfony/string", + "version": "v5.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "3c061a76bff6d6ea427d85e12ad1bb8ed8cd43e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/3c061a76bff6d6ea427d85e12ad1bb8ed8cd43e8", + "reference": "3c061a76bff6d6ea427d85e12ad1bb8ed8cd43e8", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "~1.15" + }, + "conflict": { + "symfony/translation-contracts": ">=3.0" + }, + "require-dev": { + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/http-client": "^4.4|^5.0|^6.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0|^6.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v5.4.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-04-19T10:40:37+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2021-07-28T10:34:58+00:00" + }, + { + "name": "tysonandre/var_representation_polyfill", + "version": "0.1.1", + "source": { + "type": "git", + "url": "https://github.com/TysonAndre/var_representation_polyfill.git", + "reference": "0a942e74e18af5514749895507bc6ca7ab96399a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/TysonAndre/var_representation_polyfill/zipball/0a942e74e18af5514749895507bc6ca7ab96399a", + "reference": "0a942e74e18af5514749895507bc6ca7ab96399a", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.2.0|^8.0.0" + }, + "require-dev": { + "phan/phan": "^4.0", + "phpunit/phpunit": "^8.5.0" + }, + "suggest": { + "ext-var_representation": "*" + }, + "type": "library", + "autoload": { + "files": [ + "src/var_representation.php" + ], + "psr-4": { + "VarRepresentation\\": "src/VarRepresentation" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tyson Andre" + } + ], + "description": "Polyfill for var_representation: convert a variable to a string in a way that fixes the shortcomings of var_export", + "keywords": [ + "var_export", + "var_representation" + ], + "support": { + "issues": "https://github.com/TysonAndre/var_representation_polyfill/issues", + "source": "https://github.com/TysonAndre/var_representation_polyfill/tree/0.1.1" + }, + "time": "2021-08-16T00:12:50+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.10.0", + "source": { + "type": "git", + "url": "https://github.com/webmozarts/assert.git", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.13" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.10.0" + }, + "time": "2021-03-09T10:59:23+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=7.4.0" + }, + "platform-dev": [], + "plugin-api-version": "2.2.0" +} diff --git a/examples/spot/blvt/blvtInfo.php b/examples/spot/blvt/blvtInfo.php new file mode 100644 index 0000000..18b871b --- /dev/null +++ b/examples/spot/blvt/blvtInfo.php @@ -0,0 +1,17 @@ + $key +]); + +$response = $client->blvtInfo( + [ + 'tokenName' => 'BTCUP' + ] +); + +echo json_encode($response); diff --git a/examples/spot/blvt/blvtRedeem.php b/examples/spot/blvt/blvtRedeem.php new file mode 100644 index 0000000..977b55a --- /dev/null +++ b/examples/spot/blvt/blvtRedeem.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->blvtRedeem('BTCDOWN', 1.01, + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/blvt/blvtRedemptionRecord.php b/examples/spot/blvt/blvtRedemptionRecord.php new file mode 100644 index 0000000..5ccd75c --- /dev/null +++ b/examples/spot/blvt/blvtRedemptionRecord.php @@ -0,0 +1,23 @@ + $key, + 'secret' => $secret +]); + +$response = $client->blvtRedemptionRecord( + [ + 'tokenName' => 'BTCUP', + 'id' => 123, + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/blvt/blvtSubscribe.php b/examples/spot/blvt/blvtSubscribe.php new file mode 100644 index 0000000..9676e41 --- /dev/null +++ b/examples/spot/blvt/blvtSubscribe.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->blvtSubscribe('BTCDOWN', 1.01, + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/blvt/blvtSubscriptionRecord.php b/examples/spot/blvt/blvtSubscriptionRecord.php new file mode 100644 index 0000000..e737660 --- /dev/null +++ b/examples/spot/blvt/blvtSubscriptionRecord.php @@ -0,0 +1,24 @@ + $key, + 'secret' => $secret +]); + +$response = $client->blvtSubscriptionRecord( + [ + 'tokenName' => 'BTCUP', + 'id' => 123, + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'limit' => 500, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/blvt/blvtUserLimitInfo.php b/examples/spot/blvt/blvtUserLimitInfo.php new file mode 100644 index 0000000..0e13273 --- /dev/null +++ b/examples/spot/blvt/blvtUserLimitInfo.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->blvtUserLimitInfo( + [ + 'tokenName' => 'BTCUP', + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/bswap/swapAddLiquidity.php b/examples/spot/bswap/swapAddLiquidity.php new file mode 100644 index 0000000..7c24e9b --- /dev/null +++ b/examples/spot/bswap/swapAddLiquidity.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->swapAddLiquidity(2, 'BTC', 12415.2, + [ + 'type' => 'Single', + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/bswap/swapAddLiquidityPreview.php b/examples/spot/bswap/swapAddLiquidityPreview.php new file mode 100644 index 0000000..6fecc8c --- /dev/null +++ b/examples/spot/bswap/swapAddLiquidityPreview.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->swapAddLiquidityPreview(2, 'SINGLE', 'USDT', 12415.2, + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/bswap/swapClaimRewards.php b/examples/spot/bswap/swapClaimRewards.php new file mode 100644 index 0000000..5d0a1c9 --- /dev/null +++ b/examples/spot/bswap/swapClaimRewards.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->swapClaimRewards( + [ + 'type' => 0, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/bswap/swapClaimedHistory.php b/examples/spot/bswap/swapClaimedHistory.php new file mode 100644 index 0000000..eebaf54 --- /dev/null +++ b/examples/spot/bswap/swapClaimedHistory.php @@ -0,0 +1,25 @@ + $key, + 'secret' => $secret +]); + +$response = $client->swapClaimedHistory( + [ + 'poolId' => 123, + 'assetRewards' => 'BNB', + 'type' => 0, + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'limit' => 500, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/bswap/swapHistory.php b/examples/spot/bswap/swapHistory.php new file mode 100644 index 0000000..991a97f --- /dev/null +++ b/examples/spot/bswap/swapHistory.php @@ -0,0 +1,26 @@ + $key, + 'secret' => $secret +]); + +$response = $client->swapHistory( + [ + 'swapId' => 123, + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'status' => 0, + 'quoteAsset' => 'USDT', + 'baseAsset' => 'BUSD', + 'limit' => 100, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/bswap/swapLiquidity.php b/examples/spot/bswap/swapLiquidity.php new file mode 100644 index 0000000..0c3da45 --- /dev/null +++ b/examples/spot/bswap/swapLiquidity.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->swapLiquidity( + [ + 'poolId' => 123, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/bswap/swapLiquidityOperationRecord.php b/examples/spot/bswap/swapLiquidityOperationRecord.php new file mode 100644 index 0000000..e5f71cb --- /dev/null +++ b/examples/spot/bswap/swapLiquidityOperationRecord.php @@ -0,0 +1,25 @@ + $key, + 'secret' => $secret +]); + +$response = $client->swapLiquidityOperationRecord( + [ + 'operationId' => 123, + 'poolId' => 123, + 'operation' => 'ADD', + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'limit' => 100, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/bswap/swapListAllPools.php b/examples/spot/bswap/swapListAllPools.php new file mode 100644 index 0000000..05907d5 --- /dev/null +++ b/examples/spot/bswap/swapListAllPools.php @@ -0,0 +1,13 @@ + $key +]); + +$response = $client->swapListAllPools(); + +echo json_encode($response); diff --git a/examples/spot/bswap/swapPoolConfigure.php b/examples/spot/bswap/swapPoolConfigure.php new file mode 100644 index 0000000..3b8c5f5 --- /dev/null +++ b/examples/spot/bswap/swapPoolConfigure.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->swapPoolConfigure( + [ + 'poolId' => 2, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/bswap/swapRemoveLiquidity.php b/examples/spot/bswap/swapRemoveLiquidity.php new file mode 100644 index 0000000..dea5321 --- /dev/null +++ b/examples/spot/bswap/swapRemoveLiquidity.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->swapRemoveLiquidity(2, 'SINGLE', 12415.2, + [ + 'asset' => ['BNB'], + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/bswap/swapRemoveLiquidityPreview.php b/examples/spot/bswap/swapRemoveLiquidityPreview.php new file mode 100644 index 0000000..d4d8a1c --- /dev/null +++ b/examples/spot/bswap/swapRemoveLiquidityPreview.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->swapRemoveLiquidityPreview(2, 'SINGLE', 'USDT', 12415.2, + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/bswap/swapRequestQuote.php b/examples/spot/bswap/swapRequestQuote.php new file mode 100644 index 0000000..d1015b0 --- /dev/null +++ b/examples/spot/bswap/swapRequestQuote.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->swapRequestQuote('USDT', 'BUSD', 12415.2, + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/bswap/swapSend.php b/examples/spot/bswap/swapSend.php new file mode 100644 index 0000000..b86d32b --- /dev/null +++ b/examples/spot/bswap/swapSend.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->swapSend('USDT', 'BUSD', 12415.2, + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/bswap/swapUnclaimedRewards.php b/examples/spot/bswap/swapUnclaimedRewards.php new file mode 100644 index 0000000..27d4cea --- /dev/null +++ b/examples/spot/bswap/swapUnclaimedRewards.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->swapUnclaimedRewards( + [ + 'type' => 0, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/c2c/c2cTradeHistory.php b/examples/spot/c2c/c2cTradeHistory.php new file mode 100644 index 0000000..6442c10 --- /dev/null +++ b/examples/spot/c2c/c2cTradeHistory.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->c2cTradeHistory('BUY', + [ + 'page' => 1, + 'rows' => 100, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/convert/convertTradeHistory.php b/examples/spot/convert/convertTradeHistory.php new file mode 100644 index 0000000..5036aa4 --- /dev/null +++ b/examples/spot/convert/convertTradeHistory.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->convertTradeHistory(1563189166000, 1563282766000, + [ + 'limit' => 100, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/cryptoloans/cryptoLoansIncomeHistory.php b/examples/spot/cryptoloans/cryptoLoansIncomeHistory.php new file mode 100644 index 0000000..60e2ece --- /dev/null +++ b/examples/spot/cryptoloans/cryptoLoansIncomeHistory.php @@ -0,0 +1,23 @@ + $key, + 'secret' => $secret +]); + +$response = $client->cryptoLoansIncomeHistory('BTC', + [ + 'type' => 'borrowIn', + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'limit' => 20, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/fiat/fiatDepositWithdrawHistory.php b/examples/spot/fiat/fiatDepositWithdrawHistory.php new file mode 100644 index 0000000..609f904 --- /dev/null +++ b/examples/spot/fiat/fiatDepositWithdrawHistory.php @@ -0,0 +1,23 @@ + $key, + 'secret' => $secret +]); + +$response = $client->fiatDepositWithdrawHistory('0', + [ + 'beginTime' => 1626144956000, + 'endTime' => 1640995200000, + 'page' => 1, + 'rows' => 300, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/fiat/fiatPaymentsHistory.php b/examples/spot/fiat/fiatPaymentsHistory.php new file mode 100644 index 0000000..732cdde --- /dev/null +++ b/examples/spot/fiat/fiatPaymentsHistory.php @@ -0,0 +1,23 @@ + $key, + 'secret' => $secret +]); + +$response = $client->fiatPaymentsHistory(0, + [ + 'beginTime' => 1626144956000, + 'endTime' => 1640995200000, + 'page' => 1, + 'rows' => 300, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/giftcard/giftCardRsaPublicKey.php b/examples/spot/giftcard/giftCardRsaPublicKey.php new file mode 100644 index 0000000..7c802c7 --- /dev/null +++ b/examples/spot/giftcard/giftCardRsaPublicKey.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->giftCardRsaPublicKey( + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/giftcard/giftcardCreateCode.php b/examples/spot/giftcard/giftcardCreateCode.php new file mode 100644 index 0000000..6c289f4 --- /dev/null +++ b/examples/spot/giftcard/giftcardCreateCode.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->giftCardCreateCode('BTC', 1.01, + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/giftcard/giftcardRedeemCode.php b/examples/spot/giftcard/giftcardRedeemCode.php new file mode 100644 index 0000000..c39ee92 --- /dev/null +++ b/examples/spot/giftcard/giftcardRedeemCode.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->giftCardRedeemCode('000000', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/giftcard/giftcardVerifyCode.php b/examples/spot/giftcard/giftcardVerifyCode.php new file mode 100644 index 0000000..c867dba --- /dev/null +++ b/examples/spot/giftcard/giftcardVerifyCode.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->giftCardVerifyCode('000000000000000000', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/isolatedmarginstream/isolatedMarginCloseListenKey.php b/examples/spot/isolatedmarginstream/isolatedMarginCloseListenKey.php new file mode 100644 index 0000000..50c2b25 --- /dev/null +++ b/examples/spot/isolatedmarginstream/isolatedMarginCloseListenKey.php @@ -0,0 +1,13 @@ + $key +]); + +$response = $client->isolatedMarginCloseListenKey('BTCUSDT', 'listen-key'); + +echo json_encode($response); diff --git a/examples/spot/isolatedmarginstream/isolatedMarginNewListenKey.php b/examples/spot/isolatedmarginstream/isolatedMarginNewListenKey.php new file mode 100644 index 0000000..042512f --- /dev/null +++ b/examples/spot/isolatedmarginstream/isolatedMarginNewListenKey.php @@ -0,0 +1,13 @@ + $key +]); + +$response = $client->isolatedMarginNewListenKey('BTCUSDT'); + +echo json_encode($response); diff --git a/examples/spot/isolatedmarginstream/isolatedMarginRenewListenKey.php b/examples/spot/isolatedmarginstream/isolatedMarginRenewListenKey.php new file mode 100644 index 0000000..e891bd3 --- /dev/null +++ b/examples/spot/isolatedmarginstream/isolatedMarginRenewListenKey.php @@ -0,0 +1,13 @@ + $key +]); + +$response = $client->isolatedMarginRenewListenKey('BTCUSDT', 'listen-key'); + +echo json_encode($response); diff --git a/examples/spot/margin/bnbBurnStatus.php b/examples/spot/margin/bnbBurnStatus.php new file mode 100644 index 0000000..73f7eea --- /dev/null +++ b/examples/spot/margin/bnbBurnStatus.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->bnbBurnStatus( + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/isolatedMarginAccount.php b/examples/spot/margin/isolatedMarginAccount.php new file mode 100644 index 0000000..8c90932 --- /dev/null +++ b/examples/spot/margin/isolatedMarginAccount.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->isolatedMarginAccount( + [ + 'symbols' => 'BTCUSDT,BNBUSDT,ADAUSDT', + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/isolatedMarginAccountLimit.php b/examples/spot/margin/isolatedMarginAccountLimit.php new file mode 100644 index 0000000..baf4b33 --- /dev/null +++ b/examples/spot/margin/isolatedMarginAccountLimit.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->isolatedMarginAccountLimit( + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/isolatedMarginAllSymbols.php b/examples/spot/margin/isolatedMarginAllSymbols.php new file mode 100644 index 0000000..f3bb845 --- /dev/null +++ b/examples/spot/margin/isolatedMarginAllSymbols.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->isolatedMarginAllSymbols( + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/isolatedMarginDisableAccount.php b/examples/spot/margin/isolatedMarginDisableAccount.php new file mode 100644 index 0000000..e38ac2a --- /dev/null +++ b/examples/spot/margin/isolatedMarginDisableAccount.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->isolatedMarginDisableAccount('BNBUSDT', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/isolatedMarginEnableAccount.php b/examples/spot/margin/isolatedMarginEnableAccount.php new file mode 100644 index 0000000..5e2c40f --- /dev/null +++ b/examples/spot/margin/isolatedMarginEnableAccount.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->isolatedMarginEnableAccount('BNBUSDT', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/isolatedMarginFeeData.php b/examples/spot/margin/isolatedMarginFeeData.php new file mode 100644 index 0000000..800adbd --- /dev/null +++ b/examples/spot/margin/isolatedMarginFeeData.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->isolatedMarginFeeData( + [ + 'symbol' => 'BNBUSDT', + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/isolatedMarginSymbol.php b/examples/spot/margin/isolatedMarginSymbol.php new file mode 100644 index 0000000..3ee15ec --- /dev/null +++ b/examples/spot/margin/isolatedMarginSymbol.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->isolatedMarginSymbol('BNBUSDT', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/isolatedMarginTierData.php b/examples/spot/margin/isolatedMarginTierData.php new file mode 100644 index 0000000..c28438e --- /dev/null +++ b/examples/spot/margin/isolatedMarginTierData.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->isolatedMarginTierData('BNBUSDT', + [ + 'tier' => '1', + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/isolatedMarginTransfer.php b/examples/spot/margin/isolatedMarginTransfer.php new file mode 100644 index 0000000..99d2fa0 --- /dev/null +++ b/examples/spot/margin/isolatedMarginTransfer.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->isolatedMarginTransfer('BTC', 'BNBUSDT', 'SPOT', 'ISOLATED_MARGIN', 1.01, + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/isolatedMarginTransferHistory.php b/examples/spot/margin/isolatedMarginTransferHistory.php new file mode 100644 index 0000000..3dfe1e6 --- /dev/null +++ b/examples/spot/margin/isolatedMarginTransferHistory.php @@ -0,0 +1,24 @@ + $key, + 'secret' => $secret +]); + +$response = $client->isolatedMarginTransferHistory('BNBUSDT', + [ + 'asset' => 'BNB', + 'transFrom' => 'SPOT', + 'transTo' => 'ISOLATED_MARGIN', + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/marginAccount.php b/examples/spot/margin/marginAccount.php new file mode 100644 index 0000000..8166e74 --- /dev/null +++ b/examples/spot/margin/marginAccount.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->marginAccount( + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/marginAllAssets.php b/examples/spot/margin/marginAllAssets.php new file mode 100644 index 0000000..15ab175 --- /dev/null +++ b/examples/spot/margin/marginAllAssets.php @@ -0,0 +1,13 @@ + $key +]); + +$response = $client->marginAllAssets(); + +echo json_encode($response); diff --git a/examples/spot/margin/marginAllOCOOrder.php b/examples/spot/margin/marginAllOCOOrder.php new file mode 100644 index 0000000..6016d6e --- /dev/null +++ b/examples/spot/margin/marginAllOCOOrder.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->marginAllOcoOrder( + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/marginAllOrders.php b/examples/spot/margin/marginAllOrders.php new file mode 100644 index 0000000..984751e --- /dev/null +++ b/examples/spot/margin/marginAllOrders.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->marginAllOrders('BNBUSDT', + [ + 'limit' => 500, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/marginAllPairs.php b/examples/spot/margin/marginAllPairs.php new file mode 100644 index 0000000..e1ac636 --- /dev/null +++ b/examples/spot/margin/marginAllPairs.php @@ -0,0 +1,13 @@ + $key +]); + +$response = $client->marginAllPairs(); + +echo json_encode($response); diff --git a/examples/spot/margin/marginAsset.php b/examples/spot/margin/marginAsset.php new file mode 100644 index 0000000..5cfa940 --- /dev/null +++ b/examples/spot/margin/marginAsset.php @@ -0,0 +1,13 @@ + $key +]); + +$response = $client->marginAsset('BTC'); + +echo json_encode($response); diff --git a/examples/spot/margin/marginBorrow.php b/examples/spot/margin/marginBorrow.php new file mode 100644 index 0000000..d196cdd --- /dev/null +++ b/examples/spot/margin/marginBorrow.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->marginBorrow('BTC', 1.01, + [ + 'symbol' => 'BNBUSDT', + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/marginCancelOCOOrder.php b/examples/spot/margin/marginCancelOCOOrder.php new file mode 100644 index 0000000..8b88737 --- /dev/null +++ b/examples/spot/margin/marginCancelOCOOrder.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->marginCancelOcoOrder('BNBUSDT', + [ + 'orderListId' => 10000, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/marginCancelOpenOrders.php b/examples/spot/margin/marginCancelOpenOrders.php new file mode 100644 index 0000000..0f30194 --- /dev/null +++ b/examples/spot/margin/marginCancelOpenOrders.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->marginCancelOpenOrders('BNBUSDT', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/marginCancelOrder.php b/examples/spot/margin/marginCancelOrder.php new file mode 100644 index 0000000..a105029 --- /dev/null +++ b/examples/spot/margin/marginCancelOrder.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->marginCancelOrder('BNBUSDT', + [ + 'orderId' => 10, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/marginFeeData.php b/examples/spot/margin/marginFeeData.php new file mode 100644 index 0000000..19b9a68 --- /dev/null +++ b/examples/spot/margin/marginFeeData.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->marginFeeData( + [ + 'coin' => 'BNB', + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/marginForceLiquidationRecord.php b/examples/spot/margin/marginForceLiquidationRecord.php new file mode 100644 index 0000000..5866564 --- /dev/null +++ b/examples/spot/margin/marginForceLiquidationRecord.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->marginForceLiquidationRecord( + [ + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/marginInterestHistory.php b/examples/spot/margin/marginInterestHistory.php new file mode 100644 index 0000000..5028d64 --- /dev/null +++ b/examples/spot/margin/marginInterestHistory.php @@ -0,0 +1,22 @@ + $key, + 'secret' => $secret +]); + +$response = $client->marginInterestHistory( + [ + 'asset' => 'BNB', + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/marginInterestRateHistory.php b/examples/spot/margin/marginInterestRateHistory.php new file mode 100644 index 0000000..ae661e0 --- /dev/null +++ b/examples/spot/margin/marginInterestRateHistory.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->marginInterestRateHistory('BTC', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/marginLoanRecord.php b/examples/spot/margin/marginLoanRecord.php new file mode 100644 index 0000000..bec74e1 --- /dev/null +++ b/examples/spot/margin/marginLoanRecord.php @@ -0,0 +1,22 @@ + $key, + 'secret' => $secret +]); + +$response = $client->marginLoanRecord('BTC', + [ + 'txId' => 123456789, + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/marginMaxBorrowable.php b/examples/spot/margin/marginMaxBorrowable.php new file mode 100644 index 0000000..d1375bc --- /dev/null +++ b/examples/spot/margin/marginMaxBorrowable.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->marginMaxBorrowable('BTC', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/marginMaxTransferable.php b/examples/spot/margin/marginMaxTransferable.php new file mode 100644 index 0000000..e696a37 --- /dev/null +++ b/examples/spot/margin/marginMaxTransferable.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->marginMaxTransferable('BTC', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/marginMyTrades.php b/examples/spot/margin/marginMyTrades.php new file mode 100644 index 0000000..a99a13b --- /dev/null +++ b/examples/spot/margin/marginMyTrades.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->marginMyTrades('BNBUSDT', + [ + 'limit' => 500, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/marginNewOCOOrder.php b/examples/spot/margin/marginNewOCOOrder.php new file mode 100644 index 0000000..adf29b3 --- /dev/null +++ b/examples/spot/margin/marginNewOCOOrder.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->marginNewOcoOrder('BNBUSDT', 'SELL', 0.1, 400.15, 390.3, + [ + 'stopLimitPrice' => 290, + 'stopLimitTimeInForce' => 'GTC', + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/marginNewOrder.php b/examples/spot/margin/marginNewOrder.php new file mode 100644 index 0000000..6f7bbeb --- /dev/null +++ b/examples/spot/margin/marginNewOrder.php @@ -0,0 +1,23 @@ + $key, + 'secret' => $secret +]); + +$response = $client->marginNewOrder('BNBUSDT', 'SELL', 'MARKET', + [ + 'quantity' => 1.01, + 'price' => 10, + 'stopPrice' => 20.01, + 'timeInForce' => 'GTC', + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/marginOCOOrder.php b/examples/spot/margin/marginOCOOrder.php new file mode 100644 index 0000000..97b70ab --- /dev/null +++ b/examples/spot/margin/marginOCOOrder.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->marginOcoOrder( + [ + 'symbol' => 'BNBUSDT', + 'orderListId' => 27, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/marginOpenOCOOrder.php b/examples/spot/margin/marginOpenOCOOrder.php new file mode 100644 index 0000000..c96e20a --- /dev/null +++ b/examples/spot/margin/marginOpenOCOOrder.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->marginOpenOcoOrder( + [ + 'isIsolated' => 'TRUE', + 'symbol' => 'BNBUSDT', + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/marginOpenOrders.php b/examples/spot/margin/marginOpenOrders.php new file mode 100644 index 0000000..c678624 --- /dev/null +++ b/examples/spot/margin/marginOpenOrders.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->marginOpenOrders( + [ + 'symbol' => 'BNBUSDT', + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/marginOrder.php b/examples/spot/margin/marginOrder.php new file mode 100644 index 0000000..6bef524 --- /dev/null +++ b/examples/spot/margin/marginOrder.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->marginOrder('BNBUSDT', + [ + 'orderId' => 213205622, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/marginOrderCountUsage.php b/examples/spot/margin/marginOrderCountUsage.php new file mode 100644 index 0000000..6417597 --- /dev/null +++ b/examples/spot/margin/marginOrderCountUsage.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->marginOrderCountUsage( + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/marginPair.php b/examples/spot/margin/marginPair.php new file mode 100644 index 0000000..282178f --- /dev/null +++ b/examples/spot/margin/marginPair.php @@ -0,0 +1,13 @@ + $key +]); + +$response = $client->marginPair('BNBUSDT'); + +echo json_encode($response); diff --git a/examples/spot/margin/marginPriceIndex.php b/examples/spot/margin/marginPriceIndex.php new file mode 100644 index 0000000..c37a390 --- /dev/null +++ b/examples/spot/margin/marginPriceIndex.php @@ -0,0 +1,13 @@ + $key +]); + +$response = $client->marginPriceIndex('BNBUSDT'); + +echo json_encode($response); diff --git a/examples/spot/margin/marginRepay.php b/examples/spot/margin/marginRepay.php new file mode 100644 index 0000000..231d18f --- /dev/null +++ b/examples/spot/margin/marginRepay.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->marginRepay('BTC', 1.01, + [ + 'symbol' => 'BNBUSDT', + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/marginRepayRecord.php b/examples/spot/margin/marginRepayRecord.php new file mode 100644 index 0000000..b97ac6b --- /dev/null +++ b/examples/spot/margin/marginRepayRecord.php @@ -0,0 +1,22 @@ + $key, + 'secret' => $secret +]); + +$response = $client->marginRepayRecord('BTC', + [ + 'txId' => 2970933056, + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/marginTransfer.php b/examples/spot/margin/marginTransfer.php new file mode 100644 index 0000000..b8b7f98 --- /dev/null +++ b/examples/spot/margin/marginTransfer.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->marginTransfer('BTC', 1.01, 1, + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/marginTransferHistory.php b/examples/spot/margin/marginTransferHistory.php new file mode 100644 index 0000000..8c51ed7 --- /dev/null +++ b/examples/spot/margin/marginTransferHistory.php @@ -0,0 +1,22 @@ + $key, + 'secret' => $secret +]); + +$response = $client->marginTransferHistory( + [ + 'asset' => 'BNB', + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/toggleBnbBurn.php b/examples/spot/margin/toggleBnbBurn.php new file mode 100644 index 0000000..a63f2c8 --- /dev/null +++ b/examples/spot/margin/toggleBnbBurn.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->toggleBnbBurn( + [ + 'spotBNBBurn' => 'true', + 'interestBNBBurn' => 'false', + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/marginstream/marginCloseListenKey.php b/examples/spot/marginstream/marginCloseListenKey.php new file mode 100644 index 0000000..71b71c1 --- /dev/null +++ b/examples/spot/marginstream/marginCloseListenKey.php @@ -0,0 +1,13 @@ + $key +]); + +$response = $client->marginCloseListenKey('listen-key'); + +echo json_encode($response); diff --git a/examples/spot/marginstream/marginNewListenKey.php b/examples/spot/marginstream/marginNewListenKey.php new file mode 100644 index 0000000..b930ac2 --- /dev/null +++ b/examples/spot/marginstream/marginNewListenKey.php @@ -0,0 +1,13 @@ + $key +]); + +$response = $client->marginNewListenKey(); + +echo json_encode($response); diff --git a/examples/spot/marginstream/marginRenewListenKey.php b/examples/spot/marginstream/marginRenewListenKey.php new file mode 100644 index 0000000..4d4a2f4 --- /dev/null +++ b/examples/spot/marginstream/marginRenewListenKey.php @@ -0,0 +1,13 @@ + $key +]); + +$response = $client->marginRenewListenKey('listen-key'); + +echo json_encode($response); diff --git a/examples/spot/market/aggTrades.php b/examples/spot/market/aggTrades.php new file mode 100644 index 0000000..a50f6ae --- /dev/null +++ b/examples/spot/market/aggTrades.php @@ -0,0 +1,16 @@ +aggTrades('BNBUSDT', + [ + 'fromId' => 123, + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'limit' => 500 + ] +); + +echo json_encode($response); diff --git a/examples/spot/market/avgPrice.php b/examples/spot/market/avgPrice.php new file mode 100644 index 0000000..553cfb4 --- /dev/null +++ b/examples/spot/market/avgPrice.php @@ -0,0 +1,9 @@ +avgPrice('BNBUSDT'); + +echo json_encode($response); diff --git a/examples/spot/market/bookTicker.php b/examples/spot/market/bookTicker.php new file mode 100644 index 0000000..853c1cf --- /dev/null +++ b/examples/spot/market/bookTicker.php @@ -0,0 +1,13 @@ +bookTicker( + [ + 'symbol' => 'BNBUSDT' + ] +); + +echo json_encode($response); diff --git a/examples/spot/market/depth.php b/examples/spot/market/depth.php new file mode 100644 index 0000000..0ee18d7 --- /dev/null +++ b/examples/spot/market/depth.php @@ -0,0 +1,17 @@ + false, # optional, only if you wish to display whole response header. + ] +); + +$response = $client->depth('BNBUSDT', + [ + 'limit' => 100 + ] +); + +echo json_encode($response); diff --git a/examples/spot/market/exchangeInfo.php b/examples/spot/market/exchangeInfo.php new file mode 100644 index 0000000..e159e53 --- /dev/null +++ b/examples/spot/market/exchangeInfo.php @@ -0,0 +1,14 @@ +exchangeInfo( + [ + 'symbol' => 'BNBUSDT', + 'symbols' => '["BTCUSDT","BNBBTC"]' + ] +); + +echo json_encode($response); diff --git a/examples/spot/market/historicalTrades.php b/examples/spot/market/historicalTrades.php new file mode 100644 index 0000000..6304bd0 --- /dev/null +++ b/examples/spot/market/historicalTrades.php @@ -0,0 +1,18 @@ + $key +]); + +$response = $client->historicalTrades('BNBUSDT', + [ + 'limit' => 500, + 'fromId' => 123 + ] +); + +echo json_encode($response); diff --git a/examples/spot/market/klines.php b/examples/spot/market/klines.php new file mode 100644 index 0000000..51e11b1 --- /dev/null +++ b/examples/spot/market/klines.php @@ -0,0 +1,15 @@ +klines('BNBUSDT', '1m', + [ + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'limit' => 500 + ] +); + +echo json_encode($response); diff --git a/examples/spot/market/ping.php b/examples/spot/market/ping.php new file mode 100644 index 0000000..1d5f306 --- /dev/null +++ b/examples/spot/market/ping.php @@ -0,0 +1,9 @@ +ping(); + +echo json_encode($response); diff --git a/examples/spot/market/ticker24hr.php b/examples/spot/market/ticker24hr.php new file mode 100644 index 0000000..5cc8491 --- /dev/null +++ b/examples/spot/market/ticker24hr.php @@ -0,0 +1,13 @@ +ticker24hr( + [ + 'symbol' => 'BNBUSDT' + ] +); + +echo json_encode($response); diff --git a/examples/spot/market/tickerPrice.php b/examples/spot/market/tickerPrice.php new file mode 100644 index 0000000..d1fc41b --- /dev/null +++ b/examples/spot/market/tickerPrice.php @@ -0,0 +1,13 @@ +tickerPrice( + [ + 'symbol' => 'BNBUSDT' + ] +); + +echo json_encode($response); diff --git a/examples/spot/market/time.php b/examples/spot/market/time.php new file mode 100644 index 0000000..2e75700 --- /dev/null +++ b/examples/spot/market/time.php @@ -0,0 +1,13 @@ + true, # optional, only if you need to display weight usage. + ] +); + +$response = $client->time(); + +echo json_encode($response); diff --git a/examples/spot/market/trades.php b/examples/spot/market/trades.php new file mode 100644 index 0000000..75f5c7c --- /dev/null +++ b/examples/spot/market/trades.php @@ -0,0 +1,13 @@ +trades('BNBUSDT', + [ + 'limit' => 500 + ] +); + +echo json_encode($response); diff --git a/examples/spot/mining/miningAccountList.php b/examples/spot/mining/miningAccountList.php new file mode 100644 index 0000000..34b2e11 --- /dev/null +++ b/examples/spot/mining/miningAccountList.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->miningAccountList('sha256', 'username', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/mining/miningAlgoList.php b/examples/spot/mining/miningAlgoList.php new file mode 100644 index 0000000..926eae2 --- /dev/null +++ b/examples/spot/mining/miningAlgoList.php @@ -0,0 +1,13 @@ + $key +]); + +$response = $client->miningAlgoList(); + +echo json_encode($response); diff --git a/examples/spot/mining/miningCancelConfig.php b/examples/spot/mining/miningCancelConfig.php new file mode 100644 index 0000000..0aa4c21 --- /dev/null +++ b/examples/spot/mining/miningCancelConfig.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->miningCancelConfig(168, 'username', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/mining/miningCoinList.php b/examples/spot/mining/miningCoinList.php new file mode 100644 index 0000000..385c9ba --- /dev/null +++ b/examples/spot/mining/miningCoinList.php @@ -0,0 +1,13 @@ + $key +]); + +$response = $client->miningCoinList(); + +echo json_encode($response); diff --git a/examples/spot/mining/miningEarning.php b/examples/spot/mining/miningEarning.php new file mode 100644 index 0000000..36cc93a --- /dev/null +++ b/examples/spot/mining/miningEarning.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->miningEarning('sha256', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/mining/miningEarningList.php b/examples/spot/mining/miningEarningList.php new file mode 100644 index 0000000..636726e --- /dev/null +++ b/examples/spot/mining/miningEarningList.php @@ -0,0 +1,24 @@ + $key, + 'secret' => $secret +]); + +$response = $client->miningEarningList('sha256', 'username', + [ + 'coin' => 'BNB', + 'startDate' => 1640995200000, + 'endDate' => 1640995200000, + 'pageIndex' => 2, + 'pageSize' => 20, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/mining/miningExtraBonusList.php b/examples/spot/mining/miningExtraBonusList.php new file mode 100644 index 0000000..73429ab --- /dev/null +++ b/examples/spot/mining/miningExtraBonusList.php @@ -0,0 +1,24 @@ + $key, + 'secret' => $secret +]); + +$response = $client->miningExtraBonusList('sha256', 'username', + [ + 'coin' => 'BNB', + 'startDate' => 1640995200000, + 'endDate' => 1640995200000, + 'pageIndex' => 2, + 'pageSize' => 20, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/mining/miningHashrateResaleDetails.php b/examples/spot/mining/miningHashrateResaleDetails.php new file mode 100644 index 0000000..666a79d --- /dev/null +++ b/examples/spot/mining/miningHashrateResaleDetails.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->miningHashrateResaleDetails('168', 'username', + [ + 'pageIndex' => 2, + 'pageSize' => 20, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/mining/miningHashrateResaleList.php b/examples/spot/mining/miningHashrateResaleList.php new file mode 100644 index 0000000..efa5199 --- /dev/null +++ b/examples/spot/mining/miningHashrateResaleList.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->miningHashrateResaleList( + [ + 'pageIndex' => 2, + 'pageSize' => 20, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/mining/miningHashrateResaleRequest.php b/examples/spot/mining/miningHashrateResaleRequest.php new file mode 100644 index 0000000..263b279 --- /dev/null +++ b/examples/spot/mining/miningHashrateResaleRequest.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->miningHashrateResaleRequest('username', 'sha256', 'username', 100000000, + [ + 'startDate' => 1640995200000, + 'endDate' => 1640995200000, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/mining/miningStatisticsList.php b/examples/spot/mining/miningStatisticsList.php new file mode 100644 index 0000000..0140ead --- /dev/null +++ b/examples/spot/mining/miningStatisticsList.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->miningStatisticsList('sha256', 'username', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/mining/miningWorker.php b/examples/spot/mining/miningWorker.php new file mode 100644 index 0000000..2af84a2 --- /dev/null +++ b/examples/spot/mining/miningWorker.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->miningWorker('sha256', 'username', 'workername', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/mining/miningWorkerList.php b/examples/spot/mining/miningWorkerList.php new file mode 100644 index 0000000..4d9303b --- /dev/null +++ b/examples/spot/mining/miningWorkerList.php @@ -0,0 +1,23 @@ + $key, + 'secret' => $secret +]); + +$response = $client->miningWorkerList('sha256', 'username', + [ + 'pageIndex' => 2, + 'sort' => 0, + 'sortColumn' => 1, + 'workerStatus' => 2, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/nft/nftDepositHistory.php b/examples/spot/nft/nftDepositHistory.php new file mode 100644 index 0000000..2a8ce53 --- /dev/null +++ b/examples/spot/nft/nftDepositHistory.php @@ -0,0 +1,23 @@ + $key, + 'secret' => $secret +]); + +$response = $client->nftDepositHistory( + [ + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'limit' => 50, + 'page' => 1, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/nft/nftTransactionHistory.php b/examples/spot/nft/nftTransactionHistory.php new file mode 100644 index 0000000..f843dac --- /dev/null +++ b/examples/spot/nft/nftTransactionHistory.php @@ -0,0 +1,23 @@ + $key, + 'secret' => $secret +]); + +$response = $client->nftTransactionHistory(1, + [ + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'limit' => 50, + 'page' => 1, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/nft/nftUserAsset.php b/examples/spot/nft/nftUserAsset.php new file mode 100644 index 0000000..10bb17d --- /dev/null +++ b/examples/spot/nft/nftUserAsset.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->nftUserAsset( + [ + 'limit' => 50, + 'page' => 1, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/nft/nftWithdrawHistory.php b/examples/spot/nft/nftWithdrawHistory.php new file mode 100644 index 0000000..918ec4c --- /dev/null +++ b/examples/spot/nft/nftWithdrawHistory.php @@ -0,0 +1,23 @@ + $key, + 'secret' => $secret +]); + +$response = $client->nftWithdrawHistory( + [ + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'limit' => 50, + 'page' => 1, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/pay/payTradeHistory.php b/examples/spot/pay/payTradeHistory.php new file mode 100644 index 0000000..78460d0 --- /dev/null +++ b/examples/spot/pay/payTradeHistory.php @@ -0,0 +1,22 @@ + $key, + 'secret' => $secret +]); + +$response = $client->payTradeHistory( + [ + 'startTimestamp' => 1640995200000, + 'endTimestamp' => 1640995200000, + 'limit' => 100, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/portfoliomargin/portfolioMarginAccount.php b/examples/spot/portfoliomargin/portfolioMarginAccount.php new file mode 100644 index 0000000..0ff84ae --- /dev/null +++ b/examples/spot/portfoliomargin/portfolioMarginAccount.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->portfolioMarginAccount( + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/rebate/rebateSpotHistoryRecords.php b/examples/spot/rebate/rebateSpotHistoryRecords.php new file mode 100644 index 0000000..83d3327 --- /dev/null +++ b/examples/spot/rebate/rebateSpotHistoryRecords.php @@ -0,0 +1,22 @@ + $key, + 'secret' => $secret +]); + +$response = $client->rebateSpotHistoryRecords( + [ + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'page' => 1, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/savings/SavingsFlexibleRedeem.php b/examples/spot/savings/SavingsFlexibleRedeem.php new file mode 100644 index 0000000..3872bea --- /dev/null +++ b/examples/spot/savings/SavingsFlexibleRedeem.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->savingsFlexibleRedeem('1234', 1.01, 'FAST', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/savings/savingsAccount.php b/examples/spot/savings/savingsAccount.php new file mode 100644 index 0000000..e0d56e0 --- /dev/null +++ b/examples/spot/savings/savingsAccount.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->savingsAccount( + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/savings/savingsChangeDailyPosition.php b/examples/spot/savings/savingsChangeDailyPosition.php new file mode 100644 index 0000000..48b6da4 --- /dev/null +++ b/examples/spot/savings/savingsChangeDailyPosition.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->savingsChangeDailyPosition('1234', 1, + [ + 'positionId' => 100, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/savings/savingsCustomizedPosition.php b/examples/spot/savings/savingsCustomizedPosition.php new file mode 100644 index 0000000..0216b68 --- /dev/null +++ b/examples/spot/savings/savingsCustomizedPosition.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->savingsCustomizedPosition('BTC', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/savings/savingsFlexibleProductPosition.php b/examples/spot/savings/savingsFlexibleProductPosition.php new file mode 100644 index 0000000..7387f0e --- /dev/null +++ b/examples/spot/savings/savingsFlexibleProductPosition.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->savingsFlexibleProductPosition('BTC', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/savings/savingsFlexibleProducts.php b/examples/spot/savings/savingsFlexibleProducts.php new file mode 100644 index 0000000..6702008 --- /dev/null +++ b/examples/spot/savings/savingsFlexibleProducts.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->savingsFlexibleProducts( + [ + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/savings/savingsFlexiblePurchaseQuota.php b/examples/spot/savings/savingsFlexiblePurchaseQuota.php new file mode 100644 index 0000000..b3e357b --- /dev/null +++ b/examples/spot/savings/savingsFlexiblePurchaseQuota.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->savingsFlexiblePurchaseQuota('1234', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/savings/savingsFlexibleRedemptionQuota.php b/examples/spot/savings/savingsFlexibleRedemptionQuota.php new file mode 100644 index 0000000..54f29bd --- /dev/null +++ b/examples/spot/savings/savingsFlexibleRedemptionQuota.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->savingsFlexibleRedemptionQuota('1234', 'FAST', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/savings/savingsInterestHistory.php b/examples/spot/savings/savingsInterestHistory.php new file mode 100644 index 0000000..9e70c07 --- /dev/null +++ b/examples/spot/savings/savingsInterestHistory.php @@ -0,0 +1,22 @@ + $key, + 'secret' => $secret +]); + +$response = $client->savingsInterestHistory('DAILY', + [ + 'asset' => 'BNB', + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/savings/savingsProductList.php b/examples/spot/savings/savingsProductList.php new file mode 100644 index 0000000..9989e03 --- /dev/null +++ b/examples/spot/savings/savingsProductList.php @@ -0,0 +1,22 @@ + $key, + 'secret' => $secret +]); + +$response = $client->savingsProductList('ACTIVITY', + [ + 'asset' => 'BNB', + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/savings/savingsPurchaseCustomizedProject.php b/examples/spot/savings/savingsPurchaseCustomizedProject.php new file mode 100644 index 0000000..a967a16 --- /dev/null +++ b/examples/spot/savings/savingsPurchaseCustomizedProject.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->savingsPurchaseCustomizedProject('1234', 1, + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/savings/savingsPurchaseFlexibleProduct.php b/examples/spot/savings/savingsPurchaseFlexibleProduct.php new file mode 100644 index 0000000..13fc176 --- /dev/null +++ b/examples/spot/savings/savingsPurchaseFlexibleProduct.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->savingsPurchaseFlexibleProduct('1234', 1.01, + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/savings/savingsPurchaseRecord.php b/examples/spot/savings/savingsPurchaseRecord.php new file mode 100644 index 0000000..9881295 --- /dev/null +++ b/examples/spot/savings/savingsPurchaseRecord.php @@ -0,0 +1,22 @@ + $key, + 'secret' => $secret +]); + +$response = $client->savingsPurchaseRecord('DAILY', + [ + 'asset' => 'BNB', + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/savings/savingsRedemptionRecord.php b/examples/spot/savings/savingsRedemptionRecord.php new file mode 100644 index 0000000..296297f --- /dev/null +++ b/examples/spot/savings/savingsRedemptionRecord.php @@ -0,0 +1,22 @@ + $key, + 'secret' => $secret +]); + +$response = $client->savingsRedemptionRecord('DAILY', + [ + 'asset' => 'BNB', + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/staking/stakingHistory.php b/examples/spot/staking/stakingHistory.php new file mode 100644 index 0000000..8e2884b --- /dev/null +++ b/examples/spot/staking/stakingHistory.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->stakingHistory('STAKING', 'SUBSCRIPTION', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/staking/stakingProductList.php b/examples/spot/staking/stakingProductList.php new file mode 100644 index 0000000..54fd25f --- /dev/null +++ b/examples/spot/staking/stakingProductList.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->stakingProductList('STAKING', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/staking/stakingProductPosition.php b/examples/spot/staking/stakingProductPosition.php new file mode 100644 index 0000000..42d0bc4 --- /dev/null +++ b/examples/spot/staking/stakingProductPosition.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->stakingProductPosition('STAKING', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/staking/stakingProductQuota.php b/examples/spot/staking/stakingProductQuota.php new file mode 100644 index 0000000..4b73e44 --- /dev/null +++ b/examples/spot/staking/stakingProductQuota.php @@ -0,0 +1,15 @@ + $key, + 'secret' => $secret +]); + +$response = $client->stakingProductQuota('STAKING', 'Axs*90', ); + +echo json_encode($response); diff --git a/examples/spot/staking/stakingPurchaseProduct.php b/examples/spot/staking/stakingPurchaseProduct.php new file mode 100644 index 0000000..ae5f2cf --- /dev/null +++ b/examples/spot/staking/stakingPurchaseProduct.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->stakingPurchaseProduct('STAKING', 'Axs*90', 10.1, + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/staking/stakingRedeemProduct.php b/examples/spot/staking/stakingRedeemProduct.php new file mode 100644 index 0000000..d7cbbe4 --- /dev/null +++ b/examples/spot/staking/stakingRedeemProduct.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->stakingRedeemProduct('STAKING', 'Axs*90', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/staking/stakingSetAutoStaking.php b/examples/spot/staking/stakingSetAutoStaking.php new file mode 100644 index 0000000..2cff2ae --- /dev/null +++ b/examples/spot/staking/stakingSetAutoStaking.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->stakingSetAutoStaking('STAKING', '1234', 'true', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/stream/closeListenkey.php b/examples/spot/stream/closeListenkey.php new file mode 100644 index 0000000..f5495fb --- /dev/null +++ b/examples/spot/stream/closeListenkey.php @@ -0,0 +1,13 @@ + $key +]); + +$response = $client->closeListenKey('listen-key'); + +echo json_encode($response); diff --git a/examples/spot/stream/newListenkey.php b/examples/spot/stream/newListenkey.php new file mode 100644 index 0000000..840aec1 --- /dev/null +++ b/examples/spot/stream/newListenkey.php @@ -0,0 +1,13 @@ + $key +]); + +$response = $client->newListenKey(); + +echo json_encode($response); diff --git a/examples/spot/stream/renewListenkey.php b/examples/spot/stream/renewListenkey.php new file mode 100644 index 0000000..8d4e854 --- /dev/null +++ b/examples/spot/stream/renewListenkey.php @@ -0,0 +1,13 @@ + $key +]); + +$response = $client->renewListenKey('listen-key'); + +echo json_encode($response); diff --git a/examples/spot/subaccount/managedSubAccountDeposit.php b/examples/spot/subaccount/managedSubAccountDeposit.php new file mode 100644 index 0000000..c46f0e5 --- /dev/null +++ b/examples/spot/subaccount/managedSubAccountDeposit.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->managedSubAccountDeposit('testaccount@email.com', 'BTC', 1.01, + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/managedSubaccountAssetDetails.php b/examples/spot/subaccount/managedSubaccountAssetDetails.php new file mode 100644 index 0000000..5686b53 --- /dev/null +++ b/examples/spot/subaccount/managedSubaccountAssetDetails.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->managedSubAccountAssetDetails('testaccount@email.com', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/managedSubaccountSnapshot.php b/examples/spot/subaccount/managedSubaccountSnapshot.php new file mode 100644 index 0000000..26a885b --- /dev/null +++ b/examples/spot/subaccount/managedSubaccountSnapshot.php @@ -0,0 +1,22 @@ + $key, + 'secret' => $secret +]); + +$response = $client->managedSubAccountSnapshot('testaccount@email.com', 'SPOT', + [ + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'limit' => 123, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/managedSubaccountWithdraw.php b/examples/spot/subaccount/managedSubaccountWithdraw.php new file mode 100644 index 0000000..de2c374 --- /dev/null +++ b/examples/spot/subaccount/managedSubaccountWithdraw.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->managedSubAccountWithdraw('testaccount@email.com', 'BTC', 1.01, + [ + 'transferDate' => 1640995200000, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountAddIPList.php b/examples/spot/subaccount/subAccountAddIPList.php new file mode 100644 index 0000000..43cc2ca --- /dev/null +++ b/examples/spot/subaccount/subAccountAddIPList.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountAddIpList('testaccount@email.com', 'subAccountApiKey', '000.000.000.000', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountCreateVirtualAccount.php b/examples/spot/subaccount/subAccountCreateVirtualAccount.php new file mode 100644 index 0000000..a854774 --- /dev/null +++ b/examples/spot/subaccount/subAccountCreateVirtualAccount.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountCreateVirtualAccount('testaccount', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountDeleteIPList.php b/examples/spot/subaccount/subAccountDeleteIPList.php new file mode 100644 index 0000000..9134c84 --- /dev/null +++ b/examples/spot/subaccount/subAccountDeleteIPList.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountDeleteIpList('testaccount@email.com', 'subAccountApiKey', '000.000.000.000', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountDepositAddress.php b/examples/spot/subaccount/subAccountDepositAddress.php new file mode 100644 index 0000000..7b65dd8 --- /dev/null +++ b/examples/spot/subaccount/subAccountDepositAddress.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountDepositAddress('testaccount@email.com', 'BNB', + [ + 'network' => 'BNB', + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountDepositHistory.php b/examples/spot/subaccount/subAccountDepositHistory.php new file mode 100644 index 0000000..f31e670 --- /dev/null +++ b/examples/spot/subaccount/subAccountDepositHistory.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountDepositHistory('testaccount@email.com', + [ + 'coin' => 'BNB', + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountEnableFutures.php b/examples/spot/subaccount/subAccountEnableFutures.php new file mode 100644 index 0000000..f94f7da --- /dev/null +++ b/examples/spot/subaccount/subAccountEnableFutures.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountEnableFutures('testaccount@email.com', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountEnableLeverageToken.php b/examples/spot/subaccount/subAccountEnableLeverageToken.php new file mode 100644 index 0000000..20268a8 --- /dev/null +++ b/examples/spot/subaccount/subAccountEnableLeverageToken.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountEnableLeverageToken('testaccount@email.com', true, + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountEnableMargin.php b/examples/spot/subaccount/subAccountEnableMargin.php new file mode 100644 index 0000000..dd57ac3 --- /dev/null +++ b/examples/spot/subaccount/subAccountEnableMargin.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountEnableMargin('testaccount@email.com', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountFuturesAccount.php b/examples/spot/subaccount/subAccountFuturesAccount.php new file mode 100644 index 0000000..751fc4b --- /dev/null +++ b/examples/spot/subaccount/subAccountFuturesAccount.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountFuturesAccount('testaccount@email.com', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountFuturesAccountSummary.php b/examples/spot/subaccount/subAccountFuturesAccountSummary.php new file mode 100644 index 0000000..159e56a --- /dev/null +++ b/examples/spot/subaccount/subAccountFuturesAccountSummary.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountFuturesAccountSummary( + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountFuturesAccountSummaryV2.php b/examples/spot/subaccount/subAccountFuturesAccountSummaryV2.php new file mode 100644 index 0000000..6ad643e --- /dev/null +++ b/examples/spot/subaccount/subAccountFuturesAccountSummaryV2.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountFuturesAccountSummaryV2(1, + [ + 'page' => 1, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountFuturesAccountV2.php b/examples/spot/subaccount/subAccountFuturesAccountV2.php new file mode 100644 index 0000000..9bdda63 --- /dev/null +++ b/examples/spot/subaccount/subAccountFuturesAccountV2.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountFuturesAccountV2('testaccount@email.com', 1, + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountFuturesPositionRisk.php b/examples/spot/subaccount/subAccountFuturesPositionRisk.php new file mode 100644 index 0000000..a68e163 --- /dev/null +++ b/examples/spot/subaccount/subAccountFuturesPositionRisk.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountFuturesPositionRisk('testaccount@email.com', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountFuturesPositionRiskV2.php b/examples/spot/subaccount/subAccountFuturesPositionRiskV2.php new file mode 100644 index 0000000..c084910 --- /dev/null +++ b/examples/spot/subaccount/subAccountFuturesPositionRiskV2.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountFuturesPositionRiskV2('testaccount@email.com', 1, + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountFuturesTransfer.php b/examples/spot/subaccount/subAccountFuturesTransfer.php new file mode 100644 index 0000000..63536e3 --- /dev/null +++ b/examples/spot/subaccount/subAccountFuturesTransfer.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountFuturesTransfer('testaccount@email.com', 'BTC', 1.01, 1, + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountIPRestriction.php b/examples/spot/subaccount/subAccountIPRestriction.php new file mode 100644 index 0000000..c9fd5dc --- /dev/null +++ b/examples/spot/subaccount/subAccountIPRestriction.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountIpRestriction('testaccount@email.com', 'subAccountApiKey', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountList.php b/examples/spot/subaccount/subAccountList.php new file mode 100644 index 0000000..652237d --- /dev/null +++ b/examples/spot/subaccount/subAccountList.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountList( + [ + 'page' => 1, + 'limit' => 1, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountMarginAccount.php b/examples/spot/subaccount/subAccountMarginAccount.php new file mode 100644 index 0000000..d3dfed5 --- /dev/null +++ b/examples/spot/subaccount/subAccountMarginAccount.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountMarginAccount('testaccount@email.com', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountMarginAccountSummary.php b/examples/spot/subaccount/subAccountMarginAccountSummary.php new file mode 100644 index 0000000..32a3afd --- /dev/null +++ b/examples/spot/subaccount/subAccountMarginAccountSummary.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountMarginAccountSummary( + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountMarginTransfer.php b/examples/spot/subaccount/subAccountMarginTransfer.php new file mode 100644 index 0000000..e96f362 --- /dev/null +++ b/examples/spot/subaccount/subAccountMarginTransfer.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountMarginTransfer('testaccount@email.com', 'BTC', 1.01, 1, + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountStatus.php b/examples/spot/subaccount/subAccountStatus.php new file mode 100644 index 0000000..06ab840 --- /dev/null +++ b/examples/spot/subaccount/subAccountStatus.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountStatus( + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountToggleIPRestriction.php b/examples/spot/subaccount/subAccountToggleIPRestriction.php new file mode 100644 index 0000000..2da24ef --- /dev/null +++ b/examples/spot/subaccount/subAccountToggleIPRestriction.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountToggleIpRestriction('testaccount@email.com', 'subAccountApiKey', true, + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountTransferHistory.php b/examples/spot/subaccount/subAccountTransferHistory.php new file mode 100644 index 0000000..33080ca --- /dev/null +++ b/examples/spot/subaccount/subAccountTransferHistory.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountTransferHistory( + [ + 'page' => 1, + 'limit' => 1, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountTransferHistoryBySubAccount.php b/examples/spot/subaccount/subAccountTransferHistoryBySubAccount.php new file mode 100644 index 0000000..dd3e659 --- /dev/null +++ b/examples/spot/subaccount/subAccountTransferHistoryBySubAccount.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountTransferHistoryBySubAccount( + [ + 'asset' => 'BNB', + 'limit' => 500, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountTransferToMaster.php b/examples/spot/subaccount/subAccountTransferToMaster.php new file mode 100644 index 0000000..5d86d8e --- /dev/null +++ b/examples/spot/subaccount/subAccountTransferToMaster.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountTransferToMaster('BTC', 1.01, + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountTransferToSubAccount.php b/examples/spot/subaccount/subAccountTransferToSubAccount.php new file mode 100644 index 0000000..95ff000 --- /dev/null +++ b/examples/spot/subaccount/subAccountTransferToSubAccount.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountTransferToSubAccount('testaccount@email.com', 'BTC', 1.01, + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountUniversalTransfer.php b/examples/spot/subaccount/subAccountUniversalTransfer.php new file mode 100644 index 0000000..4abcdb1 --- /dev/null +++ b/examples/spot/subaccount/subAccountUniversalTransfer.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountUniversalTransfer('SPOT', 'COIN_FUTURE', 'BTC', 1.01, + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountUniversalTransferHistory.php b/examples/spot/subaccount/subAccountUniversalTransferHistory.php new file mode 100644 index 0000000..e68fd5c --- /dev/null +++ b/examples/spot/subaccount/subAccountUniversalTransferHistory.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountUniversalTransferHistory( + [ + 'page' => 1, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subaccountAssets.php b/examples/spot/subaccount/subaccountAssets.php new file mode 100644 index 0000000..38729d3 --- /dev/null +++ b/examples/spot/subaccount/subaccountAssets.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountAssets('testaccount@email.com', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subaccountFuturesAssetTransfer.php b/examples/spot/subaccount/subaccountFuturesAssetTransfer.php new file mode 100644 index 0000000..d079264 --- /dev/null +++ b/examples/spot/subaccount/subaccountFuturesAssetTransfer.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountFuturesAssetTransfer('testaccount@email.com', 'testaccount2@email.com', 2, 'BTC', 1.01, + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subaccountFuturesAssetTransferHistory.php b/examples/spot/subaccount/subaccountFuturesAssetTransferHistory.php new file mode 100644 index 0000000..aacf6b5 --- /dev/null +++ b/examples/spot/subaccount/subaccountFuturesAssetTransferHistory.php @@ -0,0 +1,23 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountFuturesAssetTransferHistory('testaccount@email.com', 2, + [ + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'page' => 1, + 'limit' => 123, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subaccountSpotAssetsSummary.php b/examples/spot/subaccount/subaccountSpotAssetsSummary.php new file mode 100644 index 0000000..a7037d8 --- /dev/null +++ b/examples/spot/subaccount/subaccountSpotAssetsSummary.php @@ -0,0 +1,22 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountSpotAssetsSummary( + [ + 'email' => 'testaccount@email.com', + 'page' => 1, + 'size' => 123, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/trade/account.php b/examples/spot/trade/account.php new file mode 100644 index 0000000..0216368 --- /dev/null +++ b/examples/spot/trade/account.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->account( + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/trade/allOrders.php b/examples/spot/trade/allOrders.php new file mode 100644 index 0000000..ec7fdd7 --- /dev/null +++ b/examples/spot/trade/allOrders.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->allOrders('BNBUSDT', + [ + 'limit' => 500, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/trade/cancelOCOOrder.php b/examples/spot/trade/cancelOCOOrder.php new file mode 100644 index 0000000..2757e10 --- /dev/null +++ b/examples/spot/trade/cancelOCOOrder.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->cancelOcoOrder('BNBUSDT', + [ + 'orderListId' => 12, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/trade/cancelOpenOrders.php b/examples/spot/trade/cancelOpenOrders.php new file mode 100644 index 0000000..a3b5258 --- /dev/null +++ b/examples/spot/trade/cancelOpenOrders.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->cancelOpenOrders('BNBUSDT', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/trade/cancelOrder.php b/examples/spot/trade/cancelOrder.php new file mode 100644 index 0000000..555081f --- /dev/null +++ b/examples/spot/trade/cancelOrder.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->cancelOrder('BNBUSDT', + [ + 'orderId' => 12, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/trade/getOCOOrder.php b/examples/spot/trade/getOCOOrder.php new file mode 100644 index 0000000..f9f79bb --- /dev/null +++ b/examples/spot/trade/getOCOOrder.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->getOcoOrder( + [ + 'orderListId' => 11, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/trade/getOCOOrders.php b/examples/spot/trade/getOCOOrders.php new file mode 100644 index 0000000..f109192 --- /dev/null +++ b/examples/spot/trade/getOCOOrders.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->getOcoOrders( + [ + 'fromId' => 11, + 'limit' => 500, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/trade/getOpenOcoOrders.php b/examples/spot/trade/getOpenOcoOrders.php new file mode 100644 index 0000000..965d1cc --- /dev/null +++ b/examples/spot/trade/getOpenOcoOrders.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->getOpenOcoOrders( + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/trade/getOrder.php b/examples/spot/trade/getOrder.php new file mode 100644 index 0000000..9bb68d0 --- /dev/null +++ b/examples/spot/trade/getOrder.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->getOrder('BNBUSDT', + [ + 'orderId' => 11, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/trade/myTrades.php b/examples/spot/trade/myTrades.php new file mode 100644 index 0000000..cc867de --- /dev/null +++ b/examples/spot/trade/myTrades.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->myTrades('BNBUSDT', + [ + 'limit' => 500, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/trade/newOCOOrder.php b/examples/spot/trade/newOCOOrder.php new file mode 100644 index 0000000..1e3f492 --- /dev/null +++ b/examples/spot/trade/newOCOOrder.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->newOcoOrder('BNBUSDT', 'SELL', 0.1, 400.15, 390.3, + [ + 'stopLimitPrice' => 380.3, + 'stopLimitTimeInForce' => 'GTC', + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/trade/newOrder.php b/examples/spot/trade/newOrder.php new file mode 100644 index 0000000..4b0a567 --- /dev/null +++ b/examples/spot/trade/newOrder.php @@ -0,0 +1,46 @@ + $key, + 'secret' => $secret, + 'baseURL' => 'https://testnet.binance.vision', # set the baseURL to testnet, omit for production site. + 'showWeightUsage' => true # optional, only if you need get order/ip weight usage +]); + +/** + * The complete parameters can be found at Binance API document + * https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md#new-order--trade + * + */ +$response = $client->newOrder('BNBUSDT', 'BUY', 'LIMIT', + [ + 'quantity' => 1, + 'price' => 200, + 'timeInForce' => 'GTC', + 'newOrderRespType' => 'FULL', + 'recvWindow' => 5000 + ] +); + + +/** + * + * Example of response from server: + * + * 1. When showWeightUsage = true : + * + * {"data":{"symbol":"BNBUSDT","orderId":2084513,"orderListId":-1,"clientOrderId":"KtiDFrEKK653aCzDyEvfzg","transactTime":1652949629940,"price":"200.00000000","origQty":"1.00000000","executedQty":"0.00000000","cummulativeQuoteQty":"0.00000000","status":"NEW","timeInForce":"GTC","type":"LIMIT","side":"BUY","fills":[]},"weight_usage":{"x-mbx-used-weight":["1"],"x-mbx-used-weight-1m":["1"],"x-mbx-order-count-10s":["1"],"x-mbx-order-count-1d":["1"]}} + * + * 2. When showWeightUsage is not set or set to false: + * + * {"symbol":"BNBUSDT","orderId":2084657,"orderListId":-1,"clientOrderId":"DhhXGyfCYGoiBR9lYLddCr","transactTime":1652949791775,"price":"200.00000000","origQty":"1.00000000","executedQty":"0.00000000","cummulativeQuoteQty":"0.00000000","status":"NEW","timeInForce":"GTC","type":"LIMIT","side":"BUY","fills":[]} + */ + +echo json_encode($response); + + diff --git a/examples/spot/trade/newOrderTest.php b/examples/spot/trade/newOrderTest.php new file mode 100644 index 0000000..a1cdc98 --- /dev/null +++ b/examples/spot/trade/newOrderTest.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->newOrderTest('BNBUSDT', 'SELL', 'MARKET', + [ + 'stopPrice' => 20.01, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/trade/openOrders.php b/examples/spot/trade/openOrders.php new file mode 100644 index 0000000..83ceeba --- /dev/null +++ b/examples/spot/trade/openOrders.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->openOrders( + [ + 'symbol' => 'BNBUSDT', + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/trade/orderLimitUsage.php b/examples/spot/trade/orderLimitUsage.php new file mode 100644 index 0000000..147c0af --- /dev/null +++ b/examples/spot/trade/orderLimitUsage.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->orderLimitUsage( + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/wallet/accountSnapshot.php b/examples/spot/wallet/accountSnapshot.php new file mode 100644 index 0000000..d98a83a --- /dev/null +++ b/examples/spot/wallet/accountSnapshot.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->accountSnapshot('SPOT', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/wallet/accountStatus.php b/examples/spot/wallet/accountStatus.php new file mode 100644 index 0000000..8f51836 --- /dev/null +++ b/examples/spot/wallet/accountStatus.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->accountStatus( + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/wallet/apiKeyPermission.php b/examples/spot/wallet/apiKeyPermission.php new file mode 100644 index 0000000..38ee557 --- /dev/null +++ b/examples/spot/wallet/apiKeyPermission.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->apiKeyPermission( + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/wallet/apiTradingStatus.php b/examples/spot/wallet/apiTradingStatus.php new file mode 100644 index 0000000..e688b41 --- /dev/null +++ b/examples/spot/wallet/apiTradingStatus.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->apiTradingStatus( + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/wallet/assetDetail.php b/examples/spot/wallet/assetDetail.php new file mode 100644 index 0000000..78c090b --- /dev/null +++ b/examples/spot/wallet/assetDetail.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->assetDetail( + [ + 'asset' => 'BNB', + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/wallet/assetDividendRecord.php b/examples/spot/wallet/assetDividendRecord.php new file mode 100644 index 0000000..d0ada77 --- /dev/null +++ b/examples/spot/wallet/assetDividendRecord.php @@ -0,0 +1,23 @@ + $key, + 'secret' => $secret +]); + +$response = $client->assetDividendRecord( + [ + 'asset' => 'BNB', + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'limit' => 123, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/wallet/coinInfo.php b/examples/spot/wallet/coinInfo.php new file mode 100644 index 0000000..4de916e --- /dev/null +++ b/examples/spot/wallet/coinInfo.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret, + 'showWeightUsage' => true, # optional, only if you need to display weight usage in result. +]); + +$response = $client->coinInfo( + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/wallet/depositAddress.php b/examples/spot/wallet/depositAddress.php new file mode 100644 index 0000000..a6bec82 --- /dev/null +++ b/examples/spot/wallet/depositAddress.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->depositAddress('BNB', + [ + 'network' => 'ETH', + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/wallet/depositHistory.php b/examples/spot/wallet/depositHistory.php new file mode 100644 index 0000000..6866bba --- /dev/null +++ b/examples/spot/wallet/depositHistory.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->depositHistory( + [ + 'coin' => 'BNB', + 'limit' => 500, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/wallet/disableFastWithdraw.php b/examples/spot/wallet/disableFastWithdraw.php new file mode 100644 index 0000000..d40179c --- /dev/null +++ b/examples/spot/wallet/disableFastWithdraw.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->disableFastWithdraw( + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/wallet/dustLog.php b/examples/spot/wallet/dustLog.php new file mode 100644 index 0000000..9814e1e --- /dev/null +++ b/examples/spot/wallet/dustLog.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->dustLog( + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/wallet/dustTransfer.php b/examples/spot/wallet/dustTransfer.php new file mode 100644 index 0000000..21f5024 --- /dev/null +++ b/examples/spot/wallet/dustTransfer.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->dustTransfer(['BTC', 'USDT'], + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/wallet/dustableAssets.php b/examples/spot/wallet/dustableAssets.php new file mode 100644 index 0000000..595f565 --- /dev/null +++ b/examples/spot/wallet/dustableAssets.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->dustableAssets( + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/wallet/enableFastWithdraw.php b/examples/spot/wallet/enableFastWithdraw.php new file mode 100644 index 0000000..d1c4488 --- /dev/null +++ b/examples/spot/wallet/enableFastWithdraw.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->enableFastWithdraw( + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/wallet/fundingWallet.php b/examples/spot/wallet/fundingWallet.php new file mode 100644 index 0000000..4f3b8ab --- /dev/null +++ b/examples/spot/wallet/fundingWallet.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->fundingWallet( + [ + 'asset' => 'BNB', + 'needBtcValuation' => 'true', + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/wallet/systemStatus.php b/examples/spot/wallet/systemStatus.php new file mode 100644 index 0000000..ad8a6e3 --- /dev/null +++ b/examples/spot/wallet/systemStatus.php @@ -0,0 +1,9 @@ +systemStatus(); + +echo json_encode($response); diff --git a/examples/spot/wallet/tradeFee.php b/examples/spot/wallet/tradeFee.php new file mode 100644 index 0000000..36ecba6 --- /dev/null +++ b/examples/spot/wallet/tradeFee.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->tradeFee( + [ + 'symbol' => 'BNBUSDT', + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/wallet/universalTransfer.php b/examples/spot/wallet/universalTransfer.php new file mode 100644 index 0000000..cc04260 --- /dev/null +++ b/examples/spot/wallet/universalTransfer.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->universalTransfer('MAIN_UMFUTURE', 'BTC', 1.01, + [ + 'fromSymbol' => 'BNBUSDT', + 'toSymbol' => 'BNBUSDT', + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/wallet/universalTransferHistory.php b/examples/spot/wallet/universalTransferHistory.php new file mode 100644 index 0000000..9b98443 --- /dev/null +++ b/examples/spot/wallet/universalTransferHistory.php @@ -0,0 +1,25 @@ + $key, + 'secret' => $secret +]); + +$response = $client->universalTransferHistory('MAIN_UMFUTURE', + [ + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'current' => 1, + 'size' => 100, + 'fromSymbol' => 'BNBUSDT', + 'toSymbol' => 'BNBUSDT', + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/wallet/withdraw.php b/examples/spot/wallet/withdraw.php new file mode 100644 index 0000000..f3c9cfa --- /dev/null +++ b/examples/spot/wallet/withdraw.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->withdraw('BNB', 'address', 1.01, + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/wallet/withdrawHistory.php b/examples/spot/wallet/withdrawHistory.php new file mode 100644 index 0000000..edc542d --- /dev/null +++ b/examples/spot/wallet/withdrawHistory.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->withdrawHistory( + [ + 'coin' => 'BNB', + 'limit' => 500, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/websocket/spot/aggTrade.php b/examples/websocket/spot/aggTrade.php new file mode 100644 index 0000000..fce710c --- /dev/null +++ b/examples/websocket/spot/aggTrade.php @@ -0,0 +1,16 @@ + function ($conn, $msg) { + echo $msg.PHP_EOL; + }, + 'ping' => function ($conn, $msg) { + echo "received ping from server".PHP_EOL; + } +]; + +$client->aggTrade('btcusdt', $callbacks); diff --git a/examples/websocket/spot/bookTicker.php b/examples/websocket/spot/bookTicker.php new file mode 100644 index 0000000..533148e --- /dev/null +++ b/examples/websocket/spot/bookTicker.php @@ -0,0 +1,20 @@ + function ($conn, $msg) { + echo $msg.PHP_EOL; + }, + 'ping' => function ($conn, $msg) { + echo "received ping from server".PHP_EOL; + } +]; + +# single pair +$client->bookTicker($callbacks, 'btcusdt'); + +# all pairs +// $client->bookTicker($callbacks); diff --git a/examples/websocket/spot/combined.php b/examples/websocket/spot/combined.php new file mode 100644 index 0000000..b27212a --- /dev/null +++ b/examples/websocket/spot/combined.php @@ -0,0 +1,16 @@ + function ($conn, $msg) { + echo $msg.PHP_EOL; + }, + 'ping' => function ($conn, $msg) { + echo "received ping from server".PHP_EOL; + } +]; + +$client->combined(['btcusdt@miniTicker', 'ethusdt@miniTicker'], $callbacks); diff --git a/examples/websocket/spot/diffBookDepth.php b/examples/websocket/spot/diffBookDepth.php new file mode 100644 index 0000000..2e6f8c8 --- /dev/null +++ b/examples/websocket/spot/diffBookDepth.php @@ -0,0 +1,43 @@ + $connector]); + +$callbacks = [ + 'message' => function ($conn, $msg) { + echo "received message > {$msg}".PHP_EOL; + }, + 'pong' => function ($conn) { + echo "received pong from server".PHP_EOL; + }, + 'ping' => function ($conn) { + echo "received ping from server".PHP_EOL; + }, + 'close' => function ($conn) { + echo "receive closed.".PHP_EOL; + } +]; + + +$client->diffBookDepth('btcusdt', '1000ms', $callbacks); + +# setup a timer to ping server intervally. +$loop->addPeriodicTimer(2, function () use ($client) { + $client->ping(); + echo "ping sent ".PHP_EOL; +}); + +$loop->run(); + diff --git a/examples/websocket/spot/kline.php b/examples/websocket/spot/kline.php new file mode 100644 index 0000000..f208b6d --- /dev/null +++ b/examples/websocket/spot/kline.php @@ -0,0 +1,16 @@ + function ($conn, $msg) { + echo $msg.PHP_EOL; + }, + 'ping' => function ($conn, $msg) { + echo "received ping from server".PHP_EOL; + } +]; + +$client->kline('btcusdt', '1h', $callbacks); \ No newline at end of file diff --git a/examples/websocket/spot/miniTicker.php b/examples/websocket/spot/miniTicker.php new file mode 100644 index 0000000..afed410 --- /dev/null +++ b/examples/websocket/spot/miniTicker.php @@ -0,0 +1,20 @@ + function ($conn, $msg) { + echo $msg.PHP_EOL; + }, + 'ping' => function ($conn, $msg) { + echo "received ping from server".PHP_EOL; + } +]; + +# single pair +$client->miniTicker($callbacks, 'btcusdt'); + +# all pairs +// $client->miniTicker($callbacks); diff --git a/examples/websocket/spot/partialBookDepth.php b/examples/websocket/spot/partialBookDepth.php new file mode 100644 index 0000000..edda190 --- /dev/null +++ b/examples/websocket/spot/partialBookDepth.php @@ -0,0 +1,16 @@ + function ($conn, $msg) { + echo $msg.PHP_EOL; + }, + 'ping' => function ($conn, $msg) { + echo "received ping from server".PHP_EOL; + } +]; + +$client->partialBookDepth('btcusdt', 5, '100ms', $callbacks); \ No newline at end of file diff --git a/examples/websocket/spot/ticker.php b/examples/websocket/spot/ticker.php new file mode 100644 index 0000000..b73d5fd --- /dev/null +++ b/examples/websocket/spot/ticker.php @@ -0,0 +1,33 @@ + $connector]); + + +$callbacks = [ + 'message' => function ($conn, $msg) { + echo $msg.PHP_EOL; + }, + 'ping' => function ($conn, $msg) { + echo "received ping from server".PHP_EOL; + } +]; + +# single pair +$client->ticker($callbacks, 'btcusdt'); + +# all pairs +// $client->ticker($callbacks); + +$loop->run(); diff --git a/examples/websocket/spot/trade.php b/examples/websocket/spot/trade.php new file mode 100644 index 0000000..fdf321f --- /dev/null +++ b/examples/websocket/spot/trade.php @@ -0,0 +1,16 @@ + function ($conn, $msg) { + echo $msg.PHP_EOL; + }, + 'ping' => function ($conn, $msg) { + echo "received ping from server".PHP_EOL; + } +]; + +$client->trade('btcusdt', $callbacks); diff --git a/examples/websocket/spot/userData.php b/examples/websocket/spot/userData.php new file mode 100644 index 0000000..867d798 --- /dev/null +++ b/examples/websocket/spot/userData.php @@ -0,0 +1,17 @@ + function ($conn, $msg) { + echo $msg.PHP_EOL; + }, + 'ping' => function ($conn, $msg) { + echo "received ping from server".PHP_EOL; + } +]; + +# replace with your own listen key +$client->userData('', $callbacks); \ No newline at end of file diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..ab58763 --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,13 @@ + + + + + ./src/Binance + + + + + ./tests + + + diff --git a/src/Binance/APIClient.php b/src/Binance/APIClient.php new file mode 100644 index 0000000..b8babcd --- /dev/null +++ b/src/Binance/APIClient.php @@ -0,0 +1,160 @@ +baseURL = $args['baseURL'] ?? null; + $this->key = $args['key'] ?? null; + $this->secret = $args['secret'] ?? null; + $this->logger = $args['logger'] ?? new NullLogger(); + $this->timeout = $args['timeout'] ?? 0; + $this->showWeightUsage = $args['showWeightUsage'] ?? false; + $this->showHeader = $args['showHeader'] ?? false; + $this->buildClient($args['httpClient'] ?? null); + } + + /** + * Send HTTP request that don't require signature + * This also can be used to send MARKET_DATA, which requires API key in the request header + */ + protected function publicRequest($method, $path, array $params = []) + { + return $this->processRequest($method, $path, $params); + } + + /** + * Send HTTP request that require signature + */ + protected function signRequest($method, $path, array $params = []) + { + $params['timestamp'] = round(microtime(true) * 1000); + $query = Url::buildQuery($params); + $params['signature'] = hash_hmac('sha256', $query, $this->secret); + + return $this->processRequest($method, $path, $params); + } + + private function processRequest($method, $path, $params = array()) + { + try { + $response = $this->httpRequest->request($method, $this->buildQuery($path, $params)); + } catch (\GuzzleHttp\Exception\ClientException $e) { + throw new ClientException($e); + } catch (\GuzzleHttp\Exception\ServerException $e) { + throw new ServerException($e); + } + + $body = json_decode($response->getBody(), true); + + if ($this->showWeightUsage) { + $weights = []; + foreach ($response->getHeaders() as $name => $value) { + $name = strtolower($name); + if (strpos($name, 'x-mbx-used-weight') === 0 || + strpos($name, 'x-mbx-order-count') === 0 || + strpos($name, 'x-sapi-used') === 0) { + $weights[$name] = $value; + } + } + return [ + 'data' => $body, + 'weight_usage' => $weights + ]; + } + + if ($this->showHeader) { + return [ + 'data' => $body, + 'header' => $response->getHeaders() + ]; + } + + return $body; + } + + private function buildQuery($path, $params = array()): string + { + if (count($params) == 0) { + return $path; + } + return $path . '?' . Url::buildQuery($params); + } + + private function buildClient($httpRequest) + { + $this->httpRequest = $httpRequest ?? + new \GuzzleHttp\Client([ + 'base_uri' => $this->baseURL, + 'headers' => [ + 'Content-Type' => 'application/json', + 'X-MBX-APIKEY' => $this->key, + 'User-Agent' => 'binance-connect-php' + ], + 'timeout' => $this->timeout + ]); + } +} diff --git a/src/Binance/Exception/BinanceException.php b/src/Binance/Exception/BinanceException.php new file mode 100644 index 0000000..52e48db --- /dev/null +++ b/src/Binance/Exception/BinanceException.php @@ -0,0 +1,7 @@ +field = $field; + $this->current_value = $current_value; + $this->expected_value = $expected_value; + $this->note = $note; + + parent::__construct(sprintf('"%s" is invalid. Expected: %s, current value: %s. %s.', $this->field, $this->expected_value, $this->current_value, $this->note)); + } +} diff --git a/src/Binance/Exception/MissingArgumentException.php b/src/Binance/Exception/MissingArgumentException.php new file mode 100644 index 0000000..d74188f --- /dev/null +++ b/src/Binance/Exception/MissingArgumentException.php @@ -0,0 +1,15 @@ +publicRequest('GET', '/sapi/v1/blvt/tokenInfo', $options); + } + + /** + * Subscribe BLVT (USER_DATA) + * + * POST /sapi/v1/blvt/subscribe + * + * Weight(IP): 1 + * + * @param string $tokenName + * @param mixed $cost + * @param array $options + */ + public function blvtSubscribe(string $tokenName, $cost, array $options = []) + { + if (Strings::isEmpty($tokenName)) { + throw new MissingArgumentException('tokenName'); + } + + return $this->signRequest('POST', '/sapi/v1/blvt/subscribe', array_merge( + $options, + [ + 'tokenName' => $tokenName, + 'cost' => $cost + ] + )); + } + + /** + * Query Subscription Record (USER_DATA) + * + * GET /sapi/v1/blvt/subscribe/record + * + * - Only the data of the latest 90 days is available + * + * Weight(IP): 1 + * + * @param array $options + */ + public function blvtSubscriptionRecord(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/blvt/subscribe/record', $options); + } + + /** + * Redeem BLVT (USER_DATA) + * + * POST /sapi/v1/blvt/redeem + * + * Weight(IP): 1 + * + * @param string $tokenName + * @param mixed $amount + * @param array $options + */ + public function blvtRedeem(string $tokenName, $amount, array $options = []) + { + if (Strings::isEmpty($tokenName)) { + throw new MissingArgumentException('tokenName'); + } + + return $this->signRequest('POST', '/sapi/v1/blvt/redeem', array_merge( + $options, + [ + 'tokenName' => $tokenName, + 'amount' => $amount + ] + )); + } + + /** + * Query Redemption Record (USER_DATA) + * + * GET /sapi/v1/blvt/redeem/record + * + * - Only the data of the latest 90 days is available + * + * Weight(IP): 1 + * + * @param array $options + */ + public function blvtRedemptionRecord(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/blvt/redeem/record', $options); + } + + /** + * Get BLVT User Limit Info (USER_DATA) + * + * GET /sapi/v1/blvt/userLimit + * + * Weight(IP): 1 + * + * @param array $options + */ + public function blvtUserLimitInfo(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/blvt/userLimit', $options); + } +} diff --git a/src/Binance/Spot/BSwap.php b/src/Binance/Spot/BSwap.php new file mode 100644 index 0000000..0186ecc --- /dev/null +++ b/src/Binance/Spot/BSwap.php @@ -0,0 +1,335 @@ +publicRequest('GET', '/sapi/v1/bswap/pools'); + } + + /** + * Get liquidity information of a pool (USER_DATA) + * + * GET /sapi/v1/bswap/liquidity + * + * Get liquidity information and user share of a pool. + * + * Weight(IP): + * - `1` for one pool; + * - `10` when the poolId parameter is omitted; + * + * @param array $options + */ + public function swapLiquidity(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/bswap/liquidity', $options); + } + + /** + * Add Liquidity (TRADE) + * + * POST /sapi/v1/bswap/liquidityAdd + * + * Add liquidity to a pool. + * + * Weight(UID): 1000 (Additional: 3 times one second) + * + * @param int $poolId + * @param string $asset + * @param mixed $quantity + * @param array $options + */ + public function swapAddLiquidity(int $poolId, string $asset, $quantity, array $options = []) + { + if (Strings::isEmpty($asset)) { + throw new MissingArgumentException('asset'); + } + + return $this->signRequest('POST', '/sapi/v1/bswap/liquidityAdd', array_merge( + $options, + [ + 'poolId' => $poolId, + 'asset' => $asset, + 'quantity' => $quantity + ] + )); + } + + /** + * Remove Liquidity (TRADE) + * + * POST /sapi/v1/bswap/liquidityRemove + * + * Remove liquidity from a pool, `type` include `SINGLE` and `COMBINATION`, asset is mandatory for single asset removal + * + * Weight(UID): 1000 (Additional: 3 times one second) + * + * @param int $poolId + * @param string $type + * @param mixed $shareAmount + * @param array $options + */ + public function swapRemoveLiquidity(int $poolId, string $type, $shareAmount, array $options = []) + { + if (Strings::isEmpty($type)) { + throw new MissingArgumentException('type'); + } + + return $this->signRequest('POST', '/sapi/v1/bswap/liquidityRemove', array_merge( + $options, + [ + 'poolId' => $poolId, + 'type' => $type, + 'shareAmount' => $shareAmount + ] + )); + } + + /** + * Get Liquidity Operation Record (USER_DATA) + * + * GET /sapi/v1/bswap/liquidityOps + * + * Get liquidity operation (add/remove) records. + * + * Weight(UID): 3000 + * + * @param array $options + */ + public function swapLiquidityOperationRecord(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/bswap/liquidityOps', $options); + } + + /** + * Request Quote (USER_DATA) + * + * GET /sapi/v1/bswap/quote + * + * Request a quote for swap quote asset (selling asset) for base asset (buying asset), essentially price/exchange rates. + * + * quoteQty is quantity of quote asset (to sell). + * + * Please be noted the quote is for reference only, the actual price will change as the liquidity changes, it's recommended to swap immediate after request a quote for slippage prevention. + * + * Weight(UID): 150 + * + * @param string $quoteAsset + * @param string $baseAsset + * @param mixed $quoteQty + * @param array $options + */ + public function swapRequestQuote(string $quoteAsset, string $baseAsset, $quoteQty, array $options = []) + { + if (Strings::isEmpty($quoteAsset)) { + throw new MissingArgumentException('quoteAsset'); + } + if (Strings::isEmpty($baseAsset)) { + throw new MissingArgumentException('baseAsset'); + } + + return $this->signRequest('GET', '/sapi/v1/bswap/quote', array_merge( + $options, + [ + 'quoteAsset' => $quoteAsset, + 'baseAsset' => $baseAsset, + 'quoteQty' => $quoteQty + ] + )); + } + + /** + * Swap (TRADE) + * + * POST /sapi/v1/bswap/swap + * + * Swap `quoteAsset` for `baseAsset`. + * + * Weight(UID): 1000 (Additional: 3 times one second) + * + * @param string $quoteAsset + * @param string $baseAsset + * @param mixed $quoteQty + * @param array $options + */ + public function swapSend(string $quoteAsset, string $baseAsset, $quoteQty, array $options = []) + { + if (Strings::isEmpty($quoteAsset)) { + throw new MissingArgumentException('quoteAsset'); + } + if (Strings::isEmpty($baseAsset)) { + throw new MissingArgumentException('baseAsset'); + } + + return $this->signRequest('POST', '/sapi/v1/bswap/swap', array_merge( + $options, + [ + 'quoteAsset' => $quoteAsset, + 'baseAsset' => $baseAsset, + 'quoteQty' => $quoteQty + ] + )); + } + + /** + * Get Swap History (USER_DATA) + * + * GET /sapi/v1/bswap/swap + * + * Get swap history. + * + * Weight(UID): 3000 + * + * @param array $options + */ + public function swapHistory(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/bswap/swap', $options); + } + + /** + * Get Pool Configure (USER_DATA) + * + * GET /sapi/v1/bswap/poolConfigure + * + * Weight(IP): 150 + * + * @param array $options + */ + public function swapPoolConfigure(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/bswap/poolConfigure', $options); + } + + /** + * Add Liquidity Preview (USER_DATA) + * + * GET /sapi/v1/bswap/addLiquidityPreview + * + * Calculate expected share amount for adding liquidity in single or dual token. + * + * Weight(IP): 150 + * + * @param int $poolId + * @param string $type + * @param string $quoteAsset + * @param mixed $quoteQty + * @param array $options + */ + public function swapAddLiquidityPreview(int $poolId, string $type, string $quoteAsset, $quoteQty, array $options = []) + { + if (Strings::isEmpty($type)) { + throw new MissingArgumentException('type'); + } + if (Strings::isEmpty($quoteAsset)) { + throw new MissingArgumentException('quoteAsset'); + } + + return $this->signRequest('GET', '/sapi/v1/bswap/addLiquidityPreview', array_merge( + $options, + [ + 'poolId' => $poolId, + 'type' => $type, + 'quoteAsset' => $quoteAsset, + 'quoteQty' => $quoteQty + ] + )); + } + + /** + * Remove Liquidity Preview (USER_DATA) + * + * GET /sapi/v1/bswap/removeLiquidityPreview + * + * Calculate the expected asset amount of single token redemption or dual token redemption. + * + * Weight(IP): 150 + * + * @param int $poolId + * @param string $type + * @param string $quoteAsset + * @param mixed $shareAmount + * @param array $options + */ + public function swapRemoveLiquidityPreview(int $poolId, string $type, string $quoteAsset, $shareAmount, array $options = []) + { + if (Strings::isEmpty($type)) { + throw new MissingArgumentException('type'); + } + if (Strings::isEmpty($quoteAsset)) { + throw new MissingArgumentException('quoteAsset'); + } + + return $this->signRequest('GET', '/sapi/v1/bswap/removeLiquidityPreview', array_merge( + $options, + [ + 'poolId' => $poolId, + 'type' => $type, + 'quoteAsset' => $quoteAsset, + 'shareAmount' => $shareAmount + ] + )); + } + + /** + * Get Unclaimed Rewards Record (USER_DATA) + * + * GET /sapi/v1/bswap/unclaimedRewards + * + * Get unclaimed rewards record. + * + * Weight(UID): 1000 + * + * @param array $options + */ + public function swapUnclaimedRewards(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/bswap/unclaimedRewards', $options); + } + + /** + * Claim Rewards (TRADE) + * + * POST /sapi/v1/bswap/claimRewards + * + * Claim swap rewards or liquidity rewards + * + * Weight(UID): 1000 + * + * @param array $options + */ + public function swapClaimRewards(array $options = []) + { + return $this->signRequest('POST', '/sapi/v1/bswap/claimRewards', $options); + } + + /** + * Get Claimed History (USER_DATA) + * + * GET /sapi/v1/bswap/claimedHistory + * + * Get history of claimed rewards. + * + * Weight(UID): 1000 + * + * @param array $options + */ + public function swapClaimedHistory(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/bswap/claimedHistory', $options); + } +} diff --git a/src/Binance/Spot/C2C.php b/src/Binance/Spot/C2C.php new file mode 100644 index 0000000..6c6c24b --- /dev/null +++ b/src/Binance/Spot/C2C.php @@ -0,0 +1,36 @@ +signRequest('GET', '/sapi/v1/c2c/orderMatch/listUserOrderHistory', array_merge( + $options, + [ + 'tradeType' => $tradeType + ] + )); + } +} diff --git a/src/Binance/Spot/Convert.php b/src/Binance/Spot/Convert.php new file mode 100644 index 0000000..ecd83f2 --- /dev/null +++ b/src/Binance/Spot/Convert.php @@ -0,0 +1,30 @@ +signRequest('GET', '/sapi/v1/convert/tradeFlow', array_merge( + $options, + [ + 'startTime' => $startTime, + 'endTime' => $endTime + ] + )); + } +} diff --git a/src/Binance/Spot/CryptoLoans.php b/src/Binance/Spot/CryptoLoans.php new file mode 100644 index 0000000..7696150 --- /dev/null +++ b/src/Binance/Spot/CryptoLoans.php @@ -0,0 +1,36 @@ +signRequest('GET', '/sapi/v1/loan/income', array_merge( + $options, + [ + 'asset' => $asset + ] + )); + } +} diff --git a/src/Binance/Spot/Fiat.php b/src/Binance/Spot/Fiat.php new file mode 100644 index 0000000..028e497 --- /dev/null +++ b/src/Binance/Spot/Fiat.php @@ -0,0 +1,57 @@ +signRequest('GET', '/sapi/v1/fiat/orders', array_merge( + $options, + [ + 'transactionType' => $transactionType + ] + )); + } + + /** + * Get Fiat Payments History (USER_DATA) + * + * GET /sapi/v1/fiat/payments + * + * - If beginTime and endTime are not sent, the recent 30-day data will be returned. + * + * Weight(IP): 1 + * + * @param int $transactionType + * @param array $options + */ + public function fiatPaymentsHistory(int $transactionType, array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/fiat/payments', array_merge( + $options, + [ + 'transactionType' => $transactionType + ] + )); + } +} diff --git a/src/Binance/Spot/GiftCard.php b/src/Binance/Spot/GiftCard.php new file mode 100644 index 0000000..69c635b --- /dev/null +++ b/src/Binance/Spot/GiftCard.php @@ -0,0 +1,118 @@ +signRequest('POST', '/sapi/v1/giftcard/createCode', array_merge( + $options, + [ + 'token' => $token, + 'amount' => $amount + ] + )); + } + + /** + * Redeem a Binance Code (USER_DATA) + * + * POST /sapi/v1/giftcard/redeemCode + * + * This API is for redeeming the Binance Code. Once redeemed, the coins will be deposited in your funding wallet. + * + * Please note that if you enter the wrong code 5 times within 24 hours, you will no longer be able to redeem any Binance Code that day. + * + * Weight(IP): 1 + * + * @param string $code + * @param array $options + */ + public function giftCardRedeemCode(string $code, array $options = []) + { + if (Strings::isEmpty($code)) { + throw new MissingArgumentException('code'); + } + + return $this->signRequest('POST', '/sapi/v1/giftcard/redeemCode', array_merge( + $options, + [ + 'code' => $code + ] + )); + } + + /** + * Verify a Binance Code (USER_DATA) + * + * GET /sapi/v1/giftcard/verify + * + * This API is for verifying whether the Binance Code is valid or not by entering Binance Code or reference number. + * + * Please note that if you enter the wrong binance code 5 times within an hour, you will no longer be able to verify any binance code for that hour. + * + * Weight(IP): 1 + * + * @param string $referenceNo + * @param array $options + */ + public function giftCardVerifyCode(string $referenceNo, array $options = []) + { + if (Strings::isEmpty($referenceNo)) { + throw new MissingArgumentException('referenceNo'); + } + + return $this->signRequest('GET', '/sapi/v1/giftcard/verify', array_merge( + $options, + [ + 'referenceNo' => $referenceNo + ] + )); + } + + /** + * Fetch RSA Public Key (USER_DATA) + * + * GET /sapi/v1/giftcard/cryptography/rsa-public-key + * + * This API is for fetching the RSA Public Key. + * This RSA Public key will be used to encrypt the card code. + * Please note that the RSA Public key fetched is valid only for the current day. + * + * Weight(IP): 1 + * + * @param array $options + */ + public function giftCardRsaPublicKey(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/giftcard/cryptography/rsa-public-key', $options); + } +} diff --git a/src/Binance/Spot/IsolatedMarginStream.php b/src/Binance/Spot/IsolatedMarginStream.php new file mode 100644 index 0000000..e9cf417 --- /dev/null +++ b/src/Binance/Spot/IsolatedMarginStream.php @@ -0,0 +1,92 @@ +publicRequest('POST', '/sapi/v1/userDataStream/isolated', + [ + 'symbol' => $symbol + ] + ); + } + + /** + * Ping/Keep-alive an Isolated Margin ListenKey (USER_STREAM) + * + * PUT /sapi/v1/userDataStream/isolated + * + * Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes. It's recommended to send a ping about every 30 minutes. + * + * Weight: 1 + * + * @param string $symbol + * @param string $listenKey + */ + public function isolatedMarginRenewListenKey(string $symbol, string $listenKey) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + if (Strings::isEmpty($listenKey)) { + throw new MissingArgumentException('listenKey'); + } + + return $this->publicRequest('PUT', '/sapi/v1/userDataStream/isolated', + [ + 'symbol' => $symbol, + 'listenKey' => $listenKey + ] + ); + } + + /** + * Close an Isolated Margin ListenKey (USER_STREAM) + * + * DELETE /sapi/v1/userDataStream/isolated + * + * Close out a user data stream. + * + * Weight: 1 + * + * @param string $symbol + * @param string $listenKey + */ + public function isolatedMarginCloseListenKey(string $symbol, string $listenKey) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + if (Strings::isEmpty($listenKey)) { + throw new MissingArgumentException('listenKey'); + } + + return $this->publicRequest('DELETE', '/sapi/v1/userDataStream/isolated', + [ + 'symbol' => $symbol, + 'listenKey' => $listenKey + ] + ); + } +} diff --git a/src/Binance/Spot/Margin.php b/src/Binance/Spot/Margin.php new file mode 100644 index 0000000..55fc92f --- /dev/null +++ b/src/Binance/Spot/Margin.php @@ -0,0 +1,1006 @@ +signRequest('POST', '/sapi/v1/margin/transfer', array_merge( + $options, + [ + 'asset' => $asset, + 'amount' => $amount, + 'type' => $type + ] + )); + } + + /** + * Margin Account Borrow (MARGIN) + * + * POST /sapi/v1/margin/loan + * + * Apply for a loan. + * + * - If "isIsolated" = "TRUE", "symbol" must be sent + * - "isIsolated" = "FALSE" for crossed margin loan + * + * Weight(UID): 3000 + * + * @param string $asset + * @param mixed $amount + * @param array $options + */ + public function marginBorrow(string $asset, $amount, array $options = []) + { + if (Strings::isEmpty($asset)) { + throw new MissingArgumentException('asset'); + } + + return $this->signRequest('POST', '/sapi/v1/margin/loan', array_merge( + $options, + [ + 'asset' => $asset, + 'amount' => $amount + ] + )); + } + + /** + * Margin Account Repay (MARGIN) + * + * POST /sapi/v1/margin/repay + * + * Repay loan for margin account. + * + * - If "isIsolated" = "TRUE", "symbol" must be sent + * - "isIsolated" = "FALSE" for crossed margin repay + * + * Weight(IP): 3000 + * + * @param string $asset + * @param mixed $amount + * @param array $options + */ + public function marginRepay(string $asset, $amount, array $options = []) + { + if (Strings::isEmpty($asset)) { + throw new MissingArgumentException('asset'); + } + + return $this->signRequest('POST', '/sapi/v1/margin/repay', array_merge( + $options, + [ + 'asset' => $asset, + 'amount' => $amount + ] + )); + } + + /** + * Query Margin Asset (MARKET_DATA) + * + * GET /sapi/v1/margin/asset + * + * Weight(IP): 10 + * + * @param string $asset + */ + public function marginAsset(string $asset) + { + if (Strings::isEmpty($asset)) { + throw new MissingArgumentException('asset'); + } + + return $this->publicRequest('GET', '/sapi/v1/margin/asset', + [ + 'asset' => $asset + ] + ); + } + + /** + * Query Cross Margin Pair (MARKET_DATA) + * + * GET /sapi/v1/margin/pair + * + * Weight(IP): 10 + * + * @param string $symbol + */ + public function marginPair(string $symbol) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + + return $this->publicRequest('GET', '/sapi/v1/margin/pair', + [ + 'symbol' => $symbol + ] + ); + } + + /** + * Get All Margin Assets (MARKET_DATA) + * + * GET /sapi/v1/margin/allAssets + * + * Weight(IP): 1 + */ + public function marginAllAssets() + { + return $this->publicRequest('GET', '/sapi/v1/margin/allAssets'); + } + + /** + * Get All Cross Margin Pairs (MARKET_DATA) + * + * GET /sapi/v1/margin/allPairs + * + * Weight(IP): 1 + */ + public function marginAllPairs() + { + return $this->publicRequest('GET', '/sapi/v1/margin/allPairs'); + } + + /** + * Query Margin PriceIndex (MARKET_DATA) + * + * GET /sapi/v1/margin/priceIndex + * + * Weight(IP): 10 + * + * @param string $symbol + */ + public function marginPriceIndex(string $symbol) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + + return $this->publicRequest('GET', '/sapi/v1/margin/priceIndex', + [ + 'symbol' => $symbol + ] + ); + } + + /** + * Margin Account New Order (TRADE) + * + * POST /sapi/v1/margin/order + * + * Post a new order for margin account. + * + * Weight(UID): 6 + * + * @param string $symbol + * @param string $side + * @param string $type + * @param array $options + */ + public function marginNewOrder(string $symbol, string $side, string $type, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + if (Strings::isEmpty($side)) { + throw new MissingArgumentException('side'); + } + if (Strings::isEmpty($type)) { + throw new MissingArgumentException('type'); + } + + return $this->signRequest('POST', '/sapi/v1/margin/order', array_merge( + $options, + [ + 'symbol' => $symbol, + 'side' => $side, + 'type' => $type + ] + )); + } + + /** + * Margin Account Cancel Order (TRADE) + * + * DELETE /sapi/v1/margin/order + * + * Cancel an active order for margin account. + * + * Either `orderId` or `origClientOrderId` must be sent. + * + * Weight(IP): 10 + * + * @param string $symbol + * @param array $options + */ + public function marginCancelOrder(string $symbol, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + + return $this->signRequest('DELETE', '/sapi/v1/margin/order', array_merge( + $options, + [ + 'symbol' => $symbol + ] + )); + } + + /** + * Margin Account Cancel all Open Orders on a Symbol (TRADE) + * + * DELETE /sapi/v1/margin/openOrders + * + * - Cancels all active orders on a symbol for margin account. + * - This includes OCO orders. + * + * Weight(IP): 1 + * + * + * @param string $symbol + * @param array $options + */ + public function marginCancelOpenOrders(string $symbol, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + + return $this->signRequest('DELETE', '/sapi/v1/margin/openOrders', array_merge( + $options, + [ + 'symbol' => $symbol + ] + )); + } + + /** + * Get Cross Margin Transfer History (USER_DATA) + * + * GET /sapi/v1/margin/transfer + * + * - Response in descending order + * - Returns data for last 7 days by default + * - Set `archived` to `true` to query data from 6 months ago + * + * Weight(IP): 1 + * + * @param array $options + */ + public function marginTransferHistory(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/margin/transfer', $options); + } + + /** + * Query Loan Record (USER_DATA) + * + * GET /sapi/v1/margin/loan + * + * - `txId` or `startTime` must be sent. `txId` takes precedence. + * - Response in descending order + * - If `isolatedSymbol` is not sent, crossed margin data will be returned + * - Set `archived` to `true` to query data from 6 months ago + * + * Weight(IP): 10 + * + * @param string $asset + * @param array $options + */ + public function marginLoanRecord(string $asset, array $options = []) + { + if (Strings::isEmpty($asset)) { + throw new MissingArgumentException('asset'); + } + + return $this->signRequest('GET', '/sapi/v1/margin/loan', array_merge( + $options, + [ + 'asset' => $asset + ] + )); + } + + /** + * Query Repay Record (USER_DATA) + * + * GET /sapi/v1/margin/repay + * + * - `txId` or `startTime` must be sent. `txId` takes precedence. + * - Response in descending order + * - If `isolatedSymbol` is not sent, crossed margin data will be returned + * - Set `archived` to `true` to query data from 6 months ago + * + * Weight(IP): 10 + * + * @param string $asset + * @param array $options + */ + public function marginRepayRecord(string $asset, array $options = []) + { + if (Strings::isEmpty($asset)) { + throw new MissingArgumentException('asset'); + } + + return $this->signRequest('GET', '/sapi/v1/margin/repay', array_merge( + $options, + [ + 'asset' => $asset + ] + )); + } + + /** + * Get Interest History (USER_DATA) + * + * GET /sapi/v1/margin/interestHistory + * + * - Response in descending order + * - If `isolatedSymbol` is not sent, crossed margin data will be returned + * - Set `archived` to `true` to query data from 6 months ago + * - `type` in response has 4 enums: + * - `PERIODIC` interest charged per hour + * - `ON_BORROW` first interest charged on borrow + * - `PERIODIC_CONVERTED` interest charged per hour converted into BNB + * - `ON_BORROW_CONVERTED` first interest charged on borrow converted into BNB + * + * Weight(IP): 1 + * + * @param array $options + */ + public function marginInterestHistory(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/margin/interestHistory', $options); + } + + /** + * Get Force Liquidation Record (USER_DATA) + * + * GET /sapi/v1/margin/forceLiquidationRec + * + * - Response in descending order + * + * Weight(IP): 1 + * + * @param array $options + */ + public function marginForceLiquidationRecord(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/margin/forceLiquidationRec', $options); + } + + /** + * Query Cross Margin Account Details (USER_DATA) + * + * GET /sapi/v1/margin/account + * + * Weight(IP): 10 + * + * @param array $options + */ + public function marginAccount(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/margin/account', $options); + } + + /** + * Query Margin Account's Order (USER_DATA) + * + * GET /sapi/v1/margin/order + * + * - Either `orderId` or `origClientOrderId` must be sent. + * - For some historical orders `cummulativeQuoteQty` will be < 0, meaning the data is not available at this time. + * + * Weight(IP): 10 + * + * @param string $symbol + * @param array $options + */ + public function marginOrder(string $symbol, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + + return $this->signRequest('GET', '/sapi/v1/margin/order', array_merge( + $options, + [ + 'symbol' => $symbol + ] + )); + } + + /** + * Query Margin Account's Open Orders (USER_DATA) + * + * GET /sapi/v1/margin/openOrders + * + * - If the `symbol` is not sent, orders for all symbols will be returned in an array. + * - When all symbols are returned, the number of requests counted against the rate limiter is equal to the number of symbols currently trading on the exchange + * - If isIsolated ="TRUE", symbol must be sent. + * + * Weight(IP): 10 + * + * @param array $options + */ + public function marginOpenOrders(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/margin/openOrders', $options); + } + + /** + * Query Margin Account's All Orders (USER_DATA) + * + * GET /sapi/v1/margin/allOrders + * + * - If `orderId` is set, it will get orders >= that orderId. Otherwise most recent orders are returned. + * - For some historical orders `cummulativeQuoteQty` will be < 0, meaning the data is not available at this time. + * + * Weight(IP): 200 + * + * Request Limit: 60 times/min per IP + * + * @param string $symbol + * @param array $options + */ + public function marginAllOrders(string $symbol, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + + return $this->signRequest('GET', '/sapi/v1/margin/allOrders', array_merge( + $options, + [ + 'symbol' => $symbol + ] + )); + } + + /** + * Margin Account New OCO (TRADE) + * + * POST /sapi/v1/margin/order/oco + * + * Send in a new OCO for a margin account + * + * - Price Restrictions: + * - SELL: Limit Price > Last Price > Stop Price + * - BUY: Limit Price < Last Price < Stop Price + * - Quantity Restrictions: + * - Both legs must have the same quantity + * - ICEBERG quantities however do not have to be the same. + * - Order Rate Limit + * - OCO counts as 2 orders against the order rate limit. + * + * Weight(UID): 6 + * + * @param string $symbol + * @param string $side + * @param mixed $quantity + * @param mixed $price + * @param mixed $stopPrice + * @param array $options + */ + public function marginNewOcoOrder(string $symbol, string $side, $quantity, $price, $stopPrice, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + if (Strings::isEmpty($side)) { + throw new MissingArgumentException('side'); + } + + return $this->signRequest('POST', '/sapi/v1/margin/order/oco', array_merge( + $options, + [ + 'symbol' => $symbol, + 'side' => $side, + 'quantity' => $quantity, + 'price' => $price, + 'stopPrice' => $stopPrice + ] + )); + } + + /** + * Margin Account Cancel OCO (TRADE) + * + * DELETE /sapi/v1/margin/orderList + * + * Cancel an entire Order List for a margin account + * + * - Canceling an individual leg will cancel the entire OCO + * - Either `orderListId` or `listClientOrderId` must be provided + * + * Weight(UID): 1 + * + * @param string $symbol + * @param array $options + */ + public function marginCancelOcoOrder(string $symbol, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + + return $this->signRequest('DELETE', '/sapi/v1/margin/orderList', array_merge( + $options, + [ + 'symbol' => $symbol + ] + )); + } + + /** + * Query Margin Account's OCO (USER_DATA) + * + * GET /sapi/v1/margin/orderList + * + * Retrieves a specific OCO based on provided optional parameters + * + * - Either `orderListId` or `origClientOrderId` must be provided + * + * Weight(IP): 10 + * + * @param array $options + */ + public function marginOcoOrder(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/margin/orderList', $options); + } + + /** + * Query Margin Account's all OCO (USER_DATA) + * + * GET /sapi/v1/margin/allOrderList + * + * Retrieves all OCO for a specific margin account based on provided optional parameters + * + * Weight(IP): 200 + * + * @param array $options + */ + public function marginAllOcoOrder(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/margin/allOrderList', $options); + } + + /** + * Query Margin Account's Open OCO (USER_DATA) + * + * GET /sapi/v1/margin/openOrderList + * + * Weight(IP): 10 + * + * @param array $options + */ + public function marginOpenOcoOrder(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/margin/openOrderList', $options); + } + + /** + * Query Margin Account's Trade List (USER_DATA) + * + * GET /sapi/v1/margin/myTrades + * + * - If `fromId` is set, it will get orders >= that `fromId`. Otherwise most recent trades are returned. + * + * Weight(IP): 10 + * + * @param string $symbol + * @param array $options + */ + public function marginMyTrades(string $symbol, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + + return $this->signRequest('GET', '/sapi/v1/margin/myTrades', array_merge( + $options, + [ + 'symbol' => $symbol + ] + )); + } + + /** + * Query Max Borrow (USER_DATA) + * + * GET /sapi/v1/margin/maxBorrowable + * + * - If `isolatedSymbol` is not sent, crossed margin data will be sent. + * - `borrowLimit` is also available from https://www.binance.com/en/margin-fee + * + * Weight(IP): 50 + * + * @param string $asset + * @param array $options + */ + public function marginMaxBorrowable(string $asset, array $options = []) + { + if (Strings::isEmpty($asset)) { + throw new MissingArgumentException('asset'); + } + + return $this->signRequest('GET', '/sapi/v1/margin/maxBorrowable', array_merge( + $options, + [ + 'asset' => $asset + ] + )); + } + + /** + * Query Max Transfer-Out Amount (USER_DATA) + * + * GET /sapi/v1/margin/maxTransferable + * + * - If `isolatedSymbol` is not sent, crossed margin data will be sent. + * + * Weight(IP): 50 + * + * @param string $asset + * @param array $options + */ + public function marginMaxTransferable(string $asset, array $options = []) + { + if (Strings::isEmpty($asset)) { + throw new MissingArgumentException('asset'); + } + + return $this->signRequest('GET', '/sapi/v1/margin/maxTransferable', array_merge( + $options, + [ + 'asset' => $asset + ] + )); + } + + /** + * Isolated Margin Account Transfer (MARGIN) + * + * POST /sapi/v1/margin/isolated/transfer + * + * Weight(UID): 600 + * + * @param string $asset + * @param string $symbol + * @param string $transFrom + * @param string $transTo + * @param mixed $amount + * @param array $options + */ + public function isolatedMarginTransfer(string $asset, string $symbol, string $transFrom, string $transTo, $amount, array $options = []) + { + if (Strings::isEmpty($asset)) { + throw new MissingArgumentException('asset'); + } + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + if (Strings::isEmpty($transFrom)) { + throw new MissingArgumentException('transFrom'); + } + if (Strings::isEmpty($transTo)) { + throw new MissingArgumentException('transTo'); + } + + return $this->signRequest('POST', '/sapi/v1/margin/isolated/transfer', array_merge( + $options, + [ + 'asset' => $asset, + 'symbol' => $symbol, + 'transFrom' => $transFrom, + 'transTo' => $transTo, + 'amount' => $amount + ] + )); + } + + /** + * Get Isolated Margin Transfer History (USER_DATA) + * + * GET /sapi/v1/margin/isolated/transfer + * + * Weight(IP): 1 + * + * @param string $symbol + * @param array $options + */ + public function isolatedMarginTransferHistory(string $symbol, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + + return $this->signRequest('GET', '/sapi/v1/margin/isolated/transfer', array_merge( + $options, + [ + 'symbol' => $symbol + ] + )); + } + + /** + * Disable Isolated Margin Account (TRADE) + * + * DELETE /sapi/v1/margin/isolated/account + * + * Disable isolated margin account for a specific symbol. Each trading pair can only be deactivated once every 24 hours . + * + * Weight(UID): 300 + * + * @param string $symbol + * @param array $options + */ + public function isolatedMarginDisableAccount(string $symbol, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + + return $this->signRequest('DELETE', '/sapi/v1/margin/isolated/account', array_merge( + $options, + [ + 'symbol' => $symbol + ] + )); + } + + /** + * Enable Isolated Margin Account (TRADE) + * + * POST /sapi/v1/margin/isolated/account + * + * Enable isolated margin account for a specific symbol. + * + * Weight(UID): 300 + * + * @param string $symbol + * @param array $options + */ + public function isolatedMarginEnableAccount(string $symbol, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + + return $this->signRequest('POST', '/sapi/v1/margin/isolated/account', array_merge( + $options, + [ + 'symbol' => $symbol + ] + )); + } + + /** + * Query Enabled Isolated Margin Account Limit (USER_DATA) + * + * GET /sapi/v1/margin/isolated/accountLimit + * + * Query enabled isolated margin account limit. + * + * Weight(IP): 1 + * + * @param array $options + */ + public function isolatedMarginAccountLimit(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/margin/isolated/accountLimit', $options); + } + + /** + * Query Isolated Margin Symbol (USER_DATA) + * + * GET /sapi/v1/margin/isolated/pair + * + * Weight(IP): 10 + * + * @param string $symbol + * @param array $options + */ + public function isolatedMarginSymbol(string $symbol, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + + return $this->signRequest('GET', '/sapi/v1/margin/isolated/pair', array_merge( + $options, + [ + 'symbol' => $symbol + ] + )); + } + + /** + * Get All Isolated Margin Symbol (USER_DATA) + * + * GET /sapi/v1/margin/isolated/allPairs + * + * Weight(IP): 10 + * + * @param array $options + */ + public function isolatedMarginAllSymbols(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/margin/isolated/allPairs', $options); + } + + /** + * Toggle BNB Burn On Spot Trade And Margin Interest (USER_DATA) + * + * POST /sapi/v1/bnbBurn + * + * - "spotBNBBurn" and "interestBNBBurn" should be sent at least one. + * + * Weight(IP): 1 + * + * @param array $options + */ + public function toggleBnbBurn(array $options = []) + { + return $this->signRequest('POST', '/sapi/v1/bnbBurn', $options); + } + + /** + * Get BNB Burn Status (USER_DATA) + * + * GET /sapi/v1/bnbBurn + * + * Weight(IP): 1 + * + * @param array $options + */ + public function bnbBurnStatus(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/bnbBurn', $options); + } + + /** + * Query Margin Interest Rate History (USER_DATA) + * + * GET /sapi/v1/margin/interestRateHistory + * + * The max interval between startTime and endTime is 30 days. + * + * Weight(IP): 1 + * + * @param string $asset + * @param array $options + */ + public function marginInterestRateHistory(string $asset, array $options = []) + { + if (Strings::isEmpty($asset)) { + throw new MissingArgumentException('asset'); + } + + return $this->signRequest('GET', '/sapi/v1/margin/interestRateHistory', array_merge( + $options, + [ + 'asset' => $asset + ] + )); + } + + /** + * Query Cross Margin Fee Data (USER_DATA) + * + * GET /sapi/v1/margin/crossMarginData + * + * Get cross margin fee data collection with any vip level or user's current specific data as https://www.binance.com/en/margin-fee + * + * Weight(IP): 1 when coin is specified; 5 when the coin parameter is omitted + * + * @param array $options + */ + public function marginFeeData(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/margin/crossMarginData', $options); + } + + /** + * Query Isolated Margin Fee Data (USER_DATA) + * + * GET /sapi/v1/margin/isolatedMarginData + * + * Get isolated margin fee data collection with any vip level or user's current specific data as https://www.binance.com/en/margin-fee + * + * Weight(IP): 1 when a single is specified; 10 when the symbol parameter is omitted + * + * @param array $options + */ + public function isolatedMarginFeeData(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/margin/isolatedMarginData', $options); + } + + /** + * Query Isolated Margin Tier Data (USER_DATA) + * + * GET /sapi/v1/margin/isolatedMarginTier + * + * Get isolated margin tier data collection with any tier as https://www.binance.com/en/margin-data + * + * Weight(IP): 1 + * + * @param string $symbol + * @param array $options + */ + public function isolatedMarginTierData(string $symbol, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + + return $this->signRequest('GET', '/sapi/v1/margin/isolatedMarginTier', array_merge( + $options, + [ + 'symbol' => $symbol + ] + )); + } + + /** + * Query Isolated Margin Account Info (USER_DATA) + * + * GET /sapi/v1/margin/isolated/account + * + * - If "symbols" is not sent, all isolated assets will be returned. + * - If "symbols" is sent, only the isolated assets of the sent symbols will be returned. + * + * Weight(IP): 10 + * + * @param array $options + */ + public function isolatedMarginAccount(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/margin/isolated/account', $options); + } + + /** + * Query Current Margin Order Count Usage (TRADE) + * + * GET /sapi/v1/margin/rateLimit/order + * + * Displays the user's current margin order count usage for all intervals. + * + * Weight(IP): 20 + * + * @param array $options + */ + public function marginOrderCountUsage(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/margin/rateLimit/order', $options); + } +} diff --git a/src/Binance/Spot/MarginStream.php b/src/Binance/Spot/MarginStream.php new file mode 100644 index 0000000..3c0a2c6 --- /dev/null +++ b/src/Binance/Spot/MarginStream.php @@ -0,0 +1,72 @@ +publicRequest('POST', '/sapi/v1/userDataStream'); + } + + /** + * Ping/Keep-alive a Margin ListenKey (USER_STREAM) + * + * PUT /sapi/v1/userDataStream + * + * Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes. It's recommended to send a ping about every 30 minutes. + * + * Weight: 1 + * + * @param string $listenKey + */ + public function marginRenewListenKey(string $listenKey) + { + if (Strings::isEmpty($listenKey)) { + throw new MissingArgumentException('listenKey'); + } + + return $this->publicRequest('PUT', '/sapi/v1/userDataStream', + [ + 'listenKey' => $listenKey + ] + ); + } + + /** + * Close a Margin ListenKey (USER_STREAM) + * + * DELETE /sapi/v1/userDataStream + * + * Close out a user data stream. + * + * Weight: 1 + * + * @param string $listenKey + */ + public function marginCloseListenKey(string $listenKey) + { + if (Strings::isEmpty($listenKey)) { + throw new MissingArgumentException('listenKey'); + } + + return $this->publicRequest('DELETE', '/sapi/v1/userDataStream', + [ + 'listenKey' => $listenKey + ] + ); + } +} diff --git a/src/Binance/Spot/Market.php b/src/Binance/Spot/Market.php new file mode 100644 index 0000000..2cc5962 --- /dev/null +++ b/src/Binance/Spot/Market.php @@ -0,0 +1,282 @@ +publicRequest('GET', '/api/v3/ping'); + } + + /** + * Check Server Time + * + * GET /api/v3/time + * + * Test connectivity to the Rest API and get the current server time. + * + * Weight(IP): 1 + */ + public function time() + { + return $this->publicRequest('GET', '/api/v3/time'); + } + + /** + * Exchange Information + * + * GET /api/v3/exchangeInfo + * + * Current exchange trading rules and symbol information + * + * - If any symbol provided in either symbol or symbols do not exist, the endpoint will throw an error. + * + * Weight(IP): 10 + * + * @param array $options + */ + public function exchangeInfo(array $options = []) + { + return $this->publicRequest('GET', '/api/v3/exchangeInfo', $options); + } + + /** + * Order Book + * + * GET /api/v3/depth + * + * | Limit | Weight(IP) | + * |---------------------|-------------| + * | 1-100 | 1 | + * | 101-500 | 5 | + * | 501-1000 | 10 | + * | 1001-5000 | 50 | + * + * @param string $symbol + * @param array $options + */ + public function depth(string $symbol, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + + return $this->publicRequest('GET', '/api/v3/depth', array_merge( + $options, + [ + 'symbol' => $symbol + ] + )); + } + + /** + * Recent Trades List + * + * GET /api/v3/trades + * + * Get recent trades. + * + * Weight(IP): 1 + * + * @param string $symbol + * @param array $options + */ + public function trades(string $symbol, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + + return $this->publicRequest('GET', '/api/v3/trades', array_merge( + $options, + [ + 'symbol' => $symbol + ] + )); + } + + /** + * Old Trade Lookup (MARKET_DATA) + * + * GET /api/v3/historicalTrades + * + * Get older market trades. + * + * Weight(IP): 5 + * + * @param string $symbol + * @param array $options + */ + public function historicalTrades(string $symbol, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + + return $this->publicRequest('GET', '/api/v3/historicalTrades', array_merge( + $options, + [ + 'symbol' => $symbol + ] + )); + } + + /** + * Compressed/Aggregate Trades List + * + * GET /api/v3/aggTrades + * + * Get compressed, aggregate trades. Trades that fill at the time, from the same order, with the same price will have the quantity aggregated. + * - If `startTime` and `endTime` are sent, time between startTime and endTime must be less than 1 hour. + * - If `fromId`, `startTime`, and `endTime` are not sent, the most recent aggregate trades will be returned. + * + * Weight(IP): 1 + * + * @param string $symbol + * @param array $options + */ + public function aggTrades(string $symbol, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + + return $this->publicRequest('GET', '/api/v3/aggTrades', array_merge( + $options, + [ + 'symbol' => $symbol + ] + )); + } + + /** + * Kline/Candlestick Data + * + * GET /api/v3/klines + * + * Kline/candlestick bars for a symbol. + * Klines are uniquely identified by their open time. + * + * - If `startTime` and `endTime` are not sent, the most recent klines are returned. + * + * Weight(IP): 1 + * + * @param string $symbol + * @param string $interval + * @param array $options + */ + public function klines(string $symbol, string $interval, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + if (Strings::isEmpty($interval)) { + throw new MissingArgumentException('interval'); + } + + return $this->publicRequest('GET', '/api/v3/klines', array_merge( + $options, + [ + 'symbol' => $symbol, + 'interval' => $interval + ] + )); + } + + /** + * Current Average Price + * + * GET /api/v3/avgPrice + * + * Current average price for a symbol. + * + * Weight(IP): 1 + * + * @param string $symbol + */ + public function avgPrice(string $symbol) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + + return $this->publicRequest('GET', '/api/v3/avgPrice', + [ + 'symbol' => $symbol + ] + ); + } + + /** + * 24hr Ticker Price Change Statistics + * + * GET /api/v3/ticker/24hr + * + * 24 hour rolling window price change statistics. Careful when accessing this with no symbol. + * + * - If the symbol is not sent, tickers for all symbols will be returned in an array. + * + * Weight(IP): + * - `1` for a single symbol; + * - `40` when the symbol parameter is omitted; + * + * @param array $options + */ + public function ticker24hr(array $options = []) + { + return $this->publicRequest('GET', '/api/v3/ticker/24hr', $options); + } + + /** + * Symbol Price Ticker + * + * GET /api/v3/ticker/price + * + * Latest price for a symbol or symbols. + * + * - If the symbol is not sent, prices for all symbols will be returned in an array. + * + * Weight(IP): + * - `1` for a single symbol; + * - `2` when the symbol parameter is omitted; + * + * @param array $options + */ + public function tickerPrice(array $options = []) + { + return $this->publicRequest('GET', '/api/v3/ticker/price', $options); + } + + /** + * Symbol Order Book Ticker + * + * GET /api/v3/ticker/bookTicker + * + * Best price/qty on the order book for a symbol or symbols. + * + * - If the symbol is not sent, bookTickers for all symbols will be returned in an array. + * + * Weight(IP): + * - `1` for a single symbol; + * - `2` when the symbol parameter is omitted; + * + * @param array $options + */ + public function bookTicker(array $options = []) + { + return $this->publicRequest('GET', '/api/v3/ticker/bookTicker', $options); + } +} diff --git a/src/Binance/Spot/Mining.php b/src/Binance/Spot/Mining.php new file mode 100644 index 0000000..727a878 --- /dev/null +++ b/src/Binance/Spot/Mining.php @@ -0,0 +1,341 @@ +publicRequest('GET', '/sapi/v1/mining/pub/algoList'); + } + + /** + * Acquiring CoinName (MARKET_DATA) + * + * GET /sapi/v1/mining/pub/coinList + * + * Weight(IP): 1 + */ + public function miningCoinList() + { + return $this->publicRequest('GET', '/sapi/v1/mining/pub/coinList'); + } + + /** + * Request for Detail Miner List (USER_DATA) + * + * GET /sapi/v1/mining/worker/detail + * + * Weight(IP): 5 + * + * @param string $algo + * @param string $userName + * @param string $workerName + * @param array $options + */ + public function miningWorker(string $algo, string $userName, string $workerName, array $options = []) + { + if (Strings::isEmpty($algo)) { + throw new MissingArgumentException('algo'); + } + if (Strings::isEmpty($userName)) { + throw new MissingArgumentException('userName'); + } + if (Strings::isEmpty($workerName)) { + throw new MissingArgumentException('workerName'); + } + + return $this->signRequest('GET', '/sapi/v1/mining/worker/detail', array_merge( + $options, + [ + 'algo' => $algo, + 'userName' => $userName, + 'workerName' => $workerName + ] + )); + } + + /** + * Request for Miner List (USER_DATA) + * + * GET /sapi/v1/mining/worker/list + * + * Weight(IP): 5 + * + * @param string $algo + * @param string $userName + * @param array $options + */ + public function miningWorkerList(string $algo, string $userName, array $options = []) + { + if (Strings::isEmpty($algo)) { + throw new MissingArgumentException('algo'); + } + if (Strings::isEmpty($userName)) { + throw new MissingArgumentException('userName'); + } + + return $this->signRequest('GET', '/sapi/v1/mining/worker/list', array_merge( + $options, + [ + 'algo' => $algo, + 'userName' => $userName + ] + )); + } + + /** + * Earnings List (USER_DATA) + * + * GET /sapi/v1/mining/payment/list + * + * Weight(IP): 5 + * + * @param string $algo + * @param string $userName + * @param array $options + */ + public function miningEarningList(string $algo, string $userName, array $options = []) + { + if (Strings::isEmpty($algo)) { + throw new MissingArgumentException('algo'); + } + if (Strings::isEmpty($userName)) { + throw new MissingArgumentException('userName'); + } + + return $this->signRequest('GET', '/sapi/v1/mining/payment/list', array_merge( + $options, + [ + 'algo' => $algo, + 'userName' => $userName + ] + )); + } + + /** + * Extra Bonus List (USER_DATA) + * + * GET /sapi/v1/mining/payment/other + * + * Weight(IP): 5 + * + * @param string $algo + * @param string $userName + * @param array $options + */ + public function miningExtraBonusList(string $algo, string $userName, array $options = []) + { + if (Strings::isEmpty($algo)) { + throw new MissingArgumentException('algo'); + } + if (Strings::isEmpty($userName)) { + throw new MissingArgumentException('userName'); + } + + return $this->signRequest('GET', '/sapi/v1/mining/payment/other', array_merge( + $options, + [ + 'algo' => $algo, + 'userName' => $userName + ] + )); + } + + /** + * Hashrate Resale List (USER_DATA) + * + * GET /sapi/v1/mining/hash-transfer/config/details/list + * + * Weight(IP): 5 + * + * @param array $options + */ + public function miningHashrateResaleList(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/mining/hash-transfer/config/details/list', $options); + } + + /** + * Hashrate Resale Detail (USER_DATA) + * + * GET /sapi/v1/mining/hash-transfer/profit/details + * + * Weight(IP): 5 + * + * @param string $configId + * @param string $userName + * @param array $options + */ + public function miningHashrateResaleDetails(string $configId, string $userName, array $options = []) + { + if (Strings::isEmpty($configId)) { + throw new MissingArgumentException('configId'); + } + if (Strings::isEmpty($userName)) { + throw new MissingArgumentException('userName'); + } + + return $this->signRequest('GET', '/sapi/v1/mining/hash-transfer/profit/details', array_merge( + $options, + [ + 'configId' => $configId, + 'userName' => $userName + ] + )); + } + + /** + * Hashrate Resale Request (USER_DATA) + * + * POST /sapi/v1/mining/hash-transfer/config + * + * Weight(IP): 5 + * + * @param string $userName + * @param string $algo + * @param string $toPoolUser + * @param int $hashRate + * @param array $options + */ + public function miningHashrateResaleRequest(string $userName, string $algo, string $toPoolUser, int $hashRate, array $options = []) + { + if (Strings::isEmpty($userName)) { + throw new MissingArgumentException('userName'); + } + if (Strings::isEmpty($algo)) { + throw new MissingArgumentException('algo'); + } + if (Strings::isEmpty($toPoolUser)) { + throw new MissingArgumentException('toPoolUser'); + } + + return $this->signRequest('POST', '/sapi/v1/mining/hash-transfer/config', array_merge( + $options, + [ + 'userName' => $userName, + 'algo' => $algo, + 'toPoolUser' => $toPoolUser, + 'hashRate' => $hashRate + ] + )); + } + + /** + * Cancel hashrate resale configuration (USER_DATA) + * + * POST /sapi/v1/mining/hash-transfer/config/cancel + * + * Weight(IP): 5 + * + * @param int $configId + * @param string $userName + * @param array $options + */ + public function miningCancelConfig(int $configId, string $userName, array $options = []) + { + if (Strings::isEmpty($userName)) { + throw new MissingArgumentException('userName'); + } + + return $this->signRequest('POST', '/sapi/v1/mining/hash-transfer/config/cancel', array_merge( + $options, + [ + 'configId' => $configId, + 'userName' => $userName + ] + )); + } + + /** + * Statistic List (USER_DATA) + * + * GET /sapi/v1/mining/statistics/user/status + * + * Weight(IP): 5 + * + * @param string $algo + * @param string $userName + * @param array $options + */ + public function miningStatisticsList(string $algo, string $userName, array $options = []) + { + if (Strings::isEmpty($algo)) { + throw new MissingArgumentException('algo'); + } + if (Strings::isEmpty($userName)) { + throw new MissingArgumentException('userName'); + } + + return $this->signRequest('GET', '/sapi/v1/mining/statistics/user/status', array_merge( + $options, + [ + 'algo' => $algo, + 'userName' => $userName + ] + )); + } + + /** + * Account List (USER_DATA) + * + * GET /sapi/v1/mining/statistics/user/list + * + * Weight(IP): 5 + * + * @param string $algo + * @param string $userName + * @param array $options + */ + public function miningAccountList(string $algo, string $userName, array $options = []) + { + if (Strings::isEmpty($algo)) { + throw new MissingArgumentException('algo'); + } + if (Strings::isEmpty($userName)) { + throw new MissingArgumentException('userName'); + } + + return $this->signRequest('GET', '/sapi/v1/mining/statistics/user/list', array_merge( + $options, + [ + 'algo' => $algo, + 'userName' => $userName + ] + )); + } + + /** + * Mining Account Earning (USER_DATA) + * + * GET /sapi/v1/mining/payment/uid + * + * Weight(IP): 5 + * + * @param string $algo + * @param array $options + */ + public function miningEarning(string $algo, array $options = []) + { + if (Strings::isEmpty($algo)) { + throw new MissingArgumentException('algo'); + } + + return $this->signRequest('GET', '/sapi/v1/mining/payment/uid', array_merge( + $options, + [ + 'algo' => $algo + ] + )); + } +} diff --git a/src/Binance/Spot/NFT.php b/src/Binance/Spot/NFT.php new file mode 100644 index 0000000..37f2e41 --- /dev/null +++ b/src/Binance/Spot/NFT.php @@ -0,0 +1,77 @@ +signRequest('GET', '/sapi/v1/nft/history/transactions', array_merge( + $options, + [ + 'orderType' => $orderType + ] + )); + } + + /** + * Get NFT Deposit History (USER_DATA) + * + * GET /sapi/v1/nft/history/deposit + * + * - The max interval between startTime and endTime is 90 days. + * - If startTime and endTime are not sent, the recent 7 days' data will be returned. + * + * Weight(UID): 3000 + * + * @param array $options + */ + public function nftDepositHistory(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/nft/history/deposit', $options); + } + + /** + * Get NFT Withdraw History (USER_DATA) + * + * GET /sapi/v1/nft/history/withdraw + * + * - The max interval between startTime and endTime is 90 days. + * - If startTime and endTime are not sent, the recent 7 days' data will be returned. + * + * Weight(UID): 3000 + * + * @param array $options + */ + public function nftWithdrawHistory(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/nft/history/withdraw', $options); + } + + /** + * Get NFT Asset (USER_DATA) + * + * GET /sapi/v1/nft/user/getAsset + * + * Weight(UID): 3000 + * + * @param array $options + */ + public function nftUserAsset(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/nft/user/getAsset', $options); + } +} diff --git a/src/Binance/Spot/Pay.php b/src/Binance/Spot/Pay.php new file mode 100644 index 0000000..68d3430 --- /dev/null +++ b/src/Binance/Spot/Pay.php @@ -0,0 +1,24 @@ +signRequest('GET', '/sapi/v1/pay/transactions', $options); + } +} diff --git a/src/Binance/Spot/PortfolioMargin.php b/src/Binance/Spot/PortfolioMargin.php new file mode 100644 index 0000000..8c98a06 --- /dev/null +++ b/src/Binance/Spot/PortfolioMargin.php @@ -0,0 +1,20 @@ +signRequest('GET', '/sapi/v1/portfolio/account', $options); + } +} diff --git a/src/Binance/Spot/Rebate.php b/src/Binance/Spot/Rebate.php new file mode 100644 index 0000000..0c77f02 --- /dev/null +++ b/src/Binance/Spot/Rebate.php @@ -0,0 +1,24 @@ +signRequest('GET', '/sapi/v1/rebate/taxQuery', $options); + } +} diff --git a/src/Binance/Spot/Savings.php b/src/Binance/Spot/Savings.php new file mode 100644 index 0000000..6be9545 --- /dev/null +++ b/src/Binance/Spot/Savings.php @@ -0,0 +1,354 @@ +signRequest('GET', '/sapi/v1/lending/daily/product/list', $options); + } + + /** + * Get Left Daily Purchase Quota of Flexible Product (USER_DATA) + * + * GET /sapi/v1/lending/daily/userLeftQuota + * + * Weight(IP): 1 + * + * @param string $productId + * @param array $options + */ + public function savingsFlexiblePurchaseQuota(string $productId, array $options = []) + { + if (Strings::isEmpty($productId)) { + throw new MissingArgumentException('productId'); + } + + return $this->signRequest('GET', '/sapi/v1/lending/daily/userLeftQuota', array_merge( + $options, + [ + 'productId' => $productId + ] + )); + } + + /** + * Purchase Flexible Product (USER_DATA) + * + * POST /sapi/v1/lending/daily/purchase + * + * Weight(IP): 1 + * + * @param string $productId + * @param mixed $amount + * @param array $options + */ + public function savingsPurchaseFlexibleProduct(string $productId, $amount, array $options = []) + { + if (Strings::isEmpty($productId)) { + throw new MissingArgumentException('productId'); + } + + return $this->signRequest('POST', '/sapi/v1/lending/daily/purchase', array_merge( + $options, + [ + 'productId' => $productId, + 'amount' => $amount + ] + )); + } + + /** + * Get Left Daily Redemption Quota of Flexible Product (USER_DATA) + * + * GET /sapi/v1/lending/daily/userRedemptionQuota + * + * Weight(IP): 1 + * + * @param string $productId + * @param string $type + * @param array $options + */ + public function savingsFlexibleRedemptionQuota(string $productId, string $type, array $options = []) + { + if (Strings::isEmpty($productId)) { + throw new MissingArgumentException('productId'); + } + if (Strings::isEmpty($type)) { + throw new MissingArgumentException('type'); + } + + return $this->signRequest('GET', '/sapi/v1/lending/daily/userRedemptionQuota', array_merge( + $options, + [ + 'productId' => $productId, + 'type' => $type + ] + )); + } + + /** + * Redeem Flexible Product (USER_DATA) + * + * POST /sapi/v1/lending/daily/redeem + * + * Weight(IP): 1 + * + * @param string $productId + * @param mixed $amount + * @param string $type + * @param array $options + */ + public function savingsFlexibleRedeem(string $productId, $amount, string $type, array $options = []) + { + if (Strings::isEmpty($productId)) { + throw new MissingArgumentException('productId'); + } + if (Strings::isEmpty($type)) { + throw new MissingArgumentException('type'); + } + + return $this->signRequest('POST', '/sapi/v1/lending/daily/redeem', array_merge( + $options, + [ + 'productId' => $productId, + 'amount' => $amount, + 'type' => $type + ] + )); + } + + /** + * Get Flexible Product Position (USER_DATA) + * + * GET /sapi/v1/lending/daily/token/position + * + * Weight(IP): 1 + * + * @param string $asset + * @param array $options + */ + public function savingsFlexibleProductPosition(string $asset, array $options = []) + { + if (Strings::isEmpty($asset)) { + throw new MissingArgumentException('asset'); + } + + return $this->signRequest('GET', '/sapi/v1/lending/daily/token/position', array_merge( + $options, + [ + 'asset' => $asset + ] + )); + } + + /** + * Get Fixed and Activity Project List (USER_DATA) + * + * GET /sapi/v1/lending/project/list + * + * Weight(IP): 1 + * + * @param string $type + * @param array $options + */ + public function savingsProductList(string $type, array $options = []) + { + if (Strings::isEmpty($type)) { + throw new MissingArgumentException('type'); + } + + return $this->signRequest('GET', '/sapi/v1/lending/project/list', array_merge( + $options, + [ + 'type' => $type + ] + )); + } + + /** + * Purchase Fixed/Activity Project (USER_DATA) + * + * POST /sapi/v1/lending/customizedFixed/purchase + * + * Weight(IP): 1 + * + * @param string $projectId + * @param int $lot + * @param array $options + */ + public function savingsPurchaseCustomizedProject(string $projectId, int $lot, array $options = []) + { + if (Strings::isEmpty($projectId)) { + throw new MissingArgumentException('projectId'); + } + + return $this->signRequest('POST', '/sapi/v1/lending/customizedFixed/purchase', array_merge( + $options, + [ + 'projectId' => $projectId, + 'lot' => $lot + ] + )); + } + + /** + * Get Fixed/Activity Project Position (USER_DATA) + * + * GET /sapi/v1/lending/project/position/list + * + * Weight(IP): 1 + * + * @param string $asset + * @param array $options + */ + public function savingsCustomizedPosition(string $asset, array $options = []) + { + if (Strings::isEmpty($asset)) { + throw new MissingArgumentException('asset'); + } + + return $this->signRequest('GET', '/sapi/v1/lending/project/position/list', array_merge( + $options, + [ + 'asset' => $asset + ] + )); + } + + /** + * Lending Account (USER_DATA) + * + * GET /sapi/v1/lending/union/account + * + * Weight(IP): 1 + * + * @param array $options + */ + public function savingsAccount(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/lending/union/account', $options); + } + + /** + * Get Purchase Record (USER_DATA) + * + * GET /sapi/v1/lending/union/purchaseRecord + * + * - The time between startTime and endTime cannot be longer than 30 days. + * - If startTime and endTime are both not sent, then the last 30 days' data will be returned. + * + * Weigh(IP): 1 + * + * @param string $lendingType + * @param array $options + */ + public function savingsPurchaseRecord(string $lendingType, array $options = []) + { + if (Strings::isEmpty($lendingType)) { + throw new MissingArgumentException('lendingType'); + } + + return $this->signRequest('GET', '/sapi/v1/lending/union/purchaseRecord', array_merge( + $options, + [ + 'lendingType' => $lendingType + ] + )); + } + + /** + * Get Redemption Record (USER_DATA) + * + * GET /sapi/v1/lending/union/redemptionRecord + * + * - The time between startTime and endTime cannot be longer than 30 days. + * - If startTime and endTime are both not sent, then the last 30 days' data will be returned. + * + * Weight(IP): 1 + * + * @param string $lendingType + * @param array $options + */ + public function savingsRedemptionRecord(string $lendingType, array $options = []) + { + if (Strings::isEmpty($lendingType)) { + throw new MissingArgumentException('lendingType'); + } + + return $this->signRequest('GET', '/sapi/v1/lending/union/redemptionRecord', array_merge( + $options, + [ + 'lendingType' => $lendingType + ] + )); + } + + /** + * Get Interest History (USER_DATA) + * + * GET /sapi/v1/lending/union/interestHistory + * + * - The time between startTime and endTime cannot be longer than 30 days. + * - If startTime and endTime are both not sent, then the last 30 days' data will be returned. + * + * Weight(IP): 1 + * + * @param string $lendingType + * @param array $options + */ + public function savingsInterestHistory(string $lendingType, array $options = []) + { + if (Strings::isEmpty($lendingType)) { + throw new MissingArgumentException('lendingType'); + } + + return $this->signRequest('GET', '/sapi/v1/lending/union/interestHistory', array_merge( + $options, + [ + 'lendingType' => $lendingType + ] + )); + } + + /** + * Change Fixed/Activity Position to Daily Position (USER_DATA) + * + * POST /sapi/v1/lending/positionChanged + * + * - PositionId is mandatory parameter for fixed position. + * + * Weight(IP): 1 + * + * @param string $projectId + * @param int $lot + * @param array $options + */ + public function savingsChangeDailyPosition(string $projectId, int $lot, array $options = []) + { + if (Strings::isEmpty($projectId)) { + throw new MissingArgumentException('projectId'); + } + + return $this->signRequest('POST', '/sapi/v1/lending/positionChanged', array_merge( + $options, + [ + 'projectId' => $projectId, + 'lot' => $lot + ] + )); + } +} diff --git a/src/Binance/Spot/Staking.php b/src/Binance/Spot/Staking.php new file mode 100644 index 0000000..13e2865 --- /dev/null +++ b/src/Binance/Spot/Staking.php @@ -0,0 +1,215 @@ +signRequest('GET', '/sapi/v1/staking/productList', array_merge( + $options, + [ + 'product' => $product + ] + )); + } + + /** + * Purchase Staking Product (USER_DATA) + * + * POST /sapi/v1/staking/purchase + * + * Weight(IP): 1 + * + * @param string $product + * @param string $productId + * @param mixed $amount + * @param array $options + */ + public function stakingPurchaseProduct(string $product, string $productId, $amount, array $options = []) + { + if (Strings::isEmpty($product)) { + throw new MissingArgumentException('product'); + } + if (Strings::isEmpty($productId)) { + throw new MissingArgumentException('productId'); + } + + return $this->signRequest('POST', '/sapi/v1/staking/purchase', array_merge( + $options, + [ + 'product' => $product, + 'productId' => $productId, + 'amount' => $amount + ] + )); + } + + /** + * Redeem Staking Product (USER_DATA) + * + * POST /sapi/v1/staking/redeem + * + * Redeem Staking product. Locked staking and Locked DeFI staking belong to early redemption, redeeming in advance will result in loss of interest that you have earned. + * + * Weight(IP): 1 + * + * @param string $product + * @param string $productId + * @param array $options + */ + public function stakingRedeemProduct(string $product, string $productId, array $options = []) + { + if (Strings::isEmpty($product)) { + throw new MissingArgumentException('product'); + } + if (Strings::isEmpty($productId)) { + throw new MissingArgumentException('productId'); + } + + return $this->signRequest('POST', '/sapi/v1/staking/redeem', array_merge( + $options, + [ + 'product' => $product, + 'productId' => $productId + ] + )); + } + + /** + * Get Staking Product Position (USER_DATA) + * + * GET /sapi/v1/staking/position + * + * Weight(IP): 1 + * + * @param string $product + * @param array $options + */ + public function stakingProductPosition(string $product, array $options = []) + { + if (Strings::isEmpty($product)) { + throw new MissingArgumentException('product'); + } + + return $this->signRequest('GET', '/sapi/v1/staking/position', array_merge( + $options, + [ + 'product' => $product + ] + )); + } + + /** + * Get Staking History (USER_DATA) + * + * GET /sapi/v1/staking/stakingRecord + * + * Weight(IP): 1 + * + * @param string $product + * @param string $txnType + * @param array $options + */ + public function stakingHistory(string $product, string $txnType, array $options = []) + { + if (Strings::isEmpty($product)) { + throw new MissingArgumentException('product'); + } + if (Strings::isEmpty($txnType)) { + throw new MissingArgumentException('txnType'); + } + + return $this->signRequest('GET', '/sapi/v1/staking/stakingRecord', array_merge( + $options, + [ + 'product' => $product, + 'txnType' => $txnType + ] + )); + } + + /** + * Set Auto Staking (USER_DATA) + * + * POST /sapi/v1/staking/setAutoStaking + * + * Set auto staking on Locked Staking or Locked DeFi Staking + * + * Weight(IP): 1 + * + * @param string $product + * @param string $positionId + * @param string $renewable + * @param array $options + */ + public function stakingSetAutoStaking(string $product, string $positionId, string $renewable, array $options = []) + { + if (Strings::isEmpty($product)) { + throw new MissingArgumentException('product'); + } + if (Strings::isEmpty($positionId)) { + throw new MissingArgumentException('positionId'); + } + if (Strings::isEmpty($renewable)) { + throw new MissingArgumentException('renewable'); + } + + return $this->signRequest('POST', '/sapi/v1/staking/setAutoStaking', array_merge( + $options, + [ + 'product' => $product, + 'positionId' => $positionId, + 'renewable' => $renewable + ] + )); + } + + /** + * Get Personal Left Quota of Staking Product (USER_DATA) + * + * GET /sapi/v1/staking/personalLeftQuota + * + * Weight(IP): 1 + * + * @param string $product + * @param string $productId + * @param array $options + */ + public function stakingProductQuota(string $product, string $productId, array $options = []) + { + if (Strings::isEmpty($product)) { + throw new MissingArgumentException('product'); + } + if (Strings::isEmpty($productId)) { + throw new MissingArgumentException('productId'); + } + + return $this->signRequest('GET', '/sapi/v1/staking/personalLeftQuota', array_merge( + $options, + [ + 'product' => $product, + 'productId' => $productId + ] + )); + } +} diff --git a/src/Binance/Spot/Stream.php b/src/Binance/Spot/Stream.php new file mode 100644 index 0000000..58491f5 --- /dev/null +++ b/src/Binance/Spot/Stream.php @@ -0,0 +1,72 @@ +publicRequest('POST', '/api/v3/userDataStream'); + } + + /** + * Ping/Keep-alive a ListenKey (USER_STREAM) + * + * PUT /api/v3/userDataStream + * + * Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes. It's recommended to send a ping about every 30 minutes. + * + * Weight: 1 + * + * @param string $listenKey + */ + public function renewListenKey(string $listenKey) + { + if (Strings::isEmpty($listenKey)) { + throw new MissingArgumentException('listenKey'); + } + + return $this->publicRequest('PUT', '/api/v3/userDataStream', + [ + 'listenKey' => $listenKey + ] + ); + } + + /** + * Close a ListenKey (USER_STREAM) + * + * DELETE /api/v3/userDataStream + * + * Close out a user data stream. + * + * Weight: 1 + * + * @param string $listenKey + */ + public function closeListenKey(string $listenKey) + { + if (Strings::isEmpty($listenKey)) { + throw new MissingArgumentException('listenKey'); + } + + return $this->publicRequest('DELETE', '/api/v3/userDataStream', + [ + 'listenKey' => $listenKey + ] + ); + } +} diff --git a/src/Binance/Spot/SubAccount.php b/src/Binance/Spot/SubAccount.php new file mode 100644 index 0000000..78b7cbb --- /dev/null +++ b/src/Binance/Spot/SubAccount.php @@ -0,0 +1,943 @@ +signRequest('POST', '/sapi/v1/sub-account/virtualSubAccount', array_merge( + $options, + [ + 'subAccountString' => $subAccountString + ] + )); + } + + /** + * Query Sub-account List (For Master Account) + * + * GET /sapi/v1/sub-account/list + * + * Weight(IP): 1 + * + * @param array $options + */ + public function subAccountList(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/sub-account/list', $options); + } + + /** + * Query Sub-account Spot Asset Transfer History (For Master Account) + * + * GET /sapi/v1/sub-account/sub/transfer/history + * + * - fromEmail and toEmail cannot be sent at the same time. + * - Return fromEmail equal master account email by default. + * + * Weight(IP): 1 + * + * @param array $options + */ + public function subAccountTransferHistory(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/sub-account/sub/transfer/history', $options); + } + + /** + * Query Sub-account Futures Asset Transfer History (For Master Account) + * + * GET /sapi/v1/sub-account/futures/internalTransfer + * + * Weight(IP): 1 + * + * @param string $email + * @param int $futuresType + * @param array $options + */ + public function subAccountFuturesAssetTransferHistory(string $email, int $futuresType, array $options = []) + { + if (Strings::isEmpty($email)) { + throw new MissingArgumentException('email'); + } + + return $this->signRequest('GET', '/sapi/v1/sub-account/futures/internalTransfer', array_merge( + $options, + [ + 'email' => $email, + 'futuresType' => $futuresType + ] + )); + } + + /** + * Sub-account Futures Asset Transfer (For Master Account) + * + * POST /sapi/v1/sub-account/futures/internalTransfer + * + * - Master account can transfer max 2000 times a minute + * + * Weight(IP): 1 + * + * @param string $fromEmail + * @param string $toEmail + * @param int $futuresType + * @param string $asset + * @param mixed $amount + * @param array $options + */ + public function subAccountFuturesAssetTransfer(string $fromEmail, string $toEmail, int $futuresType, string $asset, $amount, array $options = []) + { + if (Strings::isEmpty($fromEmail)) { + throw new MissingArgumentException('fromEmail'); + } + if (Strings::isEmpty($toEmail)) { + throw new MissingArgumentException('toEmail'); + } + if (Strings::isEmpty($asset)) { + throw new MissingArgumentException('asset'); + } + + return $this->signRequest('POST', '/sapi/v1/sub-account/futures/internalTransfer', array_merge( + $options, + [ + 'fromEmail' => $fromEmail, + 'toEmail' => $toEmail, + 'futuresType' => $futuresType, + 'asset' => $asset, + 'amount' => $amount + ] + )); + } + + /** + * Query Sub-account Assets (For Master Account) + * + * GET /sapi/v3/sub-account/assets + * + * Fetch sub-account assets + * + * Weight(IP): 1 + * + * @param string $email + * @param array $options + */ + public function subAccountAssets(string $email, array $options = []) + { + if (Strings::isEmpty($email)) { + throw new MissingArgumentException('email'); + } + + return $this->signRequest('GET', '/sapi/v3/sub-account/assets', array_merge( + $options, + [ + 'email' => $email + ] + )); + } + + /** + * Query Sub-account Spot Assets Summary (For Master Account) + * + * GET /sapi/v1/sub-account/spotSummary + * + * Get BTC valued asset summary of subaccounts. + * + * Weight(IP): 1 + * + * @param array $options + */ + public function subAccountSpotAssetsSummary(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/sub-account/spotSummary', $options); + } + + /** + * Get Sub-account Deposit Address (For Master Account) + * + * GET /sapi/v1/capital/deposit/subAddress + * + * Fetch sub-account deposit address + * + * Weight(IP): 1 + * + * @param string $email + * @param string $coin + * @param array $options + */ + public function subAccountDepositAddress(string $email, string $coin, array $options = []) + { + if (Strings::isEmpty($email)) { + throw new MissingArgumentException('email'); + } + if (Strings::isEmpty($coin)) { + throw new MissingArgumentException('coin'); + } + + return $this->signRequest('GET', '/sapi/v1/capital/deposit/subAddress', array_merge( + $options, + [ + 'email' => $email, + 'coin' => $coin + ] + )); + } + + /** + * Get Sub-account Deposit History (For Master Account) + * + * GET /sapi/v1/capital/deposit/subHisrec + * + * Fetch sub-account deposit history + * + * Weight(IP): 1 + * + * @param string $email + * @param array $options + */ + public function subAccountDepositHistory(string $email, array $options = []) + { + if (Strings::isEmpty($email)) { + throw new MissingArgumentException('email'); + } + + return $this->signRequest('GET', '/sapi/v1/capital/deposit/subHisrec', array_merge( + $options, + [ + 'email' => $email + ] + )); + } + + /** + * Get Sub-account's Status on Margin/Futures (For Master Account) + * + * GET /sapi/v1/sub-account/status + * + * - If no `email` sent, all sub-accounts' information will be returned. + * + * Weight(IP): 10 + * + * @param array $options + */ + public function subAccountStatus(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/sub-account/status', $options); + } + + /** + * Enable Margin for Sub-account (For Master Account) + * + * POST /sapi/v1/sub-account/margin/enable + * + * Weight(IP): 1 + * + * @param string $email + * @param array $options + */ + public function subAccountEnableMargin(string $email, array $options = []) + { + if (Strings::isEmpty($email)) { + throw new MissingArgumentException('email'); + } + + return $this->signRequest('POST', '/sapi/v1/sub-account/margin/enable', array_merge( + $options, + [ + 'email' => $email + ] + )); + } + + /** + * Get Detail on Sub-account's Margin Account (For Master Account) + * + * GET /sapi/v1/sub-account/margin/account + * + * Weight(IP): 10 + * + * @param string $email + * @param array $options + */ + public function subAccountMarginAccount(string $email, array $options = []) + { + if (Strings::isEmpty($email)) { + throw new MissingArgumentException('email'); + } + + return $this->signRequest('GET', '/sapi/v1/sub-account/margin/account', array_merge( + $options, + [ + 'email' => $email + ] + )); + } + + /** + * Get Summary of Sub-account's Margin Account (For Master Account) + * + * GET /sapi/v1/sub-account/margin/accountSummary + * + * Weight(IP): 10 + * + * @param array $options + */ + public function subAccountMarginAccountSummary(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/sub-account/margin/accountSummary', $options); + } + + /** + * Enable Futures for Sub-account (For Master Account) + * + * POST /sapi/v1/sub-account/futures/enable + * + * Weight(IP): 1 + * + * @param string $email + * @param array $options + */ + public function subAccountEnableFutures(string $email, array $options = []) + { + if (Strings::isEmpty($email)) { + throw new MissingArgumentException('email'); + } + + return $this->signRequest('POST', '/sapi/v1/sub-account/futures/enable', array_merge( + $options, + [ + 'email' => $email + ] + )); + } + + /** + * Get Detail on Sub-account's Futures Account (For Master Account) + * + * GET /sapi/v1/sub-account/futures/account + * + * Weight(IP): 10 + * + * @param string $email + * @param array $options + */ + public function subAccountFuturesAccount(string $email, array $options = []) + { + if (Strings::isEmpty($email)) { + throw new MissingArgumentException('email'); + } + + return $this->signRequest('GET', '/sapi/v1/sub-account/futures/account', array_merge( + $options, + [ + 'email' => $email + ] + )); + } + + /** + * Get Summary of Sub-account's Futures Account (For Master Account) + * + * GET /sapi/v1/sub-account/futures/accountSummary + * + * Weight(IP): 1 + * + * @param array $options + */ + public function subAccountFuturesAccountSummary(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/sub-account/futures/accountSummary', $options); + } + + /** + * Get Futures Position-Risk of Sub-account (For Master Account) + * + * GET /sapi/v1/sub-account/futures/positionRisk + * + * Weight(IP): 10 + * + * @param string $email + * @param array $options + */ + public function subAccountFuturesPositionRisk(string $email, array $options = []) + { + if (Strings::isEmpty($email)) { + throw new MissingArgumentException('email'); + } + + return $this->signRequest('GET', '/sapi/v1/sub-account/futures/positionRisk', array_merge( + $options, + [ + 'email' => $email + ] + )); + } + + /** + * Futures Transfer for Sub-account (For Master Account) + * + * POST /sapi/v1/sub-account/futures/transfer + * + * Weight(IP): 1 + * + * @param string $email + * @param string $asset + * @param mixed $amount + * @param int $type + * @param array $options + */ + public function subAccountFuturesTransfer(string $email, string $asset, $amount, int $type, array $options = []) + { + if (Strings::isEmpty($email)) { + throw new MissingArgumentException('email'); + } + if (Strings::isEmpty($asset)) { + throw new MissingArgumentException('asset'); + } + + return $this->signRequest('POST', '/sapi/v1/sub-account/futures/transfer', array_merge( + $options, + [ + 'email' => $email, + 'asset' => $asset, + 'amount' => $amount, + 'type' => $type + ] + )); + } + + /** + * Margin Transfer for Sub-account (For Master Account) + * + * POST /sapi/v1/sub-account/margin/transfer + * + * Weight(IP): 1 + * + * @param string $email + * @param string $asset + * @param mixed $amount + * @param int $type + * @param array $options + */ + public function subAccountMarginTransfer(string $email, string $asset, $amount, int $type, array $options = []) + { + if (Strings::isEmpty($email)) { + throw new MissingArgumentException('email'); + } + if (Strings::isEmpty($asset)) { + throw new MissingArgumentException('asset'); + } + + return $this->signRequest('POST', '/sapi/v1/sub-account/margin/transfer', array_merge( + $options, + [ + 'email' => $email, + 'asset' => $asset, + 'amount' => $amount, + 'type' => $type + ] + )); + } + + /** + * Transfer to Sub-account of Same Master (For Sub-account) + * + * POST /sapi/v1/sub-account/transfer/subToSub + * + * Weight(IP): 1 + * + * @param string $toEmail + * @param string $asset + * @param mixed $amount + * @param array $options + */ + public function subAccountTransferToSubAccount(string $toEmail, string $asset, $amount, array $options = []) + { + if (Strings::isEmpty($toEmail)) { + throw new MissingArgumentException('toEmail'); + } + if (Strings::isEmpty($asset)) { + throw new MissingArgumentException('asset'); + } + + return $this->signRequest('POST', '/sapi/v1/sub-account/transfer/subToSub', array_merge( + $options, + [ + 'toEmail' => $toEmail, + 'asset' => $asset, + 'amount' => $amount + ] + )); + } + + /** + * Transfer to Master (For Sub-account) + * + * POST /sapi/v1/sub-account/transfer/subToMaster + * + * Weight(IP): 1 + * + * @param string $asset + * @param mixed $amount + * @param array $options + */ + public function subAccountTransferToMaster(string $asset, $amount, array $options = []) + { + if (Strings::isEmpty($asset)) { + throw new MissingArgumentException('asset'); + } + + return $this->signRequest('POST', '/sapi/v1/sub-account/transfer/subToMaster', array_merge( + $options, + [ + 'asset' => $asset, + 'amount' => $amount + ] + )); + } + + /** + * Sub-account Transfer History (For Sub-account) + * + * GET /sapi/v1/sub-account/transfer/subUserHistory + * + * - If `type` is not sent, the records of type 2: transfer out will be returned by default. + * - If `startTime` and `endTime` are not sent, the recent 30-day data will be returned. + * + * Weight(IP): 1 + * + * @param array $options + */ + public function subAccountTransferHistoryBySubAccount(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/sub-account/transfer/subUserHistory', $options); + } + + /** + * Query Universal Transfer History (For Master Account) + * + * GET /sapi/v1/sub-account/universalTransfer + * + * - `fromEmail` and `toEmail` cannot be sent at the same time. + * - Return `fromEmail` equal master account email by default. + * - The query time period must be less then 30 days. + * - If startTime and endTime not sent, return records of the last 30 days by default. + * + * Weight(IP): 1 + * + * @param array $options + */ + public function subAccountUniversalTransferHistory(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/sub-account/universalTransfer', $options); + } + + /** + * Universal Transfer (For Master Account) + * + * POST /sapi/v1/sub-account/universalTransfer + * + * - You need to enable "internal transfer" option for the api key which requests this endpoint. + * - Transfer from master account by default if fromEmail is not sent. + * - Transfer to master account by default if toEmail is not sent. + * - Transfer between futures accounts is not supported. + * + * Weight(IP): 1 + * + * @param string $fromAccountType + * @param string $toAccountType + * @param string $asset + * @param mixed $amount + * @param array $options + */ + public function subAccountUniversalTransfer(string $fromAccountType, string $toAccountType, string $asset, $amount, array $options = []) + { + if (Strings::isEmpty($fromAccountType)) { + throw new MissingArgumentException('fromAccountType'); + } + if (Strings::isEmpty($toAccountType)) { + throw new MissingArgumentException('toAccountType'); + } + if (Strings::isEmpty($asset)) { + throw new MissingArgumentException('asset'); + } + + return $this->signRequest('POST', '/sapi/v1/sub-account/universalTransfer', array_merge( + $options, + [ + 'fromAccountType' => $fromAccountType, + 'toAccountType' => $toAccountType, + 'asset' => $asset, + 'amount' => $amount + ] + )); + } + + /** + * Get Detail on Sub-account's Futures Account V2 (For Master Account) + * + * GET /sapi/v2/sub-account/futures/account + * + * Weight(IP): 1 + * + * @param string $email + * @param int $futuresType + * @param array $options + */ + public function subAccountFuturesAccountV2(string $email, int $futuresType, array $options = []) + { + if (Strings::isEmpty($email)) { + throw new MissingArgumentException('email'); + } + + return $this->signRequest('GET', '/sapi/v2/sub-account/futures/account', array_merge( + $options, + [ + 'email' => $email, + 'futuresType' => $futuresType + ] + )); + } + + /** + * Get Summary of Sub-account's Futures Account V2 (For Master Account) + * + * GET /sapi/v2/sub-account/futures/accountSummary + * + * Weight(IP): 10 + * + * @param int $futuresType + * @param array $options + */ + public function subAccountFuturesAccountSummaryV2(int $futuresType, array $options = []) + { + return $this->signRequest('GET', '/sapi/v2/sub-account/futures/accountSummary', array_merge( + $options, + [ + 'futuresType' => $futuresType + ] + )); + } + + /** + * Get Futures Position-Risk of Sub-account V2 (For Master Account) + * + * GET /sapi/v2/sub-account/futures/positionRisk + * + * Weight(IP): 1 + * + * @param string $email + * @param int $futuresType + * @param array $options + */ + public function subAccountFuturesPositionRiskV2(string $email, int $futuresType, array $options = []) + { + if (Strings::isEmpty($email)) { + throw new MissingArgumentException('email'); + } + + return $this->signRequest('GET', '/sapi/v2/sub-account/futures/positionRisk', array_merge( + $options, + [ + 'email' => $email, + 'futuresType' => $futuresType + ] + )); + } + + /** + * Enable Leverage Token for Sub-account (For Master Account) + * + * POST /sapi/v1/sub-account/blvt/enable + * + * Weight(IP): 1 + * + * @param string $email + * @param bool $enableBlvt + * @param array $options + */ + public function subAccountEnableLeverageToken(string $email, bool $enableBlvt, array $options = []) + { + if (Strings::isEmpty($email)) { + throw new MissingArgumentException('email'); + } + + return $this->signRequest('POST', '/sapi/v1/sub-account/blvt/enable', array_merge( + $options, + [ + 'email' => $email, + 'enableBlvt' => $enableBlvt + ] + )); + } + + /** + * Deposit assets into the managed sub-account (For Investor Master Account) + * + * POST /sapi/v1/managed-subaccount/deposit + * + * Weight(IP): 1 + * + * @param string $toEmail + * @param string $asset + * @param mixed $amount + * @param array $options + */ + public function managedSubAccountDeposit(string $toEmail, string $asset, $amount, array $options = []) + { + if (Strings::isEmpty($toEmail)) { + throw new MissingArgumentException('toEmail'); + } + if (Strings::isEmpty($asset)) { + throw new MissingArgumentException('asset'); + } + + return $this->signRequest('POST', '/sapi/v1/managed-subaccount/deposit', array_merge( + $options, + [ + 'toEmail' => $toEmail, + 'asset' => $asset, + 'amount' => $amount + ] + )); + } + + /** + * Query managed sub-account asset details (For Investor Master Account) + * + * GET /sapi/v1/managed-subaccount/asset + * + * Weight(IP): 1 + * + * @param string $email + * @param array $options + */ + public function managedSubAccountAssetDetails(string $email, array $options = []) + { + if (Strings::isEmpty($email)) { + throw new MissingArgumentException('email'); + } + + return $this->signRequest('GET', '/sapi/v1/managed-subaccount/asset', array_merge( + $options, + [ + 'email' => $email + ] + )); + } + + /** + * Withdrawl assets from the managed sub-account (For Investor Master Account) + * + * POST /sapi/v1/managed-subaccount/withdraw + * + * Weight(IP): 1 + * + * @param string $fromEmail + * @param string $asset + * @param mixed $amount + * @param array $options + */ + public function managedSubAccountWithdraw(string $fromEmail, string $asset, $amount, array $options = []) + { + if (Strings::isEmpty($fromEmail)) { + throw new MissingArgumentException('fromEmail'); + } + if (Strings::isEmpty($asset)) { + throw new MissingArgumentException('asset'); + } + + return $this->signRequest('POST', '/sapi/v1/managed-subaccount/withdraw', array_merge( + $options, + [ + 'fromEmail' => $fromEmail, + 'asset' => $asset, + 'amount' => $amount + ] + )); + } + + /** + * Query managed sub-account snapshot (For Investor Master Account) + * + * GET /sapi/v1/managed-subaccount/accountSnapshot + * + * - The query time period must be less then 30 days + * - Support query within the last one month only + * - If `startTime` and `endTime` not sent, return records of the last 7 days by default + * + * Weight(IP): 2400 + * + * @param string $email + * @param string $type + * @param array $options + */ + public function managedSubAccountSnapshot(string $email, string $type, array $options = []) + { + if (Strings::isEmpty($email)) { + throw new MissingArgumentException('email'); + } + if (Strings::isEmpty($type)) { + throw new MissingArgumentException('type'); + } + + return $this->signRequest('GET', '/sapi/v1/managed-subaccount/accountSnapshot', array_merge( + $options, + [ + 'email' => $email, + 'type' => $type + ] + )); + } + + /** + * Enable or Disable IP Restriction for a Sub-account API Key (For Master Account) + * + * POST /sapi/v1/sub-account/subAccountApi/ipRestriction + * + * Weight(UID): 3000 + * + * @param string $email + * @param string $subAccountApiKey + * @param bool $ipRestrict + * @param array $options + */ + public function subAccountToggleIpRestriction(string $email, string $subAccountApiKey, bool $ipRestrict, array $options = []) + { + if (Strings::isEmpty($email)) { + throw new MissingArgumentException('email'); + } + if (Strings::isEmpty($subAccountApiKey)) { + throw new MissingArgumentException('subAccountApiKey'); + } + + return $this->signRequest('POST', '/sapi/v1/sub-account/subAccountApi/ipRestriction', array_merge( + $options, + [ + 'email' => $email, + 'subAccountApiKey' => $subAccountApiKey, + 'ipRestrict' => $ipRestrict + ] + )); + } + + /** + * Get IP Restriction for a Sub-account API Key (For Master Account) + * + * GET /sapi/v1/sub-account/subAccountApi/ipRestriction + * + * Weight(UID): 3000 + * + * @param string $email + * @param string $subAccountApiKey + * @param array $options + */ + public function subAccountIpRestriction(string $email, string $subAccountApiKey, array $options = []) + { + if (Strings::isEmpty($email)) { + throw new MissingArgumentException('email'); + } + if (Strings::isEmpty($subAccountApiKey)) { + throw new MissingArgumentException('subAccountApiKey'); + } + + return $this->signRequest('GET', '/sapi/v1/sub-account/subAccountApi/ipRestriction', array_merge( + $options, + [ + 'email' => $email, + 'subAccountApiKey' => $subAccountApiKey + ] + )); + } + + /** + * Add IP List for a Sub-account API Key (For Master Account) + * + * POST /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList + * + * Before the usage of this endpoint, please ensure `POST /sapi/v1/sub-account/subAccountApi/ipRestriction` was used to enable the IP restriction. + * + * Weight(UID): 3000 + * + * @param string $email + * @param string $subAccountApiKey + * @param string $ipAddress + * @param array $options + */ + public function subAccountAddIpList(string $email, string $subAccountApiKey, string $ipAddress, array $options = []) + { + if (Strings::isEmpty($email)) { + throw new MissingArgumentException('email'); + } + if (Strings::isEmpty($subAccountApiKey)) { + throw new MissingArgumentException('subAccountApiKey'); + } + if (Strings::isEmpty($ipAddress)) { + throw new MissingArgumentException('ipAddress'); + } + + return $this->signRequest('POST', '/sapi/v1/sub-account/subAccountApi/ipRestriction/ipList', array_merge( + $options, + [ + 'email' => $email, + 'subAccountApiKey' => $subAccountApiKey, + 'ipAddress' => $ipAddress + ] + )); + } + + /** + * Delete IP List for a Sub-account API Key (For Master Account) + * + * DELETE /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList + * + * Weight(UID): 3000 + * + * @param string $email + * @param string $subAccountApiKey + * @param string $ipAddress + * @param array $options + */ + public function subAccountDeleteIpList(string $email, string $subAccountApiKey, string $ipAddress, array $options = []) + { + if (Strings::isEmpty($email)) { + throw new MissingArgumentException('email'); + } + if (Strings::isEmpty($subAccountApiKey)) { + throw new MissingArgumentException('subAccountApiKey'); + } + if (Strings::isEmpty($ipAddress)) { + throw new MissingArgumentException('ipAddress'); + } + + return $this->signRequest('DELETE', '/sapi/v1/sub-account/subAccountApi/ipRestriction/ipList', array_merge( + $options, + [ + 'email' => $email, + 'subAccountApiKey' => $subAccountApiKey, + 'ipAddress' => $ipAddress + ] + )); + } +} diff --git a/src/Binance/Spot/Trade.php b/src/Binance/Spot/Trade.php new file mode 100644 index 0000000..e42e203 --- /dev/null +++ b/src/Binance/Spot/Trade.php @@ -0,0 +1,409 @@ +signRequest('POST', '/api/v3/order/test', array_merge( + $options, + [ + 'symbol' => $symbol, + 'side' => $side, + 'type' => $type + ] + )); + } + + /** + * New Order (TRADE) + * + * POST /api/v3/order + * + * Send in a new order. + * + * - `LIMIT_MAKER` are `LIMIT` orders that will be rejected if they would immediately match and trade as a taker. + * - `STOP_LOSS` and `TAKE_PROFIT` will execute a `MARKET` order when the `stopPrice` is reached. + * - Any `LIMIT` or `LIMIT_MAKER` type order can be made an iceberg order by sending an `icebergQty`. + * - Any order with an `icebergQty` MUST have `timeInForce` set to `GTC`. + * - `MARKET` orders using `quantity` specifies how much a user wants to buy or sell based on the market price. + * - `MARKET` orders using `quoteOrderQty` specifies the amount the user wants to spend (when buying) or receive (when selling) of the quote asset; the correct quantity will be determined based on the market liquidity and `quoteOrderQty`. + * - `MARKET` orders using `quoteOrderQty` will not break `LOT_SIZE` filter rules; the order will execute a quantity that will have the notional value as close as possible to `quoteOrderQty`. + * - same `newClientOrderId` can be accepted only when the previous one is filled, otherwise the order will be rejected. + * + * Trigger order price rules against market price for both `MARKET` and `LIMIT` versions: + * + * - Price above market price: `STOP_LOSS` `BUY`, `TAKE_PROFIT` `SELL` + * - Price below market price: `STOP_LOSS` `SELL`, `TAKE_PROFIT` `BUY` + * + * + * Weight(IP): 1 + * + * @param string $symbol + * @param string $side + * @param string $type + * @param array $options + */ + public function newOrder(string $symbol, string $side, string $type, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + if (Strings::isEmpty($side)) { + throw new MissingArgumentException('side'); + } + if (Strings::isEmpty($type)) { + throw new MissingArgumentException('type'); + } + + return $this->signRequest('POST', '/api/v3/order', array_merge( + $options, + [ + 'symbol' => $symbol, + 'side' => $side, + 'type' => $type + ] + )); + } + + /** + * Cancel Order (TRADE) + * + * DELETE /api/v3/order + * + * Cancel an active order. + * + * Either `orderId` or `origClientOrderId` must be sent. + * + * Weight(IP): 1 + * + * @param string $symbol + * @param array $options + */ + public function cancelOrder(string $symbol, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + + return $this->signRequest('DELETE', '/api/v3/order', array_merge( + $options, + [ + 'symbol' => $symbol + ] + )); + } + + /** + * Cancel all Open Orders on a Symbol (TRADE) + * + * DELETE /api/v3/openOrders + * + * Cancels all active orders on a symbol. + * This includes OCO orders. + * + * Weight(IP): 1 + * + * @param string $symbol + * @param array $options + */ + public function cancelOpenOrders(string $symbol, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + + return $this->signRequest('DELETE', '/api/v3/openOrders', array_merge( + $options, + [ + 'symbol' => $symbol + ] + )); + } + + /** + * Query Order (USER_DATA) + * + * GET /api/v3/order + * + * Check an order's status. + * + * - Either `orderId` or `origClientOrderId` must be sent. + * - For some historical orders `cummulativeQuoteQty` will be < 0, meaning the data is not available at this time. + * + * Weight(IP): 2 + * + * @param string $symbol + * @param array $options + */ + public function getOrder(string $symbol, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + + return $this->signRequest('GET', '/api/v3/order', array_merge( + $options, + [ + 'symbol' => $symbol + ] + )); + } + + /** + * Current Open Orders (USER_DATA) + * + * GET /api/v3/openOrders + * + * Get all open orders on a symbol. Careful when accessing this with no symbol. + * + * Weight(IP): + * - `3` for a single symbol; + * - `40` when the symbol parameter is omitted; + * + * @param array $options + */ + public function openOrders(array $options = []) + { + return $this->signRequest('GET', '/api/v3/openOrders', $options); + } + + /** + * All Orders (USER_DATA) + * + * GET /api/v3/allOrders + * + * Get all account orders; active, canceled, or filled.. + * + * - If `orderId` is set, it will get orders >= that `orderId`. Otherwise most recent orders are returned. + * - For some historical orders `cummulativeQuoteQty` will be < 0, meaning the data is not available at this time. + * - If `startTime` and/or `endTime` provided, `orderId` is not required + * + * Weight(IP): 10 + * + * @param string $symbol + * @param array $options + */ + public function allOrders(string $symbol, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + + return $this->signRequest('GET', '/api/v3/allOrders', array_merge( + $options, + [ + 'symbol' => $symbol + ] + )); + } + + /** + * New OCO (TRADE) + * + * POST /api/v3/order/oco + * + * Send in a new OCO + * + * - Price Restrictions: + * - `SELL`: Limit Price > Last Price > Stop Price + * - `BUY`: Limit Price < Last Price < Stop Price + * - Quantity Restrictions: + * - Both legs must have the same quantity + * - `ICEBERG` quantities however do not have to be the same + * - Order Rate Limit + * - `OCO` counts as 2 orders against the order rate limit. + * + * Weight(IP): 1 + * + * @param string $symbol + * @param string $side + * @param mixed $quantity + * @param mixed $price + * @param mixed $stopPrice + * @param array $options + */ + public function newOcoOrder(string $symbol, string $side, $quantity, $price, $stopPrice, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + if (Strings::isEmpty($side)) { + throw new MissingArgumentException('side'); + } + + return $this->signRequest('POST', '/api/v3/order/oco', array_merge( + $options, + [ + 'symbol' => $symbol, + 'side' => $side, + 'quantity' => $quantity, + 'price' => $price, + 'stopPrice' => $stopPrice + ] + )); + } + + /** + * Cancel OCO (TRADE) + * + * DELETE /api/v3/orderList + * + * Cancel an entire Order List + * + * Canceling an individual leg will cancel the entire OCO + * + * Weight(IP): 1 + * + * @param string $symbol + * @param array $options + */ + public function cancelOcoOrder(string $symbol, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + + return $this->signRequest('DELETE', '/api/v3/orderList', array_merge( + $options, + [ + 'symbol' => $symbol + ] + )); + } + + /** + * Query OCO (USER_DATA) + * + * GET /api/v3/orderList + * + * Retrieves a specific OCO based on provided optional parameters + * + * Weight(IP): 2 + * + * @param array $options + */ + public function getOcoOrder(array $options = []) + { + return $this->signRequest('GET', '/api/v3/orderList', $options); + } + + /** + * Query all OCO (USER_DATA) + * + * GET /api/v3/allOrderList + * + * Retrieves all OCO based on provided optional parameters + * + * Weight(IP): 10 + * + * @param array $options + */ + public function getOcoOrders(array $options = []) + { + return $this->signRequest('GET', '/api/v3/allOrderList', $options); + } + + /** + * Query Open OCO (USER_DATA) + * + * GET /api/v3/openOrderList + * + * Weight(IP): 3 + * + * @param array $options + */ + public function getOpenOcoOrders(array $options = []) + { + return $this->signRequest('GET', '/api/v3/openOrderList', $options); + } + + /** + * Account Information (USER_DATA) + * + * GET /api/v3/account + * + * Get current account information. + * + * Weight(IP): 10 + * + * @param array $options + */ + public function account(array $options = []) + { + return $this->signRequest('GET', '/api/v3/account', $options); + } + + /** + * Account Trade List (USER_DATA) + * + * GET /api/v3/myTrades + * + * Get trades for a specific account and symbol. + * + * If `fromId` is set, it will get id >= that `fromId`. Otherwise most recent orders are returned. + * + * Weight(IP): 10 + * + * @param string $symbol + * @param array $options + */ + public function myTrades(string $symbol, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + + return $this->signRequest('GET', '/api/v3/myTrades', array_merge( + $options, + [ + 'symbol' => $symbol + ] + )); + } + + /** + * Query Current Order Count Usage (TRADE) + * + * GET /api/v3/rateLimit/order + * + * Displays the user's current order count usage for all intervals. + * + * Weight(IP): 20 + * + * @param array $options + */ + public function orderLimitUsage(array $options = []) + { + return $this->signRequest('GET', '/api/v3/rateLimit/order', $options); + } +} diff --git a/src/Binance/Spot/Wallet.php b/src/Binance/Spot/Wallet.php new file mode 100644 index 0000000..e2e3ebb --- /dev/null +++ b/src/Binance/Spot/Wallet.php @@ -0,0 +1,459 @@ +publicRequest('GET', '/sapi/v1/system/status'); + } + + /** + * All Coins' Information (USER_DATA) + * + * GET /sapi/v1/capital/config/getall + * + * Get information of coins (available for deposit and withdraw) for user. + * + * Weight(IP): 10 + * + * @param array $options + */ + public function coinInfo(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/capital/config/getall', $options); + } + + /** + * Daily Account Snapshot (USER_DATA) + * + * GET /sapi/v1/accountSnapshot + * + * - The query time period must be less than 30 days + * - Support query within the last one month only + * - If startTimeand endTime not sent, return records of the last 7 days by default + * + * Weight(IP): 2400 + * + * @param string $type + * @param array $options + */ + public function accountSnapshot(string $type, array $options = []) + { + if (Strings::isEmpty($type)) { + throw new MissingArgumentException('type'); + } + + return $this->signRequest('GET', '/sapi/v1/accountSnapshot', array_merge( + $options, + [ + 'type' => $type + ] + )); + } + + /** + * Disable Fast Withdraw Switch (USER_DATA) + * + * POST /sapi/v1/account/disableFastWithdrawSwitch + * + * - This request will disable fastwithdraw switch under your account. + * - You need to enable "trade" option for the api key which requests this endpoint. + * + * Weight(IP): 1 + * + * @param array $options + */ + public function disableFastWithdraw(array $options = []) + { + return $this->signRequest('POST', '/sapi/v1/account/disableFastWithdrawSwitch', $options); + } + + /** + * Enable Fast Withdraw Switch (USER_DATA) + * + * POST /sapi/v1/account/enableFastWithdrawSwitch + * + * - This request will enable fastwithdraw switch under your account. You need to enable "trade" option for the api key which requests this endpoint. + * - When Fast Withdraw Switch is on, transferring funds to a Binance account will be done instantly. There is no on-chain transaction, no transaction ID and no withdrawal fee. + * + * Weight(IP): 1 + * + * @param array $options + */ + public function enableFastWithdraw(array $options = []) + { + return $this->signRequest('POST', '/sapi/v1/account/enableFastWithdrawSwitch', $options); + } + + /** + * Withdraw (USER_DATA) + * + * POST /sapi/v1/capital/withdraw/apply + * + * Submit a withdraw request. + * + * - If `network` not send, return with default network of the coin. + * - You can get `network` and `isDefault` in `networkList` of a coin in the response of `Get /sapi/v1/capital/config/getall (HMAC SHA256)`. + * + * Weight(IP): 1 + * + * @param string $coin + * @param string $address + * @param mixed $amount + * @param array $options + */ + public function withdraw(string $coin, string $address, $amount, array $options = []) + { + if (Strings::isEmpty($coin)) { + throw new MissingArgumentException('coin'); + } + if (Strings::isEmpty($address)) { + throw new MissingArgumentException('address'); + } + + return $this->signRequest('POST', '/sapi/v1/capital/withdraw/apply', array_merge( + $options, + [ + 'coin' => $coin, + 'address' => $address, + 'amount' => $amount + ] + )); + } + + /** + * Deposit History (supporting network) + * + * GET /sapi/v1/capital/deposit/hisrec + * + * Fetch deposit history. + * + * - Please notice the default `startTime` and `endTime` to make sure that time interval is within 0-90 days. + * - If both `startTime` and `endTime` are sent, time between `startTime` and `endTime` must be less than 90 days. + * + * Weight(IP): 1 + * + * @param array $options + */ + public function depositHistory(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/capital/deposit/hisrec', $options); + } + + /** + * Withdraw History (supporting network) + * + * GET /sapi/v1/capital/withdraw/history + * + * Fetch withdraw history. + * + * - `network` may not be in the response for old withdraw. + * - Please notice the default `startTime` and `endTime` to make sure that time interval is within 0-90 days. + * - If both `startTime` and `endTime` are sent, time between `startTime` and `endTime` must be less than 90 days + * + * Weight(IP): 1 + * + * @param array $options + */ + public function withdrawHistory(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/capital/withdraw/history', $options); + } + + /** + * Deposit Address (supporting network) + * + * GET /sapi/v1/capital/deposit/address + * + * Fetch deposit address with network. + * + * - If network is not send, return with default network of the coin. + * - You can get network and isDefault in networkList in the response of Get /sapi/v1/capital/config/getall (HMAC SHA256). + * + * Weight(IP): 10 + * + * @param string $coin + * @param array $options + */ + public function depositAddress(string $coin, array $options = []) + { + if (Strings::isEmpty($coin)) { + throw new MissingArgumentException('coin'); + } + + return $this->signRequest('GET', '/sapi/v1/capital/deposit/address', array_merge( + $options, + [ + 'coin' => $coin + ] + )); + } + + /** + * Account Status (USER_DATA) + * + * GET /sapi/v1/account/status + * + * Fetch account status detail. + * + * Weight(IP): 1 + * + * @param array $options + */ + public function accountStatus(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/account/status', $options); + } + + /** + * Account API Trading Status (USER_DATA) + * + * GET /sapi/v1/account/apiTradingStatus + * + * Fetch account API trading status with details. + * + * Weight(IP): 1 + * + * @param array $options + */ + public function apiTradingStatus(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/account/apiTradingStatus', $options); + } + + /** + * DustLog (USER_DATA) + * + * GET /sapi/v1/asset/dribblet + * + * Weight(IP): 1 + * + * @param array $options + */ + public function dustLog(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/asset/dribblet', $options); + } + + /** + * Get Assets That Can Be Converted Into BNB (USER_DATA) + * + * POST /sapi/v1/asset/dust-btc + * + * Weight(IP): 1 + * + * @param array $options + */ + public function dustableAssets(array $options = []) + { + return $this->signRequest('POST', '/sapi/v1/asset/dust-btc', $options); + } + + /** + * Dust Transfer (USER_DATA) + * + * POST /sapi/v1/asset/dust + * + * Convert dust assets to BNB. + * + * Weight(UID): 10 + * + * @param array $asset + * @param array $options + */ + public function dustTransfer(array $asset, array $options = []) + { + if (count($asset) === 0) { + throw new MissingArgumentException('asset'); + } + + return $this->signRequest('POST', '/sapi/v1/asset/dust', array_merge( + $options, + [ + 'asset' => $asset + ] + )); + } + + /** + * Asset Dividend Record (USER_DATA) + * + * GET /sapi/v1/asset/assetDividend + * + * Query asset Dividend Record + * + * Weight(IP): 10 + * + * @param array $options + */ + public function assetDividendRecord(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/asset/assetDividend', $options); + } + + /** + * Asset Detail (USER_DATA) + * + * GET /sapi/v1/asset/assetDetail + * + * Fetch details of assets supported on Binance. + * + * - Please get network and other deposit or withdraw details from `GET /sapi/v1/capital/config/getall`. + * + * Weight(IP): 1 + * + * @param array $options + */ + public function assetDetail(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/asset/assetDetail', $options); + } + + /** + * Trade Fee (USER_DATA) + * + * GET /sapi/v1/asset/tradeFee + * + * Fetch trade fee + * + * Weight(IP): 1 + * + * @param array $options + */ + public function tradeFee(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/asset/tradeFee', $options); + } + + /** + * Query User Universal Transfer History (USER_DATA) + * + * GET /sapi/v1/asset/transfer + * + * - `fromSymbol` must be sent when type are ISOLATEDMARGIN_MARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN + * - `toSymbol` must be sent when type are MARGIN_ISOLATEDMARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN + * - Support query within the last 6 months only + * - If `startTime` and `endTime` not sent, return records of the last 7 days by default + * + * Weight(IP): 1 + * + * @param string $type + * @param array $options + */ + public function universalTransferHistory(string $type, array $options = []) + { + if (Strings::isEmpty($type)) { + throw new MissingArgumentException('type'); + } + + return $this->signRequest('GET', '/sapi/v1/asset/transfer', array_merge( + $options, + [ + 'type' => $type + ] + )); + } + + /** + * User Universal Transfer (USER_DATA) + * + * POST /sapi/v1/asset/transfer + * + * You need to enable `Permits Universal Transfer` option for the api key which requests this endpoint. + * + * - `fromSymbol` must be sent when type are ISOLATEDMARGIN_MARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN + * - `toSymbol` must be sent when type are MARGIN_ISOLATEDMARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN + * + * ENUM of transfer types: + * - MAIN_UMFUTURE Spot account transfer to USDⓈ-M Futures account + * - MAIN_CMFUTURE Spot account transfer to COIN-M Futures account + * - MAIN_MARGIN Spot account transfer to Margin(cross)account + * - UMFUTURE_MAIN USDⓈ-M Futures account transfer to Spot account + * - UMFUTURE_MARGIN USDⓈ-M Futures account transfer to Margin(cross)account + * - CMFUTURE_MAIN COIN-M Futures account transfer to Spot account + * - CMFUTURE_MARGIN COIN-M Futures account transfer to Margin(cross) account + * - MARGIN_MAIN Margin(cross)account transfer to Spot account + * - MARGIN_UMFUTURE Margin(cross)account transfer to USDⓈ-M Futures + * - MARGIN_CMFUTURE Margin(cross)account transfer to COIN-M Futures + * - ISOLATEDMARGIN_MARGIN Isolated margin account transfer to Margin(cross) account + * - MARGIN_ISOLATEDMARGIN Margin(cross) account transfer to Isolated margin account + * - ISOLATEDMARGIN_ISOLATEDMARGIN Isolated margin account transfer to Isolated margin account + * - MAIN_FUNDING Spot account transfer to Funding account + * - FUNDING_MAIN Funding account transfer to Spot account + * - FUNDING_UMFUTURE Funding account transfer to UMFUTURE account + * - UMFUTURE_FUNDING UMFUTURE account transfer to Funding account + * - MARGIN_FUNDING MARGIN account transfer to Funding account + * - FUNDING_MARGIN Funding account transfer to Margin account + * - FUNDING_CMFUTURE Funding account transfer to CMFUTURE account + * - CMFUTURE_FUNDING CMFUTURE account transfer to Funding account + * + * Weight(IP): 1 + * + * @param string $type + * @param string $asset + * @param mixed $amount + * @param array $options + */ + public function universalTransfer(string $type, string $asset, $amount, array $options = []) + { + if (Strings::isEmpty($type)) { + throw new MissingArgumentException('type'); + } + if (Strings::isEmpty($asset)) { + throw new MissingArgumentException('asset'); + } + + return $this->signRequest('POST', '/sapi/v1/asset/transfer', array_merge( + $options, + [ + 'type' => $type, + 'asset' => $asset, + 'amount' => $amount + ] + )); + } + + /** + * Funding Wallet (USER_DATA) + * + * POST /sapi/v1/asset/get-funding-asset + * + * - Currently supports querying the following business assets:Binance Pay, Binance Card, Binance Gift Card, Stock Token + * + * Weight(IP): 1 + * + * @param array $options + */ + public function fundingWallet(array $options = []) + { + return $this->signRequest('POST', '/sapi/v1/asset/get-funding-asset', $options); + } + + /** + * Get API Key Permission (USER_DATA) + * + * GET /sapi/v1/account/apiRestrictions + * + * Weight(IP): 1 + * + * @param array $options + */ + public function apiKeyPermission(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/account/apiRestrictions', $options); + } +} diff --git a/src/Binance/Util/Arrays.php b/src/Binance/Util/Arrays.php new file mode 100644 index 0000000..ea9203c --- /dev/null +++ b/src/Binance/Util/Arrays.php @@ -0,0 +1,19 @@ + '["BTCUSDT","BNBBTC"]' + */ + public static function stringify(array $values): string + { + $encoded = array_reduce($values, function ($carry, $item) { + return sprintf("%s\"%s\"%s", $carry, $item, ","); + }); + $encoded = rtrim($encoded, ","); + return sprintf("%s%s%s", "[", $encoded, "]"); + } +} diff --git a/src/Binance/Util/Strings.php b/src/Binance/Util/Strings.php new file mode 100644 index 0000000..fcf9421 --- /dev/null +++ b/src/Binance/Util/Strings.php @@ -0,0 +1,11 @@ + $value) { + if (is_array($value)) { + $query_array = array_merge($query_array, array_map(function ($v) use ($key) { + if (is_bool($v) === true) { + return $v ? urlencode($key) . '=true' : urlencode($key) . '=false'; + } + return urlencode($key) . '=' . urlencode($v); + }, $value)); + } else { + if (is_bool($value) === true) { + $query_array[] = $value ? urlencode($key) . '=true' : urlencode($key) . '=false'; + } else { + $query_array[] = urlencode($key) . '=' . urlencode($value); + } + } + } + return implode('&', $query_array); + } +} diff --git a/src/Binance/Websocket.php b/src/Binance/Websocket.php new file mode 100644 index 0000000..3839e50 --- /dev/null +++ b/src/Binance/Websocket.php @@ -0,0 +1,78 @@ +logger = $args['logger'] ?? new NullLogger(); + $this->baseURL = $args['baseURL']; + $this->wsConnector = $args['wsConnector'] ?? null; + } + + public function ping() + { + if ($this->wsConnection) { + $this->wsConnection->send(new Frame('', true, Frame::OP_PING)); + } else { + $this->logger->warning("ping can't be sent before ws connection established."); + } + } + + /** + * $callback can be used: + * - if it's function, it will be used to process the `message` event. + * - if it's an array, it's required to specific the event type for each function. e.g. ['message' => function(){}, 'ping' => function(){}] + */ + protected function handleCallBack($url, $callback) + { + if (is_array($callback)) { + foreach ($callback as $event => $func) { + if (gettype($event) == "integer") { + throw new InvalidArgumentException("callback", json_encode($callback), "Array has event type as key, e.g. ['message' => function() {}]", "Please find example at https://github.com/binance/binance-connector-php"); + } + } + } + $this->createWSConnection($url)->then(function ($conn) use ($callback) { + $this->wsConnection = $conn; + if (is_callable($callback)) { + $conn->on('message', function ($msg) use ($conn, $callback) { + $callback($conn, $msg); + }); + } + + if (is_array($callback)) { + foreach ($callback as $event => $func) { + $event = strtolower(strval($event)); + if (in_array($event, ['message', 'ping', 'pong', 'close'])) { + $conn->on($event, function ($msg) use ($conn, $func) { + call_user_func($func, $conn, $msg); + }); + } + } + } + }, function ($e) { + $this->logger->error("Could not connect: {$e->getMessage()}".PHP_EOL); + }); + } + + + private function createWSConnection($url) + { + if ($this->wsConnector) { + return call_user_func($this->wsConnector, $url); + } else { + return \Ratchet\Client\connect($url); + } + } +} diff --git a/src/Binance/Websocket/Spot.php b/src/Binance/Websocket/Spot.php new file mode 100644 index 0000000..ea15ef4 --- /dev/null +++ b/src/Binance/Websocket/Spot.php @@ -0,0 +1,198 @@ +@aggTrade + * Update Speed: Real-time + * + */ + public function aggTrade($symbol, $callback) + { + $url = "{$this->baseURL}/ws/". strtolower($symbol). "@aggTrade"; + $this->handleCallBack($url, $callback); + } + + /* + * Trade Streams + * + * The Trade Streams push raw trade information; each trade has a unique buyer and seller. + * + * Stream Name: @trade + * Update Speed: Real-time + * + */ + public function trade($symbol, $callback) + { + $url = "{$this->baseURL}/ws/". strtolower($symbol). "@trade"; + $this->handleCallBack($url, $callback); + } + + /* + * Kline/Candlestick Streams + * + * The Kline/Candlestick Stream push updates to the current klines/candlestick every second. + * + * Stream Name: @kline_ + * + * interval: + * m -> minutes; h -> hours; d -> days; w -> weeks; M -> months + * + * - 1m + * - 3m + * - 5m + * - 15m + * - 30m + * - 1h + * - 2h + * - 4h + * - 6h + * - 8h + * - 12h + * - 1d + * - 3d + * - 1w + * - 1M + * + * Update Speed: 2000ms + */ + public function kline($symbol, $interval, $callback) + { + $url = "{$this->baseURL}/ws/". strtolower($symbol) . "@kline_{$interval}"; + $this->handleCallBack($url, $callback); + } + + + /* + * Individual symbol or all symbols mini ticker + * + * 24hr rolling window mini-ticker statistics. + * These are NOT the statistics of the UTC day, but a 24hr rolling window for the previous 24hrs + * + * Stream Name: @miniTicker or + * Stream Name: !miniTicker@arr + * + * Update Speed: 1000ms + */ + public function miniTicker($callback, $symbol=null) + { + if ($symbol) { + $url = "{$this->baseURL}/ws/". strtolower($symbol) . "@miniTicker"; + } else { + $url = "{$this->baseURL}/ws/!miniTicker@arr"; + } + $this->handleCallBack($url, $callback); + } + + /* + * Individual symbol or all symbols ticker + * + * 24hr rollwing window ticker statistics for a single symbol. + * + * These are NOT the statistics of the UTC day, but a 24hr rolling window for the previous 24hrs. + * + * Stream Name: @ticker or + * Stream Name: !ticker@arr + * + * Update Speed: 1000ms + */ + public function ticker($callback, $symbol=null) + { + if ($symbol) { + $url = "{$this->baseURL}/ws/". strtolower($symbol) . "@ticker"; + } else { + $url = "{$this->baseURL}/ws/!ticker@arr"; + } + $this->handleCallBack($url, $callback); + } + + /* + * Individual symbol or all book ticker + * + * Pushes any update to the best bid or ask's price or quantity in real-time for a specified symbol. + * + * Stream Name: @bookTicker or + * Stream Name: !bookTicker + * + * Update Speed: realtime + */ + public function bookTicker($callback, $symbol=null) + { + if ($symbol) { + $url = "{$this->baseURL}/ws/". strtolower($symbol) . "@bookTicker"; + } else { + $url = "{$this->baseURL}/ws/!bookTicker"; + } + $this->handleCallBack($url, $callback); + } + + /* + * Partial Book Depth Streams + * + * Top bids and asks, Valid are 5, 10, or 20. + * + * Stream Names: @depth OR + * @depth@100ms. + * + * Update Speed: 1000ms or 100ms + * + */ + public function partialBookDepth($symbol, $levels, $speed, $callback) + { + $url = "{$this->baseURL}/ws/". strtolower($symbol). "@depth{$levels}@{$speed}"; + $this->handleCallBack($url, $callback); + } + + /* + * Partial Book Depth Streams + * + * Top bids and asks, Valid are 5, 10, or 20. + * + * Stream Names: @depth OR + * @depth@100ms. + * + * Update Speed: 1000ms or 100ms + * + */ + public function diffBookDepth($symbol, $speed, $callback) + { + $url = "{$this->baseURL}/ws/". strtolower($symbol). "@depth@{$speed}"; + $this->handleCallBack($url, $callback); + } + + /* + * Listen to User data stream + * + */ + public function userData($listenKey, $callback) + { + $url = "{$this->baseURL}/ws/{$listenKey}"; + $this->handleCallBack($url, $callback); + } + + /* + * Listen to User data stream + * + * + * $client->userData(['btcusdt@miniTicker', 'ethusdt@tikcer'], $callbacks); + * + */ + public function combined(array $streams, $callback) + { + $url = "{$this->baseURL}/stream?streams=". implode('/', $streams); + $this->handleCallBack($url, $callback); + } +} diff --git a/tests/BaseTestCase.php b/tests/BaseTestCase.php new file mode 100644 index 0000000..dc36fc3 --- /dev/null +++ b/tests/BaseTestCase.php @@ -0,0 +1,48 @@ +httpMock = new \Aeris\GuzzleHttpMock\Mock(); + $this->data = ['key'=> 'value', 'key2'=> 'value']; + $guzzleClient = new \GuzzleHttp\Client([ + 'handler' => $this->httpMock->getHandlerStackWithMiddleware() + ]); + $this->spotClient = new Spot([ + 'key' => 'the_key', + 'secret' => 'the_secret', + 'httpClient' => $guzzleClient + ]); + } + + /** + * @return \GuzzleHttp\Client + */ + protected function getMockClient($status, $response, $headers = array()) + { + $mock = new MockHandler([ + new Response($status, $headers, is_array($response) ? json_encode($response) : $response) + ]); + $handlerStack = HandlerStack::create($mock); + $client = new \GuzzleHttp\Client(['handler' => $handlerStack]); + return $client; + } + + public function tearDown(): void + { + $this->httpMock->verify(); + } +} diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 0000000..4ff10cc --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,5 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/blvt/tokenInfo')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'tokenName' => 'BTCUP' + ])) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->blvtInfo([ + 'tokenName' => 'BTCUP' + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/blvt/BlvtRedeemTest.php b/tests/spot/blvt/BlvtRedeemTest.php new file mode 100644 index 0000000..c695f48 --- /dev/null +++ b/tests/spot/blvt/BlvtRedeemTest.php @@ -0,0 +1,44 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->blvtRedeem('', 1.01); + } + + public function testBlvtRedeem() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/blvt/redeem')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'tokenName' => 'BTCDOWN', + 'amount' => '1.01', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->blvtRedeem('BTCDOWN', 1.01, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/blvt/BlvtRedemptionRecordTest.php b/tests/spot/blvt/BlvtRedemptionRecordTest.php new file mode 100644 index 0000000..a0aff7c --- /dev/null +++ b/tests/spot/blvt/BlvtRedemptionRecordTest.php @@ -0,0 +1,43 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/blvt/redeem/record')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'tokenName' => 'BTCUP', + 'id' => '123', + 'startTime' => '1640995200000', + 'endTime' => '1640995200000', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->blvtRedemptionRecord([ + 'tokenName' => 'BTCUP', + 'id' => 123, + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/blvt/BlvtSubscribeTest.php b/tests/spot/blvt/BlvtSubscribeTest.php new file mode 100644 index 0000000..33e8109 --- /dev/null +++ b/tests/spot/blvt/BlvtSubscribeTest.php @@ -0,0 +1,44 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->blvtSubscribe('', 1.01); + } + + public function testBlvtSubscribe() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/blvt/subscribe')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'tokenName' => 'BTCDOWN', + 'cost' => '1.01', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->blvtSubscribe('BTCDOWN', 1.01, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/blvt/BlvtSubscriptionRecordTest.php b/tests/spot/blvt/BlvtSubscriptionRecordTest.php new file mode 100644 index 0000000..7df35a9 --- /dev/null +++ b/tests/spot/blvt/BlvtSubscriptionRecordTest.php @@ -0,0 +1,45 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/blvt/subscribe/record')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'tokenName' => 'BTCUP', + 'id' => '123', + 'startTime' => '1640995200000', + 'endTime' => '1640995200000', + 'limit' => '500', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->blvtSubscriptionRecord([ + 'tokenName' => 'BTCUP', + 'id' => 123, + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'limit' => 500, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/blvt/BlvtUserLimitInfoTest.php b/tests/spot/blvt/BlvtUserLimitInfoTest.php new file mode 100644 index 0000000..7609fae --- /dev/null +++ b/tests/spot/blvt/BlvtUserLimitInfoTest.php @@ -0,0 +1,37 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/blvt/userLimit')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'tokenName' => 'BTCUP', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->blvtUserLimitInfo([ + 'tokenName' => 'BTCUP', + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/bswap/SwapAddLiquidityPreviewTest.php b/tests/spot/bswap/SwapAddLiquidityPreviewTest.php new file mode 100644 index 0000000..75b2b1e --- /dev/null +++ b/tests/spot/bswap/SwapAddLiquidityPreviewTest.php @@ -0,0 +1,52 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->swapAddLiquidityPreview(2, '', 'USDT', 12415.2); + } + + public function testSwapAddLiquidityPreviewThrowsExceptionWithoutQuoteAsset() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->swapAddLiquidityPreview(2, 'SINGLE', '', 12415.2); + } + + public function testSwapAddLiquidityPreview() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/bswap/addLiquidityPreview')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'poolId' => '2', + 'type' => 'SINGLE', + 'quoteAsset' => 'USDT', + 'quoteQty' => '12415.2', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->swapAddLiquidityPreview(2, 'SINGLE', 'USDT', 12415.2, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/bswap/SwapAddLiquidityTest.php b/tests/spot/bswap/SwapAddLiquidityTest.php new file mode 100644 index 0000000..80ef72e --- /dev/null +++ b/tests/spot/bswap/SwapAddLiquidityTest.php @@ -0,0 +1,47 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->swapAddLiquidity(2, '', 12415.2); + } + + public function testSwapAddLiquidity() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/bswap/liquidityAdd')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'poolId' => '2', + 'type' => 'Single', + 'asset' => 'BTC', + 'quantity' => '12415.2', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->swapAddLiquidity(2, 'BTC', 12415.2, [ + 'type' => 'Single', + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/bswap/SwapClaimRewardsTest.php b/tests/spot/bswap/SwapClaimRewardsTest.php new file mode 100644 index 0000000..9f6b05b --- /dev/null +++ b/tests/spot/bswap/SwapClaimRewardsTest.php @@ -0,0 +1,37 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/bswap/claimRewards')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'type' => '0', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->swapClaimRewards([ + 'type' => 0, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/bswap/SwapClaimedHistoryTest.php b/tests/spot/bswap/SwapClaimedHistoryTest.php new file mode 100644 index 0000000..43449c4 --- /dev/null +++ b/tests/spot/bswap/SwapClaimedHistoryTest.php @@ -0,0 +1,47 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/bswap/claimedHistory')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'poolId' => '123', + 'assetRewards' => 'BNB', + 'type' => '0', + 'startTime' => '1640995200000', + 'endTime' => '1640995200000', + 'limit' => '500', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->swapClaimedHistory([ + 'poolId' => 123, + 'assetRewards' => 'BNB', + 'type' => 0, + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'limit' => 500, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/bswap/SwapHistoryTest.php b/tests/spot/bswap/SwapHistoryTest.php new file mode 100644 index 0000000..153d9f1 --- /dev/null +++ b/tests/spot/bswap/SwapHistoryTest.php @@ -0,0 +1,49 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/bswap/swap')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'swapId' => '123', + 'startTime' => '1640995200000', + 'endTime' => '1640995200000', + 'status' => '0', + 'quoteAsset' => 'USDT', + 'baseAsset' => 'BUSD', + 'limit' => '100', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->swapHistory([ + 'swapId' => 123, + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'status' => 0, + 'quoteAsset' => 'USDT', + 'baseAsset' => 'BUSD', + 'limit' => 100, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/bswap/SwapLiquidityOperationRecordTest.php b/tests/spot/bswap/SwapLiquidityOperationRecordTest.php new file mode 100644 index 0000000..baf16ec --- /dev/null +++ b/tests/spot/bswap/SwapLiquidityOperationRecordTest.php @@ -0,0 +1,47 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/bswap/liquidityOps')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'operationId' => '123', + 'poolId' => '123', + 'operation' => 'ADD', + 'startTime' => '1640995200000', + 'endTime' => '1640995200000', + 'limit' => '100', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->swapLiquidityOperationRecord([ + 'operationId' => 123, + 'poolId' => 123, + 'operation' => 'ADD', + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'limit' => 100, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/bswap/SwapLiquidityTest.php b/tests/spot/bswap/SwapLiquidityTest.php new file mode 100644 index 0000000..69db51e --- /dev/null +++ b/tests/spot/bswap/SwapLiquidityTest.php @@ -0,0 +1,37 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/bswap/liquidity')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'poolId' => '123', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->swapLiquidity([ + 'poolId' => 123, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/bswap/SwapListAllPoolsTest.php b/tests/spot/bswap/SwapListAllPoolsTest.php new file mode 100644 index 0000000..845afa9 --- /dev/null +++ b/tests/spot/bswap/SwapListAllPoolsTest.php @@ -0,0 +1,30 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/bswap/pools')) + ->withMethod('GET') + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->swapListAllPools(); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/bswap/SwapPoolConfigureTest.php b/tests/spot/bswap/SwapPoolConfigureTest.php new file mode 100644 index 0000000..d93a162 --- /dev/null +++ b/tests/spot/bswap/SwapPoolConfigureTest.php @@ -0,0 +1,37 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/bswap/poolConfigure')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'poolId' => '2', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->swapPoolConfigure([ + 'poolId' => 2, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/bswap/SwapRemoveLiquidityPreviewTest.php b/tests/spot/bswap/SwapRemoveLiquidityPreviewTest.php new file mode 100644 index 0000000..72ce95b --- /dev/null +++ b/tests/spot/bswap/SwapRemoveLiquidityPreviewTest.php @@ -0,0 +1,52 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->swapRemoveLiquidityPreview(2, '', 'USDT', 12415.2); + } + + public function testSwapRemoveLiquidityPreviewThrowsExceptionWithoutQuoteAsset() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->swapRemoveLiquidityPreview(2, 'SINGLE', '', 12415.2); + } + + public function testSwapRemoveLiquidityPreview() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/bswap/removeLiquidityPreview')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'poolId' => '2', + 'type' => 'SINGLE', + 'quoteAsset' => 'USDT', + 'shareAmount' => '12415.2', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->swapRemoveLiquidityPreview(2, 'SINGLE', 'USDT', 12415.2, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/bswap/SwapRemoveLiquidityTest.php b/tests/spot/bswap/SwapRemoveLiquidityTest.php new file mode 100644 index 0000000..d54e0b8 --- /dev/null +++ b/tests/spot/bswap/SwapRemoveLiquidityTest.php @@ -0,0 +1,47 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->swapRemoveLiquidity(2, '', 12415.2); + } + + public function testSwapRemoveLiquidity() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/bswap/liquidityRemove')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'poolId' => '2', + 'type' => 'SINGLE', + 'asset' => 'BNB', + 'shareAmount' => '12415.2', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->swapRemoveLiquidity(2, 'SINGLE', 12415.2, [ + 'asset' => ['BNB'], + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/bswap/SwapRequestQuoteTest.php b/tests/spot/bswap/SwapRequestQuoteTest.php new file mode 100644 index 0000000..bfbee61 --- /dev/null +++ b/tests/spot/bswap/SwapRequestQuoteTest.php @@ -0,0 +1,51 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->swapRequestQuote('', 'BUSD', 12415.2); + } + + public function testSwapRequestQuoteThrowsExceptionWithoutBaseAsset() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->swapRequestQuote('USDT', '', 12415.2); + } + + public function testSwapRequestQuote() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/bswap/quote')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'quoteAsset' => 'USDT', + 'baseAsset' => 'BUSD', + 'quoteQty' => '12415.2', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->swapRequestQuote('USDT', 'BUSD', 12415.2, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/bswap/SwapSendTest.php b/tests/spot/bswap/SwapSendTest.php new file mode 100644 index 0000000..288f9e5 --- /dev/null +++ b/tests/spot/bswap/SwapSendTest.php @@ -0,0 +1,51 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->swapSend('', 'BUSD', 12415.2); + } + + public function testSwapSendThrowsExceptionWithoutBaseAsset() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->swapSend('USDT', '', 12415.2); + } + + public function testSwapSend() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/bswap/swap')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'quoteAsset' => 'USDT', + 'baseAsset' => 'BUSD', + 'quoteQty' => '12415.2', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->swapSend('USDT', 'BUSD', 12415.2, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/bswap/SwapUnclaimedRewardsTest.php b/tests/spot/bswap/SwapUnclaimedRewardsTest.php new file mode 100644 index 0000000..84e5037 --- /dev/null +++ b/tests/spot/bswap/SwapUnclaimedRewardsTest.php @@ -0,0 +1,37 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/bswap/unclaimedRewards')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'type' => '0', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->swapUnclaimedRewards([ + 'type' => 0, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/c2c/C2cTradeHistoryTest.php b/tests/spot/c2c/C2cTradeHistoryTest.php new file mode 100644 index 0000000..107803a --- /dev/null +++ b/tests/spot/c2c/C2cTradeHistoryTest.php @@ -0,0 +1,47 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->c2cTradeHistory(''); + } + + public function testC2cTradeHistory() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/c2c/orderMatch/listUserOrderHistory')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'tradeType' => 'BUY', + 'page' => '1', + 'rows' => '100', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->c2cTradeHistory('BUY', [ + 'page' => 1, + 'rows' => 100, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/convert/convertTradeHistoryTest.php b/tests/spot/convert/convertTradeHistoryTest.php new file mode 100644 index 0000000..f68e3fd --- /dev/null +++ b/tests/spot/convert/convertTradeHistoryTest.php @@ -0,0 +1,39 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/convert/tradeFlow')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'startTime' => '1563189166000', + 'endTime' => '1563282766000', + 'limit' => '100', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->convertTradeHistory(1563189166000, 1563282766000, [ + 'limit' => 100, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/cryptoloans/CryptoLoansIncomeHistoryTest.php b/tests/spot/cryptoloans/CryptoLoansIncomeHistoryTest.php new file mode 100644 index 0000000..d2c2d1d --- /dev/null +++ b/tests/spot/cryptoloans/CryptoLoansIncomeHistoryTest.php @@ -0,0 +1,51 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->cryptoLoansIncomeHistory(''); + } + + public function testCryptoLoansIncomeHistory() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/loan/income')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'asset' => 'BTC', + 'type' => 'borrowIn', + 'startTime' => '1640995200000', + 'endTime' => '1640995200000', + 'limit' => '20', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->cryptoLoansIncomeHistory('BTC', [ + 'type' => 'borrowIn', + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'limit' => 20, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/fiat/FiatDepositWithdrawHistoryTest.php b/tests/spot/fiat/FiatDepositWithdrawHistoryTest.php new file mode 100644 index 0000000..cb62f4c --- /dev/null +++ b/tests/spot/fiat/FiatDepositWithdrawHistoryTest.php @@ -0,0 +1,51 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->fiatDepositWithdrawHistory(''); + } + + public function testFiatDepositWithdrawHistory() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/fiat/orders')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'transactionType' => '0', + 'beginTime' => '1626144956000', + 'endTime' => '1640995200000', + 'page' => '1', + 'rows' => '300', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->fiatDepositWithdrawHistory('0', [ + 'beginTime' => 1626144956000, + 'endTime' => 1640995200000, + 'page' => 1, + 'rows' => 300, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/fiat/FiatPaymentsHistoryTest.php b/tests/spot/fiat/FiatPaymentsHistoryTest.php new file mode 100644 index 0000000..d8fcffe --- /dev/null +++ b/tests/spot/fiat/FiatPaymentsHistoryTest.php @@ -0,0 +1,44 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/fiat/payments')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'transactionType' => '0', + 'beginTime' => '1626144956000', + 'endTime' => '1640995200000', + 'page' => '1', + 'rows' => '300', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->fiatPaymentsHistory(0, [ + 'beginTime' => 1626144956000, + 'endTime' => 1640995200000, + 'page' => 1, + 'rows' => 300, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/giftcard/GiftCardRsaPublicKeyTest.php b/tests/spot/giftcard/GiftCardRsaPublicKeyTest.php new file mode 100644 index 0000000..790292b --- /dev/null +++ b/tests/spot/giftcard/GiftCardRsaPublicKeyTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/giftcard/cryptography/rsa-public-key')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->giftCardRsaPublicKey([ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/giftcard/GiftcardCreateCodeTest.php b/tests/spot/giftcard/GiftcardCreateCodeTest.php new file mode 100644 index 0000000..13bf44c --- /dev/null +++ b/tests/spot/giftcard/GiftcardCreateCodeTest.php @@ -0,0 +1,44 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->giftCardCreateCode('', 1.01); + } + + public function testGiftCardCreateCode() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/giftcard/createCode')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'token' => 'BTC', + 'amount' => '1.01', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->giftCardCreateCode('BTC', 1.01, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/giftcard/GiftcardRedeemCodeTest.php b/tests/spot/giftcard/GiftcardRedeemCodeTest.php new file mode 100644 index 0000000..a62cec7 --- /dev/null +++ b/tests/spot/giftcard/GiftcardRedeemCodeTest.php @@ -0,0 +1,43 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->giftCardRedeemCode(''); + } + + public function testGiftCardRedeemCode() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/giftcard/redeemCode')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'code' => '000000', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->giftCardRedeemCode('000000', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/giftcard/GiftcardVerifyCodeTest.php b/tests/spot/giftcard/GiftcardVerifyCodeTest.php new file mode 100644 index 0000000..7a111d8 --- /dev/null +++ b/tests/spot/giftcard/GiftcardVerifyCodeTest.php @@ -0,0 +1,43 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->giftCardVerifyCode(''); + } + + public function testGiftCardVerifyCode() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/giftcard/verify')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'referenceNo' => '000000000000000000', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->giftCardVerifyCode('000000000000000000', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/isolatedmarginstream/IsolatedMarginCloseListenKeyTest.php b/tests/spot/isolatedmarginstream/IsolatedMarginCloseListenKeyTest.php new file mode 100644 index 0000000..1de3559 --- /dev/null +++ b/tests/spot/isolatedmarginstream/IsolatedMarginCloseListenKeyTest.php @@ -0,0 +1,47 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->isolatedMarginCloseListenKey('', 'listen-key'); + } + + public function testIsolatedMarginCloseListenKeyThrowsExceptionWithoutListenKey() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->isolatedMarginCloseListenKey('BTCUSDT', ''); + } + + public function testIsolatedMarginCloseListenKey() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/userDataStream/isolated')) + ->withMethod('DELETE') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BTCUSDT', + 'listenKey' => 'listen-key' + ])) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->isolatedMarginCloseListenKey('BTCUSDT', 'listen-key'); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/isolatedmarginstream/IsolatedMarginNewListenKeyTest.php b/tests/spot/isolatedmarginstream/IsolatedMarginNewListenKeyTest.php new file mode 100644 index 0000000..f3d7d7c --- /dev/null +++ b/tests/spot/isolatedmarginstream/IsolatedMarginNewListenKeyTest.php @@ -0,0 +1,40 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->isolatedMarginNewListenKey(''); + } + + public function testIsolatedMarginNewListenKey() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/userDataStream/isolated')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BTCUSDT' + ])) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->isolatedMarginNewListenKey('BTCUSDT'); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/isolatedmarginstream/IsolatedMarginRenewListenKeyTest.php b/tests/spot/isolatedmarginstream/IsolatedMarginRenewListenKeyTest.php new file mode 100644 index 0000000..ae8fbb2 --- /dev/null +++ b/tests/spot/isolatedmarginstream/IsolatedMarginRenewListenKeyTest.php @@ -0,0 +1,47 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->isolatedMarginRenewListenKey('', 'listen-key'); + } + + public function testIsolatedMarginRenewListenKeyThrowsExceptionWithoutListenKey() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->isolatedMarginRenewListenKey('BTCUSDT', ''); + } + + public function testIsolatedMarginRenewListenKey() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/userDataStream/isolated')) + ->withMethod('PUT') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BTCUSDT', + 'listenKey' => 'listen-key' + ])) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->isolatedMarginRenewListenKey('BTCUSDT', 'listen-key'); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/BNBBurnStatusTest.php b/tests/spot/margin/BNBBurnStatusTest.php new file mode 100644 index 0000000..70116db --- /dev/null +++ b/tests/spot/margin/BNBBurnStatusTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/bnbBurn')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->bnbBurnStatus([ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/IsolatedMarginAccountLimitTest.php b/tests/spot/margin/IsolatedMarginAccountLimitTest.php new file mode 100644 index 0000000..94129b7 --- /dev/null +++ b/tests/spot/margin/IsolatedMarginAccountLimitTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/isolated/accountLimit')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->isolatedMarginAccountLimit([ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/IsolatedMarginAccountTest.php b/tests/spot/margin/IsolatedMarginAccountTest.php new file mode 100644 index 0000000..fc6c209 --- /dev/null +++ b/tests/spot/margin/IsolatedMarginAccountTest.php @@ -0,0 +1,37 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/isolated/account')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbols' => 'BTCUSDT,BNBUSDT,ADAUSDT', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->isolatedMarginAccount([ + 'symbols' => 'BTCUSDT,BNBUSDT,ADAUSDT', + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/IsolatedMarginAllSymbolsTest.php b/tests/spot/margin/IsolatedMarginAllSymbolsTest.php new file mode 100644 index 0000000..d28939e --- /dev/null +++ b/tests/spot/margin/IsolatedMarginAllSymbolsTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/isolated/allPairs')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->isolatedMarginAllSymbols([ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/IsolatedMarginDisableAccountTest.php b/tests/spot/margin/IsolatedMarginDisableAccountTest.php new file mode 100644 index 0000000..0ba003b --- /dev/null +++ b/tests/spot/margin/IsolatedMarginDisableAccountTest.php @@ -0,0 +1,43 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->isolatedMarginDisableAccount(''); + } + + public function testIsolatedMarginDisableAccount() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/isolated/account')) + ->withMethod('DELETE') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->isolatedMarginDisableAccount('BNBUSDT', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/IsolatedMarginEnableAccountTest.php b/tests/spot/margin/IsolatedMarginEnableAccountTest.php new file mode 100644 index 0000000..bc1e0e6 --- /dev/null +++ b/tests/spot/margin/IsolatedMarginEnableAccountTest.php @@ -0,0 +1,43 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->isolatedMarginEnableAccount(''); + } + + public function testIsolatedMarginEnableAccount() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/isolated/account')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->isolatedMarginEnableAccount('BNBUSDT', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/IsolatedMarginFeeDataTest.php b/tests/spot/margin/IsolatedMarginFeeDataTest.php new file mode 100644 index 0000000..fdd63de --- /dev/null +++ b/tests/spot/margin/IsolatedMarginFeeDataTest.php @@ -0,0 +1,37 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/isolatedMarginData')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->isolatedMarginFeeData([ + 'symbol' => 'BNBUSDT', + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/IsolatedMarginSymbolTest.php b/tests/spot/margin/IsolatedMarginSymbolTest.php new file mode 100644 index 0000000..0d08557 --- /dev/null +++ b/tests/spot/margin/IsolatedMarginSymbolTest.php @@ -0,0 +1,43 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->isolatedMarginSymbol(''); + } + + public function testIsolatedMarginSymbol() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/isolated/pair')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->isolatedMarginSymbol('BNBUSDT', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/IsolatedMarginTierDataTest.php b/tests/spot/margin/IsolatedMarginTierDataTest.php new file mode 100644 index 0000000..d27c037 --- /dev/null +++ b/tests/spot/margin/IsolatedMarginTierDataTest.php @@ -0,0 +1,45 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->isolatedMarginTierData(''); + } + + public function testIsolatedMarginTierData() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/isolatedMarginTier')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'tier' => '1', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->isolatedMarginTierData('BNBUSDT', [ + 'tier' => '1', + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/IsolatedMarginTransferHistoryTest.php b/tests/spot/margin/IsolatedMarginTransferHistoryTest.php new file mode 100644 index 0000000..d469410 --- /dev/null +++ b/tests/spot/margin/IsolatedMarginTransferHistoryTest.php @@ -0,0 +1,53 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->isolatedMarginTransferHistory(''); + } + + public function testIsolatedMarginTransferHistory() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/isolated/transfer')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'asset' => 'BNB', + 'symbol' => 'BNBUSDT', + 'transFrom' => 'SPOT', + 'transTo' => 'ISOLATED_MARGIN', + 'current' => '1', + 'size' => '100', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->isolatedMarginTransferHistory('BNBUSDT', [ + 'asset' => 'BNB', + 'transFrom' => 'SPOT', + 'transTo' => 'ISOLATED_MARGIN', + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/IsolatedMarginTransferTest.php b/tests/spot/margin/IsolatedMarginTransferTest.php new file mode 100644 index 0000000..77f135f --- /dev/null +++ b/tests/spot/margin/IsolatedMarginTransferTest.php @@ -0,0 +1,65 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->isolatedMarginTransfer('', 'BNBUSDT', 'SPOT', 'ISOLATED_MARGIN', 1.01); + } + + public function testIsolatedMarginTransferThrowsExceptionWithoutSymbol() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->isolatedMarginTransfer('BTC', '', 'SPOT', 'ISOLATED_MARGIN', 1.01); + } + + public function testIsolatedMarginTransferThrowsExceptionWithoutTransFrom() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->isolatedMarginTransfer('BTC', 'BNBUSDT', '', 'ISOLATED_MARGIN', 1.01); + } + + public function testIsolatedMarginTransferThrowsExceptionWithoutTransTo() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->isolatedMarginTransfer('BTC', 'BNBUSDT', 'SPOT', '', 1.01); + } + + public function testIsolatedMarginTransfer() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/isolated/transfer')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'asset' => 'BTC', + 'symbol' => 'BNBUSDT', + 'transFrom' => 'SPOT', + 'transTo' => 'ISOLATED_MARGIN', + 'amount' => '1.01', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->isolatedMarginTransfer('BTC', 'BNBUSDT', 'SPOT', 'ISOLATED_MARGIN', 1.01, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginAccountTest.php b/tests/spot/margin/MarginAccountTest.php new file mode 100644 index 0000000..1143430 --- /dev/null +++ b/tests/spot/margin/MarginAccountTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/account')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginAccount([ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginAllAssetsTest.php b/tests/spot/margin/MarginAllAssetsTest.php new file mode 100644 index 0000000..eee1cc8 --- /dev/null +++ b/tests/spot/margin/MarginAllAssetsTest.php @@ -0,0 +1,30 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/allAssets')) + ->withMethod('GET') + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginAllAssets(); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginAllOCOOrderTest.php b/tests/spot/margin/MarginAllOCOOrderTest.php new file mode 100644 index 0000000..c066868 --- /dev/null +++ b/tests/spot/margin/MarginAllOCOOrderTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/allOrderList')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginAllOcoOrder([ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginAllOrdersTest.php b/tests/spot/margin/MarginAllOrdersTest.php new file mode 100644 index 0000000..7e1b94f --- /dev/null +++ b/tests/spot/margin/MarginAllOrdersTest.php @@ -0,0 +1,45 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->marginAllOrders(''); + } + + public function testMarginAllOrders() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/allOrders')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'limit' => '500', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginAllOrders('BNBUSDT', [ + 'limit' => 500, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginAllPairsTest.php b/tests/spot/margin/MarginAllPairsTest.php new file mode 100644 index 0000000..a97ecfb --- /dev/null +++ b/tests/spot/margin/MarginAllPairsTest.php @@ -0,0 +1,30 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/allPairs')) + ->withMethod('GET') + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginAllPairs(); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginAssetTest.php b/tests/spot/margin/MarginAssetTest.php new file mode 100644 index 0000000..655ac3d --- /dev/null +++ b/tests/spot/margin/MarginAssetTest.php @@ -0,0 +1,40 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->marginAsset(''); + } + + public function testMarginAsset() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/asset')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'asset' => 'BTC' + ])) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginAsset('BTC'); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginBorrowTest.php b/tests/spot/margin/MarginBorrowTest.php new file mode 100644 index 0000000..7e42764 --- /dev/null +++ b/tests/spot/margin/MarginBorrowTest.php @@ -0,0 +1,46 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->marginBorrow('', 1.01); + } + + public function testMarginBorrow() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/loan')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'asset' => 'BTC', + 'symbol' => 'BNBUSDT', + 'amount' => '1.01', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginBorrow('BTC', 1.01, [ + 'symbol' => 'BNBUSDT', + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginCancelOcoOrderTest.php b/tests/spot/margin/MarginCancelOcoOrderTest.php new file mode 100644 index 0000000..826b846 --- /dev/null +++ b/tests/spot/margin/MarginCancelOcoOrderTest.php @@ -0,0 +1,45 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->marginCancelOcoOrder(''); + } + + public function testMarginCancelOcoOrder() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/orderList')) + ->withMethod('DELETE') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'orderListId' => '10000', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginCancelOcoOrder('BNBUSDT', [ + 'orderListId' => 10000, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginCancelOpenOrdersTest.php b/tests/spot/margin/MarginCancelOpenOrdersTest.php new file mode 100644 index 0000000..a8821fe --- /dev/null +++ b/tests/spot/margin/MarginCancelOpenOrdersTest.php @@ -0,0 +1,43 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->marginCancelOpenOrders(''); + } + + public function testMarginCancelOpenOrders() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/openOrders')) + ->withMethod('DELETE') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginCancelOpenOrders('BNBUSDT', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginCancelOrderTest.php b/tests/spot/margin/MarginCancelOrderTest.php new file mode 100644 index 0000000..5699b79 --- /dev/null +++ b/tests/spot/margin/MarginCancelOrderTest.php @@ -0,0 +1,45 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->marginCancelOrder(''); + } + + public function testMarginCancelOrder() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/order')) + ->withMethod('DELETE') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'orderId' => '10', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginCancelOrder('BNBUSDT', [ + 'orderId' => 10, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginFeeDataTest.php b/tests/spot/margin/MarginFeeDataTest.php new file mode 100644 index 0000000..ddd0c38 --- /dev/null +++ b/tests/spot/margin/MarginFeeDataTest.php @@ -0,0 +1,37 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/crossMarginData')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'coin' => 'BNB', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginFeeData([ + 'coin' => 'BNB', + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginForceLiquidationRecordTest.php b/tests/spot/margin/MarginForceLiquidationRecordTest.php new file mode 100644 index 0000000..09ac6ea --- /dev/null +++ b/tests/spot/margin/MarginForceLiquidationRecordTest.php @@ -0,0 +1,39 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/forceLiquidationRec')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'current' => '1', + 'size' => '100', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginForceLiquidationRecord([ + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginInterestHistoryTest.php b/tests/spot/margin/MarginInterestHistoryTest.php new file mode 100644 index 0000000..37fb08d --- /dev/null +++ b/tests/spot/margin/MarginInterestHistoryTest.php @@ -0,0 +1,41 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/interestHistory')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'asset' => 'BNB', + 'current' => '1', + 'size' => '100', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginInterestHistory([ + 'asset' => 'BNB', + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginInterestRateHistoryTest.php b/tests/spot/margin/MarginInterestRateHistoryTest.php new file mode 100644 index 0000000..0c518a7 --- /dev/null +++ b/tests/spot/margin/MarginInterestRateHistoryTest.php @@ -0,0 +1,43 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->marginInterestRateHistory(''); + } + + public function testMarginInterestRateHistory() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/interestRateHistory')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'asset' => 'BTC', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginInterestRateHistory('BTC', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginLoanRecordTest.php b/tests/spot/margin/MarginLoanRecordTest.php new file mode 100644 index 0000000..9e00c72 --- /dev/null +++ b/tests/spot/margin/MarginLoanRecordTest.php @@ -0,0 +1,49 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->marginLoanRecord(''); + } + + public function testMarginLoanRecord() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/loan')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'asset' => 'BTC', + 'txId' => '123456789', + 'current' => '1', + 'size' => '100', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginLoanRecord('BTC', [ + 'txId' => 123456789, + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginMaxBorrowableTest.php b/tests/spot/margin/MarginMaxBorrowableTest.php new file mode 100644 index 0000000..042442b --- /dev/null +++ b/tests/spot/margin/MarginMaxBorrowableTest.php @@ -0,0 +1,43 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->marginMaxBorrowable(''); + } + + public function testMarginMaxBorrowable() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/maxBorrowable')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'asset' => 'BTC', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginMaxBorrowable('BTC', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginMaxTransferableTest.php b/tests/spot/margin/MarginMaxTransferableTest.php new file mode 100644 index 0000000..96aa7ba --- /dev/null +++ b/tests/spot/margin/MarginMaxTransferableTest.php @@ -0,0 +1,43 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->marginMaxTransferable(''); + } + + public function testMarginMaxTransferable() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/maxTransferable')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'asset' => 'BTC', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginMaxTransferable('BTC', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginMyTradesTest.php b/tests/spot/margin/MarginMyTradesTest.php new file mode 100644 index 0000000..f2c88e6 --- /dev/null +++ b/tests/spot/margin/MarginMyTradesTest.php @@ -0,0 +1,45 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->marginMyTrades(''); + } + + public function testMarginMyTrades() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/myTrades')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'limit' => '500', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginMyTrades('BNBUSDT', [ + 'limit' => 500, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginNewOcoOrderTest.php b/tests/spot/margin/MarginNewOcoOrderTest.php new file mode 100644 index 0000000..a9f85fb --- /dev/null +++ b/tests/spot/margin/MarginNewOcoOrderTest.php @@ -0,0 +1,57 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->marginNewOcoOrder('', 'SELL', 0.1, 400.15, 390.3); + } + + public function testMarginNewOcoOrderThrowsExceptionWithoutSide() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->marginNewOcoOrder('BNBUSDT', '', 0.1, 400.15, 390.3); + } + + public function testMarginNewOcoOrder() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/order/oco')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'side' => 'SELL', + 'quantity' => '0.1', + 'price' => '400.15', + 'stopPrice' => '390.3', + 'stopLimitPrice' => '290', + 'stopLimitTimeInForce' => 'GTC', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginNewOcoOrder('BNBUSDT', 'SELL', 0.1, 400.15, 390.3, [ + 'stopLimitPrice' => 290, + 'stopLimitTimeInForce' => 'GTC', + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginNewOrderTest.php b/tests/spot/margin/MarginNewOrderTest.php new file mode 100644 index 0000000..5b896f9 --- /dev/null +++ b/tests/spot/margin/MarginNewOrderTest.php @@ -0,0 +1,65 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->marginNewOrder('', 'SELL', 'MARKET'); + } + + public function testMarginNewOrderThrowsExceptionWithoutSide() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->marginNewOrder('BNBUSDT', '', 'MARKET'); + } + + public function testMarginNewOrderThrowsExceptionWithoutType() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->marginNewOrder('BNBUSDT', 'SELL', ''); + } + + public function testMarginNewOrder() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/order')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'side' => 'SELL', + 'type' => 'MARKET', + 'quantity' => '1.01', + 'price' => '10', + 'stopPrice' => '20.01', + 'timeInForce' => 'GTC', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginNewOrder('BNBUSDT', 'SELL', 'MARKET', [ + 'quantity' => 1.01, + 'price' => 10, + 'stopPrice' => 20.01, + 'timeInForce' => 'GTC', + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginOCOOrderTest.php b/tests/spot/margin/MarginOCOOrderTest.php new file mode 100644 index 0000000..8d10379 --- /dev/null +++ b/tests/spot/margin/MarginOCOOrderTest.php @@ -0,0 +1,39 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/orderList')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'orderListId' => '27', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginOcoOrder([ + 'symbol' => 'BNBUSDT', + 'orderListId' => 27, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginOpenOCOOrderTest.php b/tests/spot/margin/MarginOpenOCOOrderTest.php new file mode 100644 index 0000000..57af50a --- /dev/null +++ b/tests/spot/margin/MarginOpenOCOOrderTest.php @@ -0,0 +1,39 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/openOrderList')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'isIsolated' => 'TRUE', + 'symbol' => 'BNBUSDT', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginOpenOcoOrder([ + 'isIsolated' => 'TRUE', + 'symbol' => 'BNBUSDT', + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginOpenOrdersTest.php b/tests/spot/margin/MarginOpenOrdersTest.php new file mode 100644 index 0000000..28dd3dd --- /dev/null +++ b/tests/spot/margin/MarginOpenOrdersTest.php @@ -0,0 +1,37 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/openOrders')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginOpenOrders([ + 'symbol' => 'BNBUSDT', + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginOrderCountUsageTest.php b/tests/spot/margin/MarginOrderCountUsageTest.php new file mode 100644 index 0000000..4c6a979 --- /dev/null +++ b/tests/spot/margin/MarginOrderCountUsageTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/rateLimit/order')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginOrderCountUsage([ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginOrderTest.php b/tests/spot/margin/MarginOrderTest.php new file mode 100644 index 0000000..dcbaa16 --- /dev/null +++ b/tests/spot/margin/MarginOrderTest.php @@ -0,0 +1,45 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->marginOrder(''); + } + + public function testMarginOrder() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/order')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'orderId' => '213205622', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginOrder('BNBUSDT', [ + 'orderId' => 213205622, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginPairTest.php b/tests/spot/margin/MarginPairTest.php new file mode 100644 index 0000000..a2acc85 --- /dev/null +++ b/tests/spot/margin/MarginPairTest.php @@ -0,0 +1,40 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->marginPair(''); + } + + public function testMarginPair() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/pair')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT' + ])) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginPair('BNBUSDT'); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginPriceIndexTest.php b/tests/spot/margin/MarginPriceIndexTest.php new file mode 100644 index 0000000..430cf0f --- /dev/null +++ b/tests/spot/margin/MarginPriceIndexTest.php @@ -0,0 +1,40 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->marginPriceIndex(''); + } + + public function testMarginPriceIndex() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/priceIndex')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT' + ])) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginPriceIndex('BNBUSDT'); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginRepayRecordTest.php b/tests/spot/margin/MarginRepayRecordTest.php new file mode 100644 index 0000000..1acdca8 --- /dev/null +++ b/tests/spot/margin/MarginRepayRecordTest.php @@ -0,0 +1,49 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->marginRepayRecord(''); + } + + public function testMarginRepayRecord() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/repay')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'asset' => 'BTC', + 'txId' => '2970933056', + 'current' => '1', + 'size' => '100', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginRepayRecord('BTC', [ + 'txId' => 2970933056, + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginRepayTest.php b/tests/spot/margin/MarginRepayTest.php new file mode 100644 index 0000000..fe7c342 --- /dev/null +++ b/tests/spot/margin/MarginRepayTest.php @@ -0,0 +1,46 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->marginRepay('', 1.01); + } + + public function testMarginRepay() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/repay')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'asset' => 'BTC', + 'symbol' => 'BNBUSDT', + 'amount' => '1.01', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginRepay('BTC', 1.01, [ + 'symbol' => 'BNBUSDT', + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginTransferHistoryTest.php b/tests/spot/margin/MarginTransferHistoryTest.php new file mode 100644 index 0000000..3f26a56 --- /dev/null +++ b/tests/spot/margin/MarginTransferHistoryTest.php @@ -0,0 +1,41 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/transfer')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'asset' => 'BNB', + 'current' => '1', + 'size' => '100', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginTransferHistory([ + 'asset' => 'BNB', + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginTransferTest.php b/tests/spot/margin/MarginTransferTest.php new file mode 100644 index 0000000..7adb0dc --- /dev/null +++ b/tests/spot/margin/MarginTransferTest.php @@ -0,0 +1,45 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->marginTransfer('', 1.01, 1); + } + + public function testMarginTransfer() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/transfer')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'asset' => 'BTC', + 'amount' => '1.01', + 'type' => '1', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginTransfer('BTC', 1.01, 1, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/ToggleBNBBurnTest.php b/tests/spot/margin/ToggleBNBBurnTest.php new file mode 100644 index 0000000..7c0355e --- /dev/null +++ b/tests/spot/margin/ToggleBNBBurnTest.php @@ -0,0 +1,39 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/bnbBurn')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'spotBNBBurn' => 'true', + 'interestBNBBurn' => 'false', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->toggleBnbBurn([ + 'spotBNBBurn' => 'true', + 'interestBNBBurn' => 'false', + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/marginstream/MarginCloseListenKeyTest.php b/tests/spot/marginstream/MarginCloseListenKeyTest.php new file mode 100644 index 0000000..12a3381 --- /dev/null +++ b/tests/spot/marginstream/MarginCloseListenKeyTest.php @@ -0,0 +1,40 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->marginCloseListenKey(''); + } + + public function testMarginCloseListenKey() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/userDataStream')) + ->withMethod('DELETE') + ->withQueryParams(new Expect\ArrayEquals([ + 'listenKey' => 'listen-key' + ])) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginCloseListenKey('listen-key'); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/marginstream/MarginNewListenKeyTest.php b/tests/spot/marginstream/MarginNewListenKeyTest.php new file mode 100644 index 0000000..da699fd --- /dev/null +++ b/tests/spot/marginstream/MarginNewListenKeyTest.php @@ -0,0 +1,30 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/userDataStream')) + ->withMethod('POST') + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginNewListenKey(); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/marginstream/MarginRenewListenKeyTest.php b/tests/spot/marginstream/MarginRenewListenKeyTest.php new file mode 100644 index 0000000..2280662 --- /dev/null +++ b/tests/spot/marginstream/MarginRenewListenKeyTest.php @@ -0,0 +1,40 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->marginRenewListenKey(''); + } + + public function testMarginRenewListenKey() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/userDataStream')) + ->withMethod('PUT') + ->withQueryParams(new Expect\ArrayEquals([ + 'listenKey' => 'listen-key' + ])) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginRenewListenKey('listen-key'); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/market/AggTradesTest.php b/tests/spot/market/AggTradesTest.php new file mode 100644 index 0000000..0d54d65 --- /dev/null +++ b/tests/spot/market/AggTradesTest.php @@ -0,0 +1,49 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->aggTrades(''); + } + + public function testAggTrades() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/aggTrades')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'fromId' => '123', + 'startTime' => '1640995200000', + 'endTime' => '1640995200000', + 'limit' => '500' + ])) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->aggTrades('BNBUSDT', [ + 'fromId' => 123, + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'limit' => 500 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/market/AvgPriceTest.php b/tests/spot/market/AvgPriceTest.php new file mode 100644 index 0000000..cb3653c --- /dev/null +++ b/tests/spot/market/AvgPriceTest.php @@ -0,0 +1,40 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->avgPrice(''); + } + + public function testAvgPrice() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/avgPrice')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT' + ])) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->avgPrice('BNBUSDT'); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/market/BookTickerTest.php b/tests/spot/market/BookTickerTest.php new file mode 100644 index 0000000..ae3140f --- /dev/null +++ b/tests/spot/market/BookTickerTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/ticker/bookTicker')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT' + ])) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->bookTicker([ + 'symbol' => 'BNBUSDT' + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/market/DepthTest.php b/tests/spot/market/DepthTest.php new file mode 100644 index 0000000..37e631a --- /dev/null +++ b/tests/spot/market/DepthTest.php @@ -0,0 +1,43 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->depth(''); + } + + public function testDepth() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/depth')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'limit' => '100' + ])) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->depth('BNBUSDT', [ + 'limit' => 100 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/market/ExchangeInfoTest.php b/tests/spot/market/ExchangeInfoTest.php new file mode 100644 index 0000000..f0f39b0 --- /dev/null +++ b/tests/spot/market/ExchangeInfoTest.php @@ -0,0 +1,37 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/exchangeInfo')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'symbols' => '["BTCUSDT","BNBBTC"]' + ])) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->exchangeInfo([ + 'symbol' => 'BNBUSDT', + 'symbols' => '["BTCUSDT","BNBBTC"]' + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/market/HistoricalTradesTest.php b/tests/spot/market/HistoricalTradesTest.php new file mode 100644 index 0000000..4b6b862 --- /dev/null +++ b/tests/spot/market/HistoricalTradesTest.php @@ -0,0 +1,45 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->historicalTrades(''); + } + + public function testHistoricalTrades() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/historicalTrades')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'limit' => '500', + 'fromId' => '123' + ])) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->historicalTrades('BNBUSDT', [ + 'limit' => 500, + 'fromId' => 123 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/market/KlinesTest.php b/tests/spot/market/KlinesTest.php new file mode 100644 index 0000000..32a541d --- /dev/null +++ b/tests/spot/market/KlinesTest.php @@ -0,0 +1,54 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->klines('', '1m'); + } + + public function testKlinesThrowsExceptionWithoutInterval() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->klines('BNBUSDT', ''); + } + + public function testKlines() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/klines')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'interval' => '1m', + 'startTime' => '1640995200000', + 'endTime' => '1640995200000', + 'limit' => '500' + ])) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->klines('BNBUSDT', '1m', [ + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'limit' => 500 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/market/PingTest.php b/tests/spot/market/PingTest.php new file mode 100644 index 0000000..5cb7c26 --- /dev/null +++ b/tests/spot/market/PingTest.php @@ -0,0 +1,30 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/ping')) + ->withMethod('GET') + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->ping(); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/market/Ticker24hrTest.php b/tests/spot/market/Ticker24hrTest.php new file mode 100644 index 0000000..2248f1f --- /dev/null +++ b/tests/spot/market/Ticker24hrTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/ticker/24hr')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT' + ])) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->ticker24hr([ + 'symbol' => 'BNBUSDT' + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/market/TickerPriceTest.php b/tests/spot/market/TickerPriceTest.php new file mode 100644 index 0000000..a45631e --- /dev/null +++ b/tests/spot/market/TickerPriceTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/ticker/price')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT' + ])) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->tickerPrice([ + 'symbol' => 'BNBUSDT' + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/market/TimeTest.php b/tests/spot/market/TimeTest.php new file mode 100644 index 0000000..4f288c4 --- /dev/null +++ b/tests/spot/market/TimeTest.php @@ -0,0 +1,30 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/time')) + ->withMethod('GET') + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->time(); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/market/TradesTest.php b/tests/spot/market/TradesTest.php new file mode 100644 index 0000000..2ea70bc --- /dev/null +++ b/tests/spot/market/TradesTest.php @@ -0,0 +1,43 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->trades(''); + } + + public function testTrades() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/trades')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'limit' => '500' + ])) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->trades('BNBUSDT', [ + 'limit' => 500 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/mining/MiningAccountListTest.php b/tests/spot/mining/MiningAccountListTest.php new file mode 100644 index 0000000..ad5ae8b --- /dev/null +++ b/tests/spot/mining/MiningAccountListTest.php @@ -0,0 +1,50 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->miningAccountList('', 'username'); + } + + public function testMiningAccountListThrowsExceptionWithoutUserName() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->miningAccountList('sha256', ''); + } + + public function testMiningAccountList() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/mining/statistics/user/list')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'algo' => 'sha256', + 'userName' => 'username', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->miningAccountList('sha256', 'username', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/mining/MiningAlgoListTest.php b/tests/spot/mining/MiningAlgoListTest.php new file mode 100644 index 0000000..be6f395 --- /dev/null +++ b/tests/spot/mining/MiningAlgoListTest.php @@ -0,0 +1,30 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/mining/pub/algoList')) + ->withMethod('GET') + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->miningAlgoList(); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/mining/MiningCancelConfigTest.php b/tests/spot/mining/MiningCancelConfigTest.php new file mode 100644 index 0000000..fe25269 --- /dev/null +++ b/tests/spot/mining/MiningCancelConfigTest.php @@ -0,0 +1,44 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->miningCancelConfig(168, ''); + } + + public function testMiningCancelConfig() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/mining/hash-transfer/config/cancel')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'configId' => '168', + 'userName' => 'username', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->miningCancelConfig(168, 'username', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/mining/MiningCoinListTest.php b/tests/spot/mining/MiningCoinListTest.php new file mode 100644 index 0000000..50e4ab0 --- /dev/null +++ b/tests/spot/mining/MiningCoinListTest.php @@ -0,0 +1,30 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/mining/pub/coinList')) + ->withMethod('GET') + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->miningCoinList(); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/mining/MiningEarningTest.php b/tests/spot/mining/MiningEarningTest.php new file mode 100644 index 0000000..8af7cf8 --- /dev/null +++ b/tests/spot/mining/MiningEarningTest.php @@ -0,0 +1,43 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->miningEarning(''); + } + + public function testMiningEarning() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/mining/payment/uid')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'algo' => 'sha256', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->miningEarning('sha256', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/mining/MiningExtraBonusListTest.php b/tests/spot/mining/MiningExtraBonusListTest.php new file mode 100644 index 0000000..5235fa4 --- /dev/null +++ b/tests/spot/mining/MiningExtraBonusListTest.php @@ -0,0 +1,60 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->miningExtraBonusList('', 'username'); + } + + public function testMiningExtraBonusListThrowsExceptionWithoutUserName() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->miningExtraBonusList('sha256', ''); + } + + public function testMiningExtraBonusList() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/mining/payment/other')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'algo' => 'sha256', + 'userName' => 'username', + 'coin' => 'BNB', + 'startDate' => '1640995200000', + 'endDate' => '1640995200000', + 'pageIndex' => '2', + 'pageSize' => '20', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->miningExtraBonusList('sha256', 'username', [ + 'coin' => 'BNB', + 'startDate' => 1640995200000, + 'endDate' => 1640995200000, + 'pageIndex' => 2, + 'pageSize' => 20, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/mining/MiningHashrateResaleDetailsTest.php b/tests/spot/mining/MiningHashrateResaleDetailsTest.php new file mode 100644 index 0000000..ffad310 --- /dev/null +++ b/tests/spot/mining/MiningHashrateResaleDetailsTest.php @@ -0,0 +1,54 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->miningHashrateResaleDetails('', 'username'); + } + + public function testMiningHashrateResaleDetailsThrowsExceptionWithoutUserName() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->miningHashrateResaleDetails('168', ''); + } + + public function testMiningHashrateResaleDetails() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/mining/hash-transfer/profit/details')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'configId' => '168', + 'userName' => 'username', + 'pageIndex' => '2', + 'pageSize' => '20', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->miningHashrateResaleDetails('168', 'username', [ + 'pageIndex' => 2, + 'pageSize' => 20, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/mining/MiningHashrateResaleListTest.php b/tests/spot/mining/MiningHashrateResaleListTest.php new file mode 100644 index 0000000..8b568e1 --- /dev/null +++ b/tests/spot/mining/MiningHashrateResaleListTest.php @@ -0,0 +1,39 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/mining/hash-transfer/config/details/list')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'pageIndex' => '2', + 'pageSize' => '20', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->miningHashrateResaleList([ + 'pageIndex' => 2, + 'pageSize' => 20, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/mining/MiningHashrateResaleRequestTest.php b/tests/spot/mining/MiningHashrateResaleRequestTest.php new file mode 100644 index 0000000..3196d96 --- /dev/null +++ b/tests/spot/mining/MiningHashrateResaleRequestTest.php @@ -0,0 +1,62 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->miningHashrateResaleRequest('', 'sha256', 'username', 100000000); + } + + public function testMiningHashrateResaleRequestThrowsExceptionWithoutAlgo() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->miningHashrateResaleRequest('username', '', 'username', 100000000); + } + + public function testMiningHashrateResaleRequestThrowsExceptionWithoutToPoolUser() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->miningHashrateResaleRequest('username', 'sha256', '', 100000000); + } + + public function testMiningHashrateResaleRequest() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/mining/hash-transfer/config')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'userName' => 'username', + 'algo' => 'sha256', + 'startDate' => '1640995200000', + 'endDate' => '1640995200000', + 'toPoolUser' => 'username', + 'hashRate' => '100000000', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->miningHashrateResaleRequest('username', 'sha256', 'username', 100000000, [ + 'startDate' => 1640995200000, + 'endDate' => 1640995200000, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/mining/MiningStatisticsListTest.php b/tests/spot/mining/MiningStatisticsListTest.php new file mode 100644 index 0000000..f664495 --- /dev/null +++ b/tests/spot/mining/MiningStatisticsListTest.php @@ -0,0 +1,50 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->miningStatisticsList('', 'username'); + } + + public function testMiningStatisticsListThrowsExceptionWithoutUserName() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->miningStatisticsList('sha256', ''); + } + + public function testMiningStatisticsList() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/mining/statistics/user/status')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'algo' => 'sha256', + 'userName' => 'username', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->miningStatisticsList('sha256', 'username', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/mining/MiningWorkerListTest.php b/tests/spot/mining/MiningWorkerListTest.php new file mode 100644 index 0000000..8ab453a --- /dev/null +++ b/tests/spot/mining/MiningWorkerListTest.php @@ -0,0 +1,58 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->miningWorkerList('', 'username'); + } + + public function testMiningWorkerListThrowsExceptionWithoutUserName() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->miningWorkerList('sha256', ''); + } + + public function testMiningWorkerList() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/mining/worker/list')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'algo' => 'sha256', + 'userName' => 'username', + 'pageIndex' => '2', + 'sort' => '0', + 'sortColumn' => '1', + 'workerStatus' => '2', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->miningWorkerList('sha256', 'username', [ + 'pageIndex' => 2, + 'sort' => 0, + 'sortColumn' => 1, + 'workerStatus' => 2, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/mining/MiningWorkerTest.php b/tests/spot/mining/MiningWorkerTest.php new file mode 100644 index 0000000..9bc0f4a --- /dev/null +++ b/tests/spot/mining/MiningWorkerTest.php @@ -0,0 +1,57 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->miningWorker('', 'username', 'workername'); + } + + public function testMiningWorkerThrowsExceptionWithoutUserName() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->miningWorker('sha256', '', 'workername'); + } + + public function testMiningWorkerThrowsExceptionWithoutWorkerName() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->miningWorker('sha256', 'username', ''); + } + + public function testMiningWorker() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/mining/worker/detail')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'algo' => 'sha256', + 'userName' => 'username', + 'workerName' => 'workername', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->miningWorker('sha256', 'username', 'workername', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/mining/miningEarningListTest.php b/tests/spot/mining/miningEarningListTest.php new file mode 100644 index 0000000..9db0823 --- /dev/null +++ b/tests/spot/mining/miningEarningListTest.php @@ -0,0 +1,60 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->miningEarningList('', 'username'); + } + + public function testMiningEarningListThrowsExceptionWithoutUserName() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->miningEarningList('sha256', ''); + } + + public function testMiningEarningList() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/mining/payment/list')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'algo' => 'sha256', + 'userName' => 'username', + 'coin' => 'BNB', + 'startDate' => '1640995200000', + 'endDate' => '1640995200000', + 'pageIndex' => '2', + 'pageSize' => '20', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->miningEarningList('sha256', 'username', [ + 'coin' => 'BNB', + 'startDate' => 1640995200000, + 'endDate' => 1640995200000, + 'pageIndex' => 2, + 'pageSize' => 20, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/nft/NftDepositHistoryTest.php b/tests/spot/nft/NftDepositHistoryTest.php new file mode 100644 index 0000000..0829ab6 --- /dev/null +++ b/tests/spot/nft/NftDepositHistoryTest.php @@ -0,0 +1,43 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/nft/history/deposit')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'startTime' => '1640995200000', + 'endTime' => '1640995200000', + 'limit' => '50', + 'page' => '1', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->nftDepositHistory([ + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'limit' => 50, + 'page' => 1, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/nft/NftTransactionHistoryTest.php b/tests/spot/nft/NftTransactionHistoryTest.php new file mode 100644 index 0000000..f86f29f --- /dev/null +++ b/tests/spot/nft/NftTransactionHistoryTest.php @@ -0,0 +1,44 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/nft/history/transactions')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'orderType' => '1', + 'startTime' => '1640995200000', + 'endTime' => '1640995200000', + 'limit' => '50', + 'page' => '1', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->nftTransactionHistory(1, [ + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'limit' => 50, + 'page' => 1, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/nft/NftUserAssetTest.php b/tests/spot/nft/NftUserAssetTest.php new file mode 100644 index 0000000..0866cdf --- /dev/null +++ b/tests/spot/nft/NftUserAssetTest.php @@ -0,0 +1,39 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/nft/user/getAsset')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'limit' => '50', + 'page' => '1', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->nftUserAsset([ + 'limit' => 50, + 'page' => 1, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/nft/NftWithdrawHistoryTest.php b/tests/spot/nft/NftWithdrawHistoryTest.php new file mode 100644 index 0000000..b276fdc --- /dev/null +++ b/tests/spot/nft/NftWithdrawHistoryTest.php @@ -0,0 +1,43 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/nft/history/withdraw')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'startTime' => '1640995200000', + 'endTime' => '1640995200000', + 'limit' => '50', + 'page' => '1', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->nftWithdrawHistory([ + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'limit' => 50, + 'page' => 1, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/pay/PayTradeHistoryTest.php b/tests/spot/pay/PayTradeHistoryTest.php new file mode 100644 index 0000000..3412b31 --- /dev/null +++ b/tests/spot/pay/PayTradeHistoryTest.php @@ -0,0 +1,41 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/pay/transactions')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'startTimestamp' => '1640995200000', + 'endTimestamp' => '1640995200000', + 'limit' => '100', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->payTradeHistory([ + 'startTimestamp' => 1640995200000, + 'endTimestamp' => 1640995200000, + 'limit' => 100, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/portfoliomargin/PortfolioMarginAccountTest.php b/tests/spot/portfoliomargin/PortfolioMarginAccountTest.php new file mode 100644 index 0000000..b880113 --- /dev/null +++ b/tests/spot/portfoliomargin/PortfolioMarginAccountTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/portfolio/account')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->portfolioMarginAccount([ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/rebate/RebateSpotHistoryRecordsTest.php b/tests/spot/rebate/RebateSpotHistoryRecordsTest.php new file mode 100644 index 0000000..81ae0f7 --- /dev/null +++ b/tests/spot/rebate/RebateSpotHistoryRecordsTest.php @@ -0,0 +1,41 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/rebate/taxQuery')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'startTime' => '1640995200000', + 'endTime' => '1640995200000', + 'page' => '1', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->rebateSpotHistoryRecords([ + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'page' => 1, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/savings/SavingsAccountTest.php b/tests/spot/savings/SavingsAccountTest.php new file mode 100644 index 0000000..f740a86 --- /dev/null +++ b/tests/spot/savings/SavingsAccountTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/lending/union/account')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->savingsAccount([ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/savings/SavingsChangeDailyPositionTest.php b/tests/spot/savings/SavingsChangeDailyPositionTest.php new file mode 100644 index 0000000..7801494 --- /dev/null +++ b/tests/spot/savings/SavingsChangeDailyPositionTest.php @@ -0,0 +1,46 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->savingsChangeDailyPosition('', 1); + } + + public function testSavingsChangeDailyPosition() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/lending/positionChanged')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'projectId' => '1234', + 'lot' => '1', + 'positionId' => '100', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->savingsChangeDailyPosition('1234', 1, [ + 'positionId' => 100, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/savings/SavingsCustomizedPositionTest.php b/tests/spot/savings/SavingsCustomizedPositionTest.php new file mode 100644 index 0000000..dbe7756 --- /dev/null +++ b/tests/spot/savings/SavingsCustomizedPositionTest.php @@ -0,0 +1,43 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->savingsCustomizedPosition(''); + } + + public function testSavingsCustomizedPosition() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/lending/project/position/list')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'asset' => 'BTC', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->savingsCustomizedPosition('BTC', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/savings/SavingsFlexibleProductPositionTest.php b/tests/spot/savings/SavingsFlexibleProductPositionTest.php new file mode 100644 index 0000000..e41f470 --- /dev/null +++ b/tests/spot/savings/SavingsFlexibleProductPositionTest.php @@ -0,0 +1,43 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->savingsFlexibleProductPosition(''); + } + + public function testSavingsFlexibleProductPosition() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/lending/daily/token/position')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'asset' => 'BTC', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->savingsFlexibleProductPosition('BTC', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/savings/SavingsFlexibleProductsTest.php b/tests/spot/savings/SavingsFlexibleProductsTest.php new file mode 100644 index 0000000..01f66f7 --- /dev/null +++ b/tests/spot/savings/SavingsFlexibleProductsTest.php @@ -0,0 +1,39 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/lending/daily/product/list')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'current' => '1', + 'size' => '100', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->savingsFlexibleProducts([ + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/savings/SavingsFlexiblePurchaseQuotaTest.php b/tests/spot/savings/SavingsFlexiblePurchaseQuotaTest.php new file mode 100644 index 0000000..b83ab53 --- /dev/null +++ b/tests/spot/savings/SavingsFlexiblePurchaseQuotaTest.php @@ -0,0 +1,43 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->savingsFlexiblePurchaseQuota(''); + } + + public function testSavingsFlexiblePurchaseQuota() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/lending/daily/userLeftQuota')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'productId' => '1234', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->savingsFlexiblePurchaseQuota('1234', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/savings/SavingsFlexibleRedeemTest.php b/tests/spot/savings/SavingsFlexibleRedeemTest.php new file mode 100644 index 0000000..f2f0dc9 --- /dev/null +++ b/tests/spot/savings/SavingsFlexibleRedeemTest.php @@ -0,0 +1,51 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->savingsFlexibleRedeem('', 1.01, 'FAST'); + } + + public function testSavingsFlexibleRedeemThrowsExceptionWithoutType() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->savingsFlexibleRedeem('1234', 1.01, ''); + } + + public function testSavingsFlexibleRedeem() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/lending/daily/redeem')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'productId' => '1234', + 'amount' => '1.01', + 'type' => 'FAST', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->savingsFlexibleRedeem('1234', 1.01, 'FAST', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/savings/SavingsFlexibleRedemptionQuotaTest.php b/tests/spot/savings/SavingsFlexibleRedemptionQuotaTest.php new file mode 100644 index 0000000..d9e3e0f --- /dev/null +++ b/tests/spot/savings/SavingsFlexibleRedemptionQuotaTest.php @@ -0,0 +1,50 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->savingsFlexibleRedemptionQuota('', 'FAST'); + } + + public function testSavingsFlexibleRedemptionQuotaThrowsExceptionWithoutType() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->savingsFlexibleRedemptionQuota('1234', ''); + } + + public function testSavingsFlexibleRedemptionQuota() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/lending/daily/userRedemptionQuota')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'productId' => '1234', + 'type' => 'FAST', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->savingsFlexibleRedemptionQuota('1234', 'FAST', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/savings/SavingsInterestHistoryTest.php b/tests/spot/savings/SavingsInterestHistoryTest.php new file mode 100644 index 0000000..95c7916 --- /dev/null +++ b/tests/spot/savings/SavingsInterestHistoryTest.php @@ -0,0 +1,49 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->savingsInterestHistory(''); + } + + public function testSavingsInterestHistory() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/lending/union/interestHistory')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'lendingType' => 'DAILY', + 'asset' => 'BNB', + 'current' => '1', + 'size' => '100', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->savingsInterestHistory('DAILY', [ + 'asset' => 'BNB', + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/savings/SavingsProductListTest.php b/tests/spot/savings/SavingsProductListTest.php new file mode 100644 index 0000000..686b2c8 --- /dev/null +++ b/tests/spot/savings/SavingsProductListTest.php @@ -0,0 +1,49 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->savingsProductList(''); + } + + public function testSavingsProductList() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/lending/project/list')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'asset' => 'BNB', + 'type' => 'ACTIVITY', + 'current' => '1', + 'size' => '100', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->savingsProductList('ACTIVITY', [ + 'asset' => 'BNB', + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/savings/SavingsPurchaseCustomizedProjectTest.php b/tests/spot/savings/SavingsPurchaseCustomizedProjectTest.php new file mode 100644 index 0000000..5213dca --- /dev/null +++ b/tests/spot/savings/SavingsPurchaseCustomizedProjectTest.php @@ -0,0 +1,44 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->savingsPurchaseCustomizedProject('', 1); + } + + public function testSavingsPurchaseCustomizedProject() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/lending/customizedFixed/purchase')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'projectId' => '1234', + 'lot' => '1', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->savingsPurchaseCustomizedProject('1234', 1, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/savings/SavingsPurchaseFlexibleProductTest.php b/tests/spot/savings/SavingsPurchaseFlexibleProductTest.php new file mode 100644 index 0000000..5ad3f3e --- /dev/null +++ b/tests/spot/savings/SavingsPurchaseFlexibleProductTest.php @@ -0,0 +1,44 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->savingsPurchaseFlexibleProduct('', 1.01); + } + + public function testSavingsPurchaseFlexibleProduct() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/lending/daily/purchase')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'productId' => '1234', + 'amount' => '1.01', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->savingsPurchaseFlexibleProduct('1234', 1.01, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/savings/SavingsPurchaseRecordTest.php b/tests/spot/savings/SavingsPurchaseRecordTest.php new file mode 100644 index 0000000..1e1aea7 --- /dev/null +++ b/tests/spot/savings/SavingsPurchaseRecordTest.php @@ -0,0 +1,49 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->savingsPurchaseRecord(''); + } + + public function testSavingsPurchaseRecord() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/lending/union/purchaseRecord')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'lendingType' => 'DAILY', + 'asset' => 'BNB', + 'current' => '1', + 'size' => '100', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->savingsPurchaseRecord('DAILY', [ + 'asset' => 'BNB', + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/savings/SavingsRedemptionRecordTest.php b/tests/spot/savings/SavingsRedemptionRecordTest.php new file mode 100644 index 0000000..8b5fae6 --- /dev/null +++ b/tests/spot/savings/SavingsRedemptionRecordTest.php @@ -0,0 +1,49 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->savingsRedemptionRecord(''); + } + + public function testSavingsRedemptionRecord() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/lending/union/redemptionRecord')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'lendingType' => 'DAILY', + 'asset' => 'BNB', + 'current' => '1', + 'size' => '100', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->savingsRedemptionRecord('DAILY', [ + 'asset' => 'BNB', + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/staking/StakingHistoryTest.php b/tests/spot/staking/StakingHistoryTest.php new file mode 100644 index 0000000..f80301c --- /dev/null +++ b/tests/spot/staking/StakingHistoryTest.php @@ -0,0 +1,50 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->stakingHistory('', 'SUBSCRIPTION'); + } + + public function testStakingHistoryThrowsExceptionWithoutTxnType() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->stakingHistory('STAKING', ''); + } + + public function testStakingHistory() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/staking/stakingRecord')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'product' => 'STAKING', + 'txnType' => 'SUBSCRIPTION', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->stakingHistory('STAKING', 'SUBSCRIPTION', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/staking/StakingProductListTest.php b/tests/spot/staking/StakingProductListTest.php new file mode 100644 index 0000000..48d37f2 --- /dev/null +++ b/tests/spot/staking/StakingProductListTest.php @@ -0,0 +1,43 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->stakingProductList(''); + } + + public function testStakingProductList() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/staking/productList')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'product' => 'STAKING', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->stakingProductList('STAKING', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/staking/StakingProductPositionTest.php b/tests/spot/staking/StakingProductPositionTest.php new file mode 100644 index 0000000..0871ddc --- /dev/null +++ b/tests/spot/staking/StakingProductPositionTest.php @@ -0,0 +1,43 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->stakingProductPosition(''); + } + + public function testStakingProductPosition() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/staking/position')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'product' => 'STAKING', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->stakingProductPosition('STAKING', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/staking/StakingProductQuotaTest.php b/tests/spot/staking/StakingProductQuotaTest.php new file mode 100644 index 0000000..4b1e3cd --- /dev/null +++ b/tests/spot/staking/StakingProductQuotaTest.php @@ -0,0 +1,49 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->stakingProductQuota('', 'Axs*90'); + } + + public function testStakingProductQuotaThrowsExceptionWithoutProductId() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->stakingProductQuota('STAKING', ''); + } + + public function testStakingProductQuota() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/staking/personalLeftQuota')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'product' => 'STAKING', + 'productId' => 'Axs*90' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->stakingProductQuota('STAKING', 'Axs*90', [ + + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/staking/StakingPurchaseProductTest.php b/tests/spot/staking/StakingPurchaseProductTest.php new file mode 100644 index 0000000..1ab8df4 --- /dev/null +++ b/tests/spot/staking/StakingPurchaseProductTest.php @@ -0,0 +1,51 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->stakingPurchaseProduct('', 'Axs*90', 10.1); + } + + public function testStakingPurchaseProductThrowsExceptionWithoutProductId() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->stakingPurchaseProduct('STAKING', '', 10.1); + } + + public function testStakingPurchaseProduct() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/staking/purchase')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'product' => 'STAKING', + 'productId' => 'Axs*90', + 'amount' => '10.1', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->stakingPurchaseProduct('STAKING', 'Axs*90', 10.1, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/staking/StakingRedeemProductTest.php b/tests/spot/staking/StakingRedeemProductTest.php new file mode 100644 index 0000000..942914d --- /dev/null +++ b/tests/spot/staking/StakingRedeemProductTest.php @@ -0,0 +1,50 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->stakingRedeemProduct('', 'Axs*90'); + } + + public function testStakingRedeemProductThrowsExceptionWithoutProductId() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->stakingRedeemProduct('STAKING', ''); + } + + public function testStakingRedeemProduct() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/staking/redeem')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'product' => 'STAKING', + 'productId' => 'Axs*90', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->stakingRedeemProduct('STAKING', 'Axs*90', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/staking/StakingSetAutoStakingTest.php b/tests/spot/staking/StakingSetAutoStakingTest.php new file mode 100644 index 0000000..35cb79d --- /dev/null +++ b/tests/spot/staking/StakingSetAutoStakingTest.php @@ -0,0 +1,57 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->stakingSetAutoStaking('', '1234', 'true'); + } + + public function testStakingSetAutoStakingThrowsExceptionWithoutPositionId() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->stakingSetAutoStaking('STAKING', '', 'true'); + } + + public function testStakingSetAutoStakingThrowsExceptionWithoutRenewable() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->stakingSetAutoStaking('STAKING', '1234', ''); + } + + public function testStakingSetAutoStaking() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/staking/setAutoStaking')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'product' => 'STAKING', + 'positionId' => '1234', + 'renewable' => 'true', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->stakingSetAutoStaking('STAKING', '1234', 'true', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/stream/CloseListenkeyTest.php b/tests/spot/stream/CloseListenkeyTest.php new file mode 100644 index 0000000..4b2bcf9 --- /dev/null +++ b/tests/spot/stream/CloseListenkeyTest.php @@ -0,0 +1,40 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->closeListenKey(''); + } + + public function testCloseListenKey() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/userDataStream')) + ->withMethod('DELETE') + ->withQueryParams(new Expect\ArrayEquals([ + 'listenKey' => 'listen-key' + ])) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->closeListenKey('listen-key'); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/stream/NewListenkeyTest.php b/tests/spot/stream/NewListenkeyTest.php new file mode 100644 index 0000000..fc8ce04 --- /dev/null +++ b/tests/spot/stream/NewListenkeyTest.php @@ -0,0 +1,30 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/userDataStream')) + ->withMethod('POST') + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->newListenKey(); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/stream/RenewListenkeyTest.php b/tests/spot/stream/RenewListenkeyTest.php new file mode 100644 index 0000000..1fce266 --- /dev/null +++ b/tests/spot/stream/RenewListenkeyTest.php @@ -0,0 +1,40 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->renewListenKey(''); + } + + public function testRenewListenKey() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/userDataStream')) + ->withMethod('PUT') + ->withQueryParams(new Expect\ArrayEquals([ + 'listenKey' => 'listen-key' + ])) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->renewListenKey('listen-key'); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/ManagedSubAccountDepositTest.php b/tests/spot/subaccount/ManagedSubAccountDepositTest.php new file mode 100644 index 0000000..cdd6571 --- /dev/null +++ b/tests/spot/subaccount/ManagedSubAccountDepositTest.php @@ -0,0 +1,51 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->managedSubAccountDeposit('', 'BTC', 1.01); + } + + public function testManagedSubAccountDepositThrowsExceptionWithoutAsset() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->managedSubAccountDeposit('testaccount@email.com', '', 1.01); + } + + public function testManagedSubAccountDeposit() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/managed-subaccount/deposit')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'toEmail' => 'testaccount@email.com', + 'asset' => 'BTC', + 'amount' => '1.01', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->managedSubAccountDeposit('testaccount@email.com', 'BTC', 1.01, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/ManagedSubaccountAssetDetailsTest.php b/tests/spot/subaccount/ManagedSubaccountAssetDetailsTest.php new file mode 100644 index 0000000..443fa01 --- /dev/null +++ b/tests/spot/subaccount/ManagedSubaccountAssetDetailsTest.php @@ -0,0 +1,43 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->managedSubAccountAssetDetails(''); + } + + public function testManagedSubAccountAssetDetails() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/managed-subaccount/asset')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'email' => 'testaccount@email.com', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->managedSubAccountAssetDetails('testaccount@email.com', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/ManagedSubaccountSnapshotTest.php b/tests/spot/subaccount/ManagedSubaccountSnapshotTest.php new file mode 100644 index 0000000..b049924 --- /dev/null +++ b/tests/spot/subaccount/ManagedSubaccountSnapshotTest.php @@ -0,0 +1,56 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->managedSubAccountSnapshot('', 'SPOT'); + } + + public function testManagedSubAccountSnapshotThrowsExceptionWithoutType() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->managedSubAccountSnapshot('testaccount@email.com', ''); + } + + public function testManagedSubAccountSnapshot() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/managed-subaccount/accountSnapshot')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'email' => 'testaccount@email.com', + 'type' => 'SPOT', + 'startTime' => '1640995200000', + 'endTime' => '1640995200000', + 'limit' => '123', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->managedSubAccountSnapshot('testaccount@email.com', 'SPOT', [ + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'limit' => 123, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/ManagedSubaccountWithdrawTest.php b/tests/spot/subaccount/ManagedSubaccountWithdrawTest.php new file mode 100644 index 0000000..a6d7b59 --- /dev/null +++ b/tests/spot/subaccount/ManagedSubaccountWithdrawTest.php @@ -0,0 +1,53 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->managedSubAccountWithdraw('', 'BTC', 1.01); + } + + public function testManagedSubAccountWithdrawThrowsExceptionWithoutAsset() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->managedSubAccountWithdraw('testaccount@email.com', '', 1.01); + } + + public function testManagedSubAccountWithdraw() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/managed-subaccount/withdraw')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'fromEmail' => 'testaccount@email.com', + 'asset' => 'BTC', + 'amount' => '1.01', + 'transferDate' => '1640995200000', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->managedSubAccountWithdraw('testaccount@email.com', 'BTC', 1.01, [ + 'transferDate' => 1640995200000, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubAccountAddIPListTest.php b/tests/spot/subaccount/SubAccountAddIPListTest.php new file mode 100644 index 0000000..c423c5c --- /dev/null +++ b/tests/spot/subaccount/SubAccountAddIPListTest.php @@ -0,0 +1,57 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountAddIpList('', 'subAccountApiKey', '000.000.000.000'); + } + + public function testSubAccountAddIpListThrowsExceptionWithoutSubAccountApiKey() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountAddIpList('testaccount@email.com', '', '000.000.000.000'); + } + + public function testSubAccountAddIpListThrowsExceptionWithoutIpAddress() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountAddIpList('testaccount@email.com', 'subAccountApiKey', ''); + } + + public function testSubAccountAddIpList() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/sub-account/subAccountApi/ipRestriction/ipList')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'email' => 'testaccount@email.com', + 'subAccountApiKey' => 'subAccountApiKey', + 'ipAddress' => '000.000.000.000', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountAddIpList('testaccount@email.com', 'subAccountApiKey', '000.000.000.000', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubAccountDeleteIPListTest.php b/tests/spot/subaccount/SubAccountDeleteIPListTest.php new file mode 100644 index 0000000..2d760db --- /dev/null +++ b/tests/spot/subaccount/SubAccountDeleteIPListTest.php @@ -0,0 +1,57 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountDeleteIpList('', 'subAccountApiKey', '000.000.000.000'); + } + + public function testSubAccountDeleteIpListThrowsExceptionWithoutSubAccountApiKey() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountDeleteIpList('testaccount@email.com', '', '000.000.000.000'); + } + + public function testSubAccountDeleteIpListThrowsExceptionWithoutIpAddress() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountDeleteIpList('testaccount@email.com', 'subAccountApiKey', ''); + } + + public function testSubAccountDeleteIpList() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/sub-account/subAccountApi/ipRestriction/ipList')) + ->withMethod('DELETE') + ->withQueryParams(new Expect\ArrayEquals([ + 'email' => 'testaccount@email.com', + 'subAccountApiKey' => 'subAccountApiKey', + 'ipAddress' => '000.000.000.000', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountDeleteIpList('testaccount@email.com', 'subAccountApiKey', '000.000.000.000', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubAccountDepositAddressTest.php b/tests/spot/subaccount/SubAccountDepositAddressTest.php new file mode 100644 index 0000000..2eb415a --- /dev/null +++ b/tests/spot/subaccount/SubAccountDepositAddressTest.php @@ -0,0 +1,52 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountDepositAddress('', 'BNB'); + } + + public function testSubAccountDepositAddressThrowsExceptionWithoutCoin() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountDepositAddress('testaccount@email.com', ''); + } + + public function testSubAccountDepositAddress() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/capital/deposit/subAddress')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'email' => 'testaccount@email.com', + 'coin' => 'BNB', + 'network' => 'BNB', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountDepositAddress('testaccount@email.com', 'BNB', [ + 'network' => 'BNB', + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubAccountDepositHistoryTest.php b/tests/spot/subaccount/SubAccountDepositHistoryTest.php new file mode 100644 index 0000000..c2dcc5b --- /dev/null +++ b/tests/spot/subaccount/SubAccountDepositHistoryTest.php @@ -0,0 +1,45 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountDepositHistory(''); + } + + public function testSubAccountDepositHistory() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/capital/deposit/subHisrec')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'email' => 'testaccount@email.com', + 'coin' => 'BNB', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountDepositHistory('testaccount@email.com', [ + 'coin' => 'BNB', + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubAccountEnableFuturesTest.php b/tests/spot/subaccount/SubAccountEnableFuturesTest.php new file mode 100644 index 0000000..0344be8 --- /dev/null +++ b/tests/spot/subaccount/SubAccountEnableFuturesTest.php @@ -0,0 +1,43 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountEnableFutures(''); + } + + public function testSubAccountEnableFutures() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/sub-account/futures/enable')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'email' => 'testaccount@email.com', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountEnableFutures('testaccount@email.com', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubAccountEnableLeverageTokenTest.php b/tests/spot/subaccount/SubAccountEnableLeverageTokenTest.php new file mode 100644 index 0000000..546f7d3 --- /dev/null +++ b/tests/spot/subaccount/SubAccountEnableLeverageTokenTest.php @@ -0,0 +1,44 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountEnableLeverageToken('', true); + } + + public function testSubAccountEnableLeverageToken() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/sub-account/blvt/enable')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'email' => 'testaccount@email.com', + 'enableBlvt' => 'true', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountEnableLeverageToken('testaccount@email.com', true, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubAccountEnableMarginTest.php b/tests/spot/subaccount/SubAccountEnableMarginTest.php new file mode 100644 index 0000000..4070843 --- /dev/null +++ b/tests/spot/subaccount/SubAccountEnableMarginTest.php @@ -0,0 +1,43 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountEnableMargin(''); + } + + public function testSubAccountEnableMargin() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/sub-account/margin/enable')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'email' => 'testaccount@email.com', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountEnableMargin('testaccount@email.com', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubAccountFuturesAccountSummaryTest.php b/tests/spot/subaccount/SubAccountFuturesAccountSummaryTest.php new file mode 100644 index 0000000..5597eff --- /dev/null +++ b/tests/spot/subaccount/SubAccountFuturesAccountSummaryTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/sub-account/futures/accountSummary')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountFuturesAccountSummary([ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubAccountFuturesAccountSummaryV2Test.php b/tests/spot/subaccount/SubAccountFuturesAccountSummaryV2Test.php new file mode 100644 index 0000000..f73b3c9 --- /dev/null +++ b/tests/spot/subaccount/SubAccountFuturesAccountSummaryV2Test.php @@ -0,0 +1,38 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v2/sub-account/futures/accountSummary')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'futuresType' => '1', + 'page' => '1', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountFuturesAccountSummaryV2(1, [ + 'page' => 1, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubAccountFuturesAccountTest.php b/tests/spot/subaccount/SubAccountFuturesAccountTest.php new file mode 100644 index 0000000..3ca7adc --- /dev/null +++ b/tests/spot/subaccount/SubAccountFuturesAccountTest.php @@ -0,0 +1,43 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountFuturesAccount(''); + } + + public function testSubAccountFuturesAccount() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/sub-account/futures/account')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'email' => 'testaccount@email.com', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountFuturesAccount('testaccount@email.com', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubAccountFuturesAccountV2Test.php b/tests/spot/subaccount/SubAccountFuturesAccountV2Test.php new file mode 100644 index 0000000..3bf765f --- /dev/null +++ b/tests/spot/subaccount/SubAccountFuturesAccountV2Test.php @@ -0,0 +1,44 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountFuturesAccountV2('', 1); + } + + public function testSubAccountFuturesAccountV2() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v2/sub-account/futures/account')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'email' => 'testaccount@email.com', + 'futuresType' => '1', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountFuturesAccountV2('testaccount@email.com', 1, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubAccountFuturesPositionRiskTest.php b/tests/spot/subaccount/SubAccountFuturesPositionRiskTest.php new file mode 100644 index 0000000..edfcd1d --- /dev/null +++ b/tests/spot/subaccount/SubAccountFuturesPositionRiskTest.php @@ -0,0 +1,43 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountFuturesPositionRisk(''); + } + + public function testSubAccountFuturesPositionRisk() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/sub-account/futures/positionRisk')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'email' => 'testaccount@email.com', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountFuturesPositionRisk('testaccount@email.com', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubAccountFuturesPositionRiskV2Test.php b/tests/spot/subaccount/SubAccountFuturesPositionRiskV2Test.php new file mode 100644 index 0000000..4f6a5d2 --- /dev/null +++ b/tests/spot/subaccount/SubAccountFuturesPositionRiskV2Test.php @@ -0,0 +1,44 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountFuturesPositionRiskV2('', 1); + } + + public function testSubAccountFuturesPositionRiskV2() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v2/sub-account/futures/positionRisk')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'email' => 'testaccount@email.com', + 'futuresType' => '1', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountFuturesPositionRiskV2('testaccount@email.com', 1, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubAccountFuturesTransferTest.php b/tests/spot/subaccount/SubAccountFuturesTransferTest.php new file mode 100644 index 0000000..9f401a6 --- /dev/null +++ b/tests/spot/subaccount/SubAccountFuturesTransferTest.php @@ -0,0 +1,52 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountFuturesTransfer('', 'BTC', 1.01, 1); + } + + public function testSubAccountFuturesTransferThrowsExceptionWithoutAsset() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountFuturesTransfer('testaccount@email.com', '', 1.01, 1); + } + + public function testSubAccountFuturesTransfer() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/sub-account/futures/transfer')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'email' => 'testaccount@email.com', + 'asset' => 'BTC', + 'amount' => '1.01', + 'type' => '1', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountFuturesTransfer('testaccount@email.com', 'BTC', 1.01, 1, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubAccountIPRestrictionTest.php b/tests/spot/subaccount/SubAccountIPRestrictionTest.php new file mode 100644 index 0000000..8294e74 --- /dev/null +++ b/tests/spot/subaccount/SubAccountIPRestrictionTest.php @@ -0,0 +1,50 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountIpRestriction('', 'subAccountApiKey'); + } + + public function testSubAccountIpRestrictionThrowsExceptionWithoutSubAccountApiKey() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountIpRestriction('testaccount@email.com', ''); + } + + public function testSubAccountIpRestriction() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/sub-account/subAccountApi/ipRestriction')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'email' => 'testaccount@email.com', + 'subAccountApiKey' => 'subAccountApiKey', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountIpRestriction('testaccount@email.com', 'subAccountApiKey', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubAccountListTest.php b/tests/spot/subaccount/SubAccountListTest.php new file mode 100644 index 0000000..fb3e0d2 --- /dev/null +++ b/tests/spot/subaccount/SubAccountListTest.php @@ -0,0 +1,39 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/sub-account/list')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'page' => '1', + 'limit' => '1', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountList([ + 'page' => 1, + 'limit' => 1, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubAccountMarginAccountSummaryTest.php b/tests/spot/subaccount/SubAccountMarginAccountSummaryTest.php new file mode 100644 index 0000000..0dde398 --- /dev/null +++ b/tests/spot/subaccount/SubAccountMarginAccountSummaryTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/sub-account/margin/accountSummary')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountMarginAccountSummary([ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubAccountMarginAccountTest.php b/tests/spot/subaccount/SubAccountMarginAccountTest.php new file mode 100644 index 0000000..ef8cca3 --- /dev/null +++ b/tests/spot/subaccount/SubAccountMarginAccountTest.php @@ -0,0 +1,43 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountMarginAccount(''); + } + + public function testSubAccountMarginAccount() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/sub-account/margin/account')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'email' => 'testaccount@email.com', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountMarginAccount('testaccount@email.com', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubAccountMarginTransferTest.php b/tests/spot/subaccount/SubAccountMarginTransferTest.php new file mode 100644 index 0000000..3923e57 --- /dev/null +++ b/tests/spot/subaccount/SubAccountMarginTransferTest.php @@ -0,0 +1,52 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountMarginTransfer('', 'BTC', 1.01, 1); + } + + public function testSubAccountMarginTransferThrowsExceptionWithoutAsset() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountMarginTransfer('testaccount@email.com', '', 1.01, 1); + } + + public function testSubAccountMarginTransfer() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/sub-account/margin/transfer')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'email' => 'testaccount@email.com', + 'asset' => 'BTC', + 'amount' => '1.01', + 'type' => '1', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountMarginTransfer('testaccount@email.com', 'BTC', 1.01, 1, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubAccountStatusTest.php b/tests/spot/subaccount/SubAccountStatusTest.php new file mode 100644 index 0000000..f04bc79 --- /dev/null +++ b/tests/spot/subaccount/SubAccountStatusTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/sub-account/status')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountStatus([ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubAccountToggleIPRestrictionTest.php b/tests/spot/subaccount/SubAccountToggleIPRestrictionTest.php new file mode 100644 index 0000000..78dc768 --- /dev/null +++ b/tests/spot/subaccount/SubAccountToggleIPRestrictionTest.php @@ -0,0 +1,51 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountToggleIpRestriction('', 'subAccountApiKey', true); + } + + public function testSubAccountToggleIpRestrictionThrowsExceptionWithoutSubAccountApiKey() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountToggleIpRestriction('testaccount@email.com', '', true); + } + + public function testSubAccountToggleIpRestriction() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/sub-account/subAccountApi/ipRestriction')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'email' => 'testaccount@email.com', + 'subAccountApiKey' => 'subAccountApiKey', + 'ipRestrict' => 'true', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountToggleIpRestriction('testaccount@email.com', 'subAccountApiKey', true, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubAccountTransferHistoryBySubAccountTest.php b/tests/spot/subaccount/SubAccountTransferHistoryBySubAccountTest.php new file mode 100644 index 0000000..7efc152 --- /dev/null +++ b/tests/spot/subaccount/SubAccountTransferHistoryBySubAccountTest.php @@ -0,0 +1,39 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/sub-account/transfer/subUserHistory')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'asset' => 'BNB', + 'limit' => '500', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountTransferHistoryBySubAccount([ + 'asset' => 'BNB', + 'limit' => 500, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubAccountTransferHistoryTest.php b/tests/spot/subaccount/SubAccountTransferHistoryTest.php new file mode 100644 index 0000000..f3daf6c --- /dev/null +++ b/tests/spot/subaccount/SubAccountTransferHistoryTest.php @@ -0,0 +1,39 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/sub-account/sub/transfer/history')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'page' => '1', + 'limit' => '1', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountTransferHistory([ + 'page' => 1, + 'limit' => 1, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubAccountTransferToMasterTest.php b/tests/spot/subaccount/SubAccountTransferToMasterTest.php new file mode 100644 index 0000000..0f2df5c --- /dev/null +++ b/tests/spot/subaccount/SubAccountTransferToMasterTest.php @@ -0,0 +1,44 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountTransferToMaster('', 1.01); + } + + public function testSubAccountTransferToMaster() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/sub-account/transfer/subToMaster')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'asset' => 'BTC', + 'amount' => '1.01', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountTransferToMaster('BTC', 1.01, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubAccountUniversalTransferHistoryTest.php b/tests/spot/subaccount/SubAccountUniversalTransferHistoryTest.php new file mode 100644 index 0000000..0b08e2d --- /dev/null +++ b/tests/spot/subaccount/SubAccountUniversalTransferHistoryTest.php @@ -0,0 +1,37 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/sub-account/universalTransfer')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'page' => '1', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountUniversalTransferHistory([ + 'page' => 1, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubAccountUniversalTransferTest.php b/tests/spot/subaccount/SubAccountUniversalTransferTest.php new file mode 100644 index 0000000..af71bf0 --- /dev/null +++ b/tests/spot/subaccount/SubAccountUniversalTransferTest.php @@ -0,0 +1,58 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountUniversalTransfer('', 'COIN_FUTURE', 'BTC', 1.01); + } + + public function testSubAccountUniversalTransferThrowsExceptionWithoutToAccountType() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountUniversalTransfer('SPOT', '', 'BTC', 1.01); + } + + public function testSubAccountUniversalTransferThrowsExceptionWithoutAsset() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountUniversalTransfer('SPOT', 'COIN_FUTURE', '', 1.01); + } + + public function testSubAccountUniversalTransfer() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/sub-account/universalTransfer')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'fromAccountType' => 'SPOT', + 'toAccountType' => 'COIN_FUTURE', + 'asset' => 'BTC', + 'amount' => '1.01', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountUniversalTransfer('SPOT', 'COIN_FUTURE', 'BTC', 1.01, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubaccountAssetsTest.php b/tests/spot/subaccount/SubaccountAssetsTest.php new file mode 100644 index 0000000..17f01a8 --- /dev/null +++ b/tests/spot/subaccount/SubaccountAssetsTest.php @@ -0,0 +1,43 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountAssets(''); + } + + public function testSubAccountAssets() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v3/sub-account/assets')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'email' => 'testaccount@email.com', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountAssets('testaccount@email.com', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubaccountCreateVirtualAccountTest.php b/tests/spot/subaccount/SubaccountCreateVirtualAccountTest.php new file mode 100644 index 0000000..c77960a --- /dev/null +++ b/tests/spot/subaccount/SubaccountCreateVirtualAccountTest.php @@ -0,0 +1,43 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountCreateVirtualAccount(''); + } + + public function testSubAccountCreateVirtualAccount() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/sub-account/virtualSubAccount')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'subAccountString' => 'testaccount', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountCreateVirtualAccount('testaccount', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubaccountFuturesAssetTransferHistoryTest.php b/tests/spot/subaccount/SubaccountFuturesAssetTransferHistoryTest.php new file mode 100644 index 0000000..ec9cb00 --- /dev/null +++ b/tests/spot/subaccount/SubaccountFuturesAssetTransferHistoryTest.php @@ -0,0 +1,52 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountFuturesAssetTransferHistory('', 2); + } + + public function testSubAccountFuturesAssetTransferHistory() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/sub-account/futures/internalTransfer')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'email' => 'testaccount@email.com', + 'futuresType' => '2', + 'startTime' => '1640995200000', + 'endTime' => '1640995200000', + 'page' => '1', + 'limit' => '123', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountFuturesAssetTransferHistory('testaccount@email.com', 2, [ + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'page' => 1, + 'limit' => 123, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubaccountFuturesAssetTransferTest.php b/tests/spot/subaccount/SubaccountFuturesAssetTransferTest.php new file mode 100644 index 0000000..42e200d --- /dev/null +++ b/tests/spot/subaccount/SubaccountFuturesAssetTransferTest.php @@ -0,0 +1,59 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountFuturesAssetTransfer('', 'testaccount2@email.com', 2, 'BTC', 1.01); + } + + public function testSubAccountFuturesAssetTransferThrowsExceptionWithoutToEmail() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountFuturesAssetTransfer('testaccount@email.com', '', 2, 'BTC', 1.01); + } + + public function testSubAccountFuturesAssetTransferThrowsExceptionWithoutAsset() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountFuturesAssetTransfer('testaccount@email.com', 'testaccount2@email.com', 2, '', 1.01); + } + + public function testSubAccountFuturesAssetTransfer() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/sub-account/futures/internalTransfer')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'fromEmail' => 'testaccount@email.com', + 'toEmail' => 'testaccount2@email.com', + 'futuresType' => '2', + 'asset' => 'BTC', + 'amount' => '1.01', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountFuturesAssetTransfer('testaccount@email.com', 'testaccount2@email.com', 2, 'BTC', 1.01, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubaccountSpotAssetsSummaryTest.php b/tests/spot/subaccount/SubaccountSpotAssetsSummaryTest.php new file mode 100644 index 0000000..dc076b7 --- /dev/null +++ b/tests/spot/subaccount/SubaccountSpotAssetsSummaryTest.php @@ -0,0 +1,41 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/sub-account/spotSummary')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'email' => 'testaccount@email.com', + 'page' => '1', + 'size' => '123', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountSpotAssetsSummary([ + 'email' => 'testaccount@email.com', + 'page' => 1, + 'size' => 123, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/subAccountTransferToSubAccountTest.php b/tests/spot/subaccount/subAccountTransferToSubAccountTest.php new file mode 100644 index 0000000..7706b5b --- /dev/null +++ b/tests/spot/subaccount/subAccountTransferToSubAccountTest.php @@ -0,0 +1,51 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountTransferToSubAccount('', 'BTC', 1.01); + } + + public function testSubAccountTransferToSubAccountThrowsExceptionWithoutAsset() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountTransferToSubAccount('testaccount@email.com', '', 1.01); + } + + public function testSubAccountTransferToSubAccount() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/sub-account/transfer/subToSub')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'toEmail' => 'testaccount@email.com', + 'asset' => 'BTC', + 'amount' => '1.01', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountTransferToSubAccount('testaccount@email.com', 'BTC', 1.01, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/trade/AccountTest.php b/tests/spot/trade/AccountTest.php new file mode 100644 index 0000000..d0ee22c --- /dev/null +++ b/tests/spot/trade/AccountTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/account')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->account([ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/trade/AllOrdersTest.php b/tests/spot/trade/AllOrdersTest.php new file mode 100644 index 0000000..4d9fd04 --- /dev/null +++ b/tests/spot/trade/AllOrdersTest.php @@ -0,0 +1,45 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->allOrders(''); + } + + public function testAllOrders() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/allOrders')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'limit' => '500', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->allOrders('BNBUSDT', [ + 'limit' => 500, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/trade/CancelOCOOrderTest.php b/tests/spot/trade/CancelOCOOrderTest.php new file mode 100644 index 0000000..0a63d71 --- /dev/null +++ b/tests/spot/trade/CancelOCOOrderTest.php @@ -0,0 +1,45 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->cancelOcoOrder(''); + } + + public function testCancelOcoOrder() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/orderList')) + ->withMethod('DELETE') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'orderListId' => '12', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->cancelOcoOrder('BNBUSDT', [ + 'orderListId' => 12, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/trade/CancelOpenOrdersTest.php b/tests/spot/trade/CancelOpenOrdersTest.php new file mode 100644 index 0000000..c9b8b9b --- /dev/null +++ b/tests/spot/trade/CancelOpenOrdersTest.php @@ -0,0 +1,43 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->cancelOpenOrders(''); + } + + public function testCancelOpenOrders() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/openOrders')) + ->withMethod('DELETE') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->cancelOpenOrders('BNBUSDT', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/trade/CancelOrderTest.php b/tests/spot/trade/CancelOrderTest.php new file mode 100644 index 0000000..e69534a --- /dev/null +++ b/tests/spot/trade/CancelOrderTest.php @@ -0,0 +1,45 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->cancelOrder(''); + } + + public function testCancelOrder() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/order')) + ->withMethod('DELETE') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'orderId' => '12', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->cancelOrder('BNBUSDT', [ + 'orderId' => 12, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/trade/GetOCOOrderTest.php b/tests/spot/trade/GetOCOOrderTest.php new file mode 100644 index 0000000..764bc34 --- /dev/null +++ b/tests/spot/trade/GetOCOOrderTest.php @@ -0,0 +1,37 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/orderList')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'orderListId' => '11', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->getOcoOrder([ + 'orderListId' => 11, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/trade/GetOCOOrdersTest.php b/tests/spot/trade/GetOCOOrdersTest.php new file mode 100644 index 0000000..71739f7 --- /dev/null +++ b/tests/spot/trade/GetOCOOrdersTest.php @@ -0,0 +1,39 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/allOrderList')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'fromId' => '11', + 'limit' => '500', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->getOcoOrders([ + 'fromId' => 11, + 'limit' => 500, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/trade/GetOpenOCOOrdersTest.php b/tests/spot/trade/GetOpenOCOOrdersTest.php new file mode 100644 index 0000000..1fc0144 --- /dev/null +++ b/tests/spot/trade/GetOpenOCOOrdersTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/openOrderList')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->getOpenOcoOrders([ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/trade/GetOrderTest.php b/tests/spot/trade/GetOrderTest.php new file mode 100644 index 0000000..7ce4850 --- /dev/null +++ b/tests/spot/trade/GetOrderTest.php @@ -0,0 +1,45 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->getOrder(''); + } + + public function testGetOrder() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/order')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'orderId' => '11', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->getOrder('BNBUSDT', [ + 'orderId' => 11, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/trade/MyTradesTest.php b/tests/spot/trade/MyTradesTest.php new file mode 100644 index 0000000..8fc254b --- /dev/null +++ b/tests/spot/trade/MyTradesTest.php @@ -0,0 +1,45 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->myTrades(''); + } + + public function testMyTrades() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/myTrades')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'limit' => '500', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->myTrades('BNBUSDT', [ + 'limit' => 500, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/trade/NewOCOOrderTest.php b/tests/spot/trade/NewOCOOrderTest.php new file mode 100644 index 0000000..9a44fec --- /dev/null +++ b/tests/spot/trade/NewOCOOrderTest.php @@ -0,0 +1,57 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->newOcoOrder('', 'SELL', 0.1, 400.15, 390.3); + } + + public function testNewOcoOrderThrowsExceptionWithoutSide() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->newOcoOrder('BNBUSDT', '', 0.1, 400.15, 390.3); + } + + public function testNewOcoOrder() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/order/oco')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'side' => 'SELL', + 'quantity' => '0.1', + 'price' => '400.15', + 'stopPrice' => '390.3', + 'stopLimitPrice' => '380.3', + 'stopLimitTimeInForce' => 'GTC', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->newOcoOrder('BNBUSDT', 'SELL', 0.1, 400.15, 390.3, [ + 'stopLimitPrice' => 380.3, + 'stopLimitTimeInForce' => 'GTC', + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/trade/NewOrderTest.php b/tests/spot/trade/NewOrderTest.php new file mode 100644 index 0000000..cafbfa8 --- /dev/null +++ b/tests/spot/trade/NewOrderTest.php @@ -0,0 +1,59 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->newOrder('', 'SELL', 'MARKET'); + } + + public function testNewOrderThrowsExceptionWithoutSide() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->newOrder('BNBUSDT', '', 'MARKET'); + } + + public function testNewOrderThrowsExceptionWithoutType() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->newOrder('BNBUSDT', 'SELL', ''); + } + + public function testNewOrder() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/order')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'side' => 'SELL', + 'type' => 'MARKET', + 'stopPrice' => '20.01', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->newOrder('BNBUSDT', 'SELL', 'MARKET', [ + 'stopPrice' => 20.01, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/trade/NewOrderTestTest.php b/tests/spot/trade/NewOrderTestTest.php new file mode 100644 index 0000000..4614c7a --- /dev/null +++ b/tests/spot/trade/NewOrderTestTest.php @@ -0,0 +1,59 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->newOrderTest('', 'SELL', 'MARKET'); + } + + public function testNewOrderTestThrowsExceptionWithoutSide() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->newOrderTest('BNBUSDT', '', 'MARKET'); + } + + public function testNewOrderTestThrowsExceptionWithoutType() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->newOrderTest('BNBUSDT', 'SELL', ''); + } + + public function testNewOrderTest() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/order/test')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'side' => 'SELL', + 'type' => 'MARKET', + 'stopPrice' => '20.01', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->newOrderTest('BNBUSDT', 'SELL', 'MARKET', [ + 'stopPrice' => 20.01, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/trade/OpenOrdersTest.php b/tests/spot/trade/OpenOrdersTest.php new file mode 100644 index 0000000..b650a7a --- /dev/null +++ b/tests/spot/trade/OpenOrdersTest.php @@ -0,0 +1,37 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/openOrders')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->openOrders([ + 'symbol' => 'BNBUSDT', + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/trade/OrderLimitUsageTest.php b/tests/spot/trade/OrderLimitUsageTest.php new file mode 100644 index 0000000..5648997 --- /dev/null +++ b/tests/spot/trade/OrderLimitUsageTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/rateLimit/order')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->orderLimitUsage([ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/wallet/AccountSnapshotTest.php b/tests/spot/wallet/AccountSnapshotTest.php new file mode 100644 index 0000000..8e1a948 --- /dev/null +++ b/tests/spot/wallet/AccountSnapshotTest.php @@ -0,0 +1,43 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->accountSnapshot(''); + } + + public function testAccountSnapshot() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/accountSnapshot')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'type' => 'SPOT', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->accountSnapshot('SPOT', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/wallet/AccountStatusTest.php b/tests/spot/wallet/AccountStatusTest.php new file mode 100644 index 0000000..910d4a5 --- /dev/null +++ b/tests/spot/wallet/AccountStatusTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/account/status')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->accountStatus([ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/wallet/ApiKeyPermissionTest.php b/tests/spot/wallet/ApiKeyPermissionTest.php new file mode 100644 index 0000000..b172a71 --- /dev/null +++ b/tests/spot/wallet/ApiKeyPermissionTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/account/apiRestrictions')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->apiKeyPermission([ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/wallet/ApiTradingStatusTest.php b/tests/spot/wallet/ApiTradingStatusTest.php new file mode 100644 index 0000000..2e0b715 --- /dev/null +++ b/tests/spot/wallet/ApiTradingStatusTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/account/apiTradingStatus')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->apiTradingStatus([ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/wallet/AssetDetailTest.php b/tests/spot/wallet/AssetDetailTest.php new file mode 100644 index 0000000..a21a95b --- /dev/null +++ b/tests/spot/wallet/AssetDetailTest.php @@ -0,0 +1,37 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/asset/assetDetail')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'asset' => 'BNB', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->assetDetail([ + 'asset' => 'BNB', + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/wallet/AssetDividendRecordTest.php b/tests/spot/wallet/AssetDividendRecordTest.php new file mode 100644 index 0000000..ea29235 --- /dev/null +++ b/tests/spot/wallet/AssetDividendRecordTest.php @@ -0,0 +1,43 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/asset/assetDividend')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'asset' => 'BNB', + 'startTime' => '1640995200000', + 'endTime' => '1640995200000', + 'limit' => '123', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->assetDividendRecord([ + 'asset' => 'BNB', + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'limit' => 123, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/wallet/CoinInfoTest.php b/tests/spot/wallet/CoinInfoTest.php new file mode 100644 index 0000000..f0436f1 --- /dev/null +++ b/tests/spot/wallet/CoinInfoTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/capital/config/getall')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->coinInfo([ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/wallet/DepositAddressTest.php b/tests/spot/wallet/DepositAddressTest.php new file mode 100644 index 0000000..be23244 --- /dev/null +++ b/tests/spot/wallet/DepositAddressTest.php @@ -0,0 +1,45 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->depositAddress(''); + } + + public function testDepositAddress() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/capital/deposit/address')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'coin' => 'BNB', + 'network' => 'ETH', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->depositAddress('BNB', [ + 'network' => 'ETH', + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/wallet/DepositHistoryTest.php b/tests/spot/wallet/DepositHistoryTest.php new file mode 100644 index 0000000..0273f78 --- /dev/null +++ b/tests/spot/wallet/DepositHistoryTest.php @@ -0,0 +1,39 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/capital/deposit/hisrec')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'coin' => 'BNB', + 'limit' => '500', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->depositHistory([ + 'coin' => 'BNB', + 'limit' => 500, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/wallet/DisableFastWithdrawTest.php b/tests/spot/wallet/DisableFastWithdrawTest.php new file mode 100644 index 0000000..dacec98 --- /dev/null +++ b/tests/spot/wallet/DisableFastWithdrawTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/account/disableFastWithdrawSwitch')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->disableFastWithdraw([ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/wallet/DustLogTest.php b/tests/spot/wallet/DustLogTest.php new file mode 100644 index 0000000..acdd374 --- /dev/null +++ b/tests/spot/wallet/DustLogTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/asset/dribblet')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->dustLog([ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/wallet/DustTransferTest.php b/tests/spot/wallet/DustTransferTest.php new file mode 100644 index 0000000..ec98bec --- /dev/null +++ b/tests/spot/wallet/DustTransferTest.php @@ -0,0 +1,36 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/asset/dust')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'asset' => 'USDT', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->dustTransfer(['BTC', 'USDT'], [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/wallet/DustableAssetsTest.php b/tests/spot/wallet/DustableAssetsTest.php new file mode 100644 index 0000000..2418cd1 --- /dev/null +++ b/tests/spot/wallet/DustableAssetsTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/asset/dust-btc')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->dustableAssets([ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/wallet/EnableFastWithdrawTest.php b/tests/spot/wallet/EnableFastWithdrawTest.php new file mode 100644 index 0000000..66b3c0b --- /dev/null +++ b/tests/spot/wallet/EnableFastWithdrawTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/account/enableFastWithdrawSwitch')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->enableFastWithdraw([ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/wallet/FundingWalletTest.php b/tests/spot/wallet/FundingWalletTest.php new file mode 100644 index 0000000..1260ca8 --- /dev/null +++ b/tests/spot/wallet/FundingWalletTest.php @@ -0,0 +1,39 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/asset/get-funding-asset')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'asset' => 'BNB', + 'needBtcValuation' => 'true', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->fundingWallet([ + 'asset' => 'BNB', + 'needBtcValuation' => 'true', + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/wallet/SystemStatusTest.php b/tests/spot/wallet/SystemStatusTest.php new file mode 100644 index 0000000..ca25be8 --- /dev/null +++ b/tests/spot/wallet/SystemStatusTest.php @@ -0,0 +1,30 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/system/status')) + ->withMethod('GET') + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->systemStatus(); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/wallet/TradeFeeTest.php b/tests/spot/wallet/TradeFeeTest.php new file mode 100644 index 0000000..912109f --- /dev/null +++ b/tests/spot/wallet/TradeFeeTest.php @@ -0,0 +1,37 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/asset/tradeFee')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->tradeFee([ + 'symbol' => 'BNBUSDT', + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/wallet/UniversalTransferHistoryTest.php b/tests/spot/wallet/UniversalTransferHistoryTest.php new file mode 100644 index 0000000..82c5fd3 --- /dev/null +++ b/tests/spot/wallet/UniversalTransferHistoryTest.php @@ -0,0 +1,55 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->universalTransferHistory(''); + } + + public function testUniversalTransferHistory() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/asset/transfer')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'type' => 'MAIN_UMFUTURE', + 'startTime' => '1640995200000', + 'endTime' => '1640995200000', + 'current' => '1', + 'size' => '100', + 'fromSymbol' => 'BNBUSDT', + 'toSymbol' => 'BNBUSDT', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->universalTransferHistory('MAIN_UMFUTURE', [ + 'startTime' => 1640995200000, + 'endTime' => 1640995200000, + 'current' => 1, + 'size' => 100, + 'fromSymbol' => 'BNBUSDT', + 'toSymbol' => 'BNBUSDT', + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/wallet/UniversalTransferTest.php b/tests/spot/wallet/UniversalTransferTest.php new file mode 100644 index 0000000..f619484 --- /dev/null +++ b/tests/spot/wallet/UniversalTransferTest.php @@ -0,0 +1,55 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->universalTransfer('', 'BTC', 1.01); + } + + public function testUniversalTransferThrowsExceptionWithoutAsset() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->universalTransfer('MAIN_UMFUTURE', '', 1.01); + } + + public function testUniversalTransfer() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/asset/transfer')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'type' => 'MAIN_UMFUTURE', + 'asset' => 'BTC', + 'amount' => '1.01', + 'fromSymbol' => 'BNBUSDT', + 'toSymbol' => 'BNBUSDT', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->universalTransfer('MAIN_UMFUTURE', 'BTC', 1.01, [ + 'fromSymbol' => 'BNBUSDT', + 'toSymbol' => 'BNBUSDT', + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/wallet/WithdrawHistoryTest.php b/tests/spot/wallet/WithdrawHistoryTest.php new file mode 100644 index 0000000..c3799bc --- /dev/null +++ b/tests/spot/wallet/WithdrawHistoryTest.php @@ -0,0 +1,39 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/capital/withdraw/history')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'coin' => 'BNB', + 'limit' => '500', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->withdrawHistory([ + 'coin' => 'BNB', + 'limit' => 500, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/wallet/WithdrawTest.php b/tests/spot/wallet/WithdrawTest.php new file mode 100644 index 0000000..52c6968 --- /dev/null +++ b/tests/spot/wallet/WithdrawTest.php @@ -0,0 +1,51 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->withdraw('', 'address', 1.01); + } + + public function testWithdrawThrowsExceptionWithoutAddress() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->withdraw('BNB', '', 1.01); + } + + public function testWithdraw() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/capital/withdraw/apply')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'coin' => 'BNB', + 'address' => 'address', + 'amount' => '1.01', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->withdraw('BNB', 'address', 1.01, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/util/ArraysTest.php b/tests/util/ArraysTest.php new file mode 100644 index 0000000..115bf69 --- /dev/null +++ b/tests/util/ArraysTest.php @@ -0,0 +1,15 @@ +assertEquals(Arrays::stringify(['BTCUSDT']), '["BTCUSDT"]'); + $this->assertEquals(Arrays::stringify(['BTCUSDT', 'BNBUSDT']), '["BTCUSDT","BNBUSDT"]'); + $this->assertEquals(Arrays::stringify(['BTCUSDT', 'BNBUSDT', 'ETHUSDT']), '["BTCUSDT","BNBUSDT","ETHUSDT"]'); + } +} diff --git a/tests/util/StringsTest.php b/tests/util/StringsTest.php new file mode 100644 index 0000000..2ba6dbe --- /dev/null +++ b/tests/util/StringsTest.php @@ -0,0 +1,14 @@ +assertTrue(Strings::isEmpty('')); + $this->assertTrue(Strings::isEmpty(' ')); + } +} diff --git a/tests/util/UriTest.php b/tests/util/UriTest.php new file mode 100644 index 0000000..124f7ca --- /dev/null +++ b/tests/util/UriTest.php @@ -0,0 +1,24 @@ +assertEquals(Url::buildQuery([]), ''); + $this->assertEquals(Url::buildQuery(['foo' => 'bar']), 'foo=bar'); + $this->assertEquals(Url::buildQuery(['foo' => true]), 'foo=true'); + $this->assertEquals(Url::buildQuery(['foo' => True]), 'foo=true'); + $this->assertEquals(Url::buildQuery(['foo' => TRUE]), 'foo=true'); + $this->assertEquals(Url::buildQuery(['foo' => false]), 'foo=false'); + $this->assertEquals(Url::buildQuery(['foo' => False]), 'foo=false'); + $this->assertEquals(Url::buildQuery(['foo' => FALSE]), 'foo=false'); + $this->assertEquals(Url::buildQuery(['foo' => 'bar', 'key' => 'value']), 'foo=bar&key=value'); + $this->assertEquals(Url::buildQuery(['foo' => ['bar', 'baz']]), 'foo=bar&foo=baz'); + $this->assertEquals(Url::buildQuery(['foo' => ['bar', 'baz'], 'key'=>'value']), 'foo=bar&foo=baz&key=value'); + $this->assertEquals(Url::buildQuery(['foo' => 'alice@email.com']), 'foo=alice%40email.com'); + } +}