From ab0179f24d9fd126ba70bd8c4fd3b843c566d466 Mon Sep 17 00:00:00 2001 From: alplabin <122352306+alplabin@users.noreply.github.com> Date: Tue, 17 Dec 2024 18:26:22 +0900 Subject: [PATCH] Release v1.7.0 --- CHANGELOG.md | 127 ++++ composer.lock | 679 +++++++++--------- .../autoInvestAllSourceAssetTargetAsset.php} | 4 +- .../autoinvest/autoInvestChangePlanStatus.php | 15 + .../autoInvestHoldingDetailsPlan.php | 13 + .../autoInvestIndexDetails.php} | 4 +- ...oInvestIndexLinkedPlanPositionDetails.php} | 3 +- ...InvestIndexLinkedPlanRebalanceDetails.php} | 4 +- .../autoInvestIndexLinkedPlanRedemption.php | 22 + ...InvestIndexLinkedPlanRedemptionHistory.php | 23 + .../spot/autoinvest/autoInvestListPlans.php | 14 + .../autoInvestOneTimeTransaction.php} | 14 +- .../autoInvestOnetimeTransactionStatus.php | 21 + .../autoinvest/autoInvestPlanAdjustment.php | 19 + .../autoinvest/autoInvestPlanCreation.php | 32 + .../autoinvest/autoInvestSourceAssetList.php | 23 + ...toInvestSubscriptionTransactionHistory.php | 15 + .../autoInvestTargetAssetList.php} | 6 +- .../autoInvestTargetAssetRoiData.php} | 3 +- examples/spot/blvt/blvtInfo.php | 17 - examples/spot/blvt/blvtRedemptionRecord.php | 23 - .../spot/cryptoloans/cryptoLoansAdjustLtv.php | 3 +- ...rs.php => cryptoLoansAdjustLtvHistory.php} | 6 +- ....php => cryptoLoansFlexibleAssetsData.php} | 2 +- .../cryptoloans/cryptoLoansFlexibleBorrow.php | 23 + .../cryptoLoansFlexibleBorrowHistory.php | 23 + ...yptoLoansFlexibleCollateralAssetsData.php} | 4 +- .../cryptoLoansFlexibleOngoingOrders.php | 23 + .../cryptoloans/cryptoLoansFlexibleRepay.php | 24 + .../cryptoLoansFlexibleRepayHistory.php | 23 + examples/spot/giftcard/giftCardBuyCode.php | 2 +- examples/spot/margin/marginNewOtoOrder.php | 29 + examples/spot/margin/marginNewOtocoOrder.php | 31 + .../portfolioMarginProBalance.php} | 2 +- .../portfolioMarginProSpanAccount.php | 19 + ...ortfolioMarginProTieredCollateralRate.php} | 4 +- .../savings/savingsFlexiblePurchaseQuota.php | 20 - .../savingsFlexibleRedemptionQuota.php | 21 - .../spot/savings/savingsRedemptionRecord.php | 23 - .../simpleEarnCollateralRecord.php} | 2 +- .../simpleEarnFlexiblePersonalLeftQuota.php | 20 + .../simpleEarnFlexibleProductList.php} | 5 +- .../simpleEarnFlexibleProductPosition.php | 21 + .../simpleEarnFlexibleRedemptionRecord.php | 20 + .../simpleEarnFlexibleRewardsHistory.php | 15 + ...simpleEarnFlexibleSubscriptionPreview.php} | 5 +- .../simpleEarnFlexibleSubscriptionRecord.php | 21 + .../simpleEarnLockedPersonalLeftQuota.php | 20 + .../simpleEarnLockedProductList.php} | 3 +- .../simpleEarnLockedProductPosition.php | 21 + .../simpleEarnLockedRedemptionRecord.php | 21 + .../simpleEarnLockedRewardsHistory.php | 20 + .../simpleEarnLockedSubscriptionPreview.php | 21 + .../simpleEarnLockedSubscriptionRecord.php | 21 + .../spot/simpleearn/simpleEarnRateHistory.php | 22 + .../simpleEarnRedeemFlexibleProduct.php | 20 + .../simpleEarnRedeemLockedProduct.php | 20 + .../simpleEarnSetFlexibleAutoSubscribe.php | 21 + .../simpleEarnSetLockedAutoSubscribe.php} | 5 +- ...simpleEarnSetLockedProductRedeemOption.php | 21 + .../simpleearn/simpleEarnSimpleAccount.php | 19 + .../simpleEarnSubscribeFlexibleProduct.php} | 4 +- .../simpleEarnSubscribeLockedProduct.php} | 4 +- .../subAccountApiUpdateIpRestriction.php | 22 + .../subAccountEnableOptionsForSubaccount.php | 20 + .../subAccountManagedDepositAddress.php} | 6 +- .../subAccountManagedFuturesAssetDetails.php | 20 + .../spot/subaccount/subAccountManagedList.php | 21 + .../subAccountManagedMarginAssetDetails.php | 20 + .../subAccountManagedTransferLogInvestor.php} | 8 +- ...ubAccountManagedTransferLogTradeParent.php | 24 + .../subAccountTransactionStatistics.php | 20 + .../{newOCOOrder.php => newOrderListOco.php} | 12 +- examples/spot/trade/newOrderListOto.php | 29 + examples/spot/trade/newOrderListOtoco.php | 31 + .../accountInfo.php} | 2 +- .../wallet/fetchDepositAddressListNetwork.php | 2 +- src/Binance/Spot.php | 4 +- src/Binance/Spot/AutoInvest.php | 436 +++++++++++ src/Binance/Spot/BLVT.php | 121 ---- src/Binance/Spot/CryptoLoans.php | 244 ++++--- src/Binance/Spot/Margin.php | 105 +++ src/Binance/Spot/Market.php | 4 +- src/Binance/Spot/PortfolioMargin.php | 48 ++ src/Binance/Spot/Savings.php | 354 --------- src/Binance/Spot/SimpleEarn.php | 504 +++++++++++++ src/Binance/Spot/SubAccount.php | 255 +++++++ src/Binance/Spot/Trade.php | 154 +++- src/Binance/Spot/Wallet.php | 118 +-- ...toInvestAllSourceAssetTargetAssetTest.php} | 10 +- .../AutoInvestChangePlanStatusTest.php | 37 + .../AutoInvestHoldingDetailsPlanTest.php | 35 + .../autoinvest/AutoInvestIndexDetailsTest.php | 36 + ...vestIndexLinkedPlanPositionDetailsTest.php | 36 + ...estIndexLinkedPlanRebalanceDetailsTest.php | 39 + ...stIndexLinkedPlanRedemptionHistoryTest.php | 42 ++ ...utoInvestIndexLinkedPlanRedemptionTest.php | 39 + .../AutoInvestListPlansTest.php} | 14 +- .../AutoInvestOneTimeTransactionTest.php | 59 ++ ...AutoInvestOnetimeTransactionStatusTest.php | 38 + .../AutoInvestPlanAdjustmentTest.php | 44 ++ .../autoinvest/AutoInvestPlanCreationTest.php | 64 ++ .../AutoInvestSourceAssetListTest.php} | 26 +- ...vestSubscriptionTransactionHistoryTest.php | 39 + .../AutoInvestTargetAssetListTest.php} | 12 +- .../AutoInvestTargetAssetRoiDataTest.php} | 20 +- tests/spot/blvt/BlvtInfoTest.php | 35 - .../spot/blvt/BlvtSubscriptionRecordTest.php | 45 -- .../CryptoLoansAdjustLtvHistoryTest.php | 43 ++ .../cryptoloans/CryptoLoansAdjustLtvTest.php | 23 +- .../cryptoloans/CryptoLoansBorrowTest.php | 58 -- .../CryptoLoansCollateralRepayRateTest.php | 58 -- .../CryptoLoansCustomizeMarginCallTest.php | 47 -- ... => CryptoLoansFlexibleAssetsDataTest.php} | 8 +- .../CryptoLoansFlexibleBorrowHistoryTest.php | 43 ++ .../CryptoLoansFlexibleBorrowTest.php | 41 ++ ...oLoansFlexibleCollateralAssetsDataTest.php | 37 + .../CryptoLoansFlexibleOngoingOrdersTest.php | 43 ++ .../CryptoLoansFlexibleRepayHistoryTest.php | 43 ++ .../CryptoLoansFlexibleRepayTest.php | 42 ++ .../spot/cryptoloans/CryptoLoansRepayTest.php | 44 -- tests/spot/margin/MarginNewOtoOrderTest.php | 54 ++ tests/spot/margin/MarginNewOtocoOrderTest.php | 60 ++ .../PortfolioMarginProBalanceTest.php | 35 + .../PortfolioMarginProSpanAccountTest.php | 35 + ...folioMarginProTieredCollateralRateTest.php | 35 + .../savings/SavingsFlexibleRedeemTest.php | 51 -- .../savings/SavingsRedemptionRecordTest.php | 49 -- .../SimpleEarnCollateralRecordTest.php | 39 + ...impleEarnFlexiblePersonalLeftQuotaTest.php | 43 ++ .../SimpleEarnFlexibleProductListTest.php | 41 ++ .../SimpleEarnFlexibleProductPositionTest.php | 39 + ...SimpleEarnFlexibleRedemptionRecordTest.php | 37 + .../SimpleEarnFlexibleRewardsHistoryTest.php | 40 ++ ...pleEarnFlexibleSubscriptionPreviewTest.php | 44 ++ ...mpleEarnFlexibleSubscriptionRecordTest.php | 39 + ...SimpleEarnLockedPersonalLeftQuotaTest.php} | 14 +- .../SimpleEarnLockedProductListTest.php} | 16 +- .../SimpleEarnLockedProductPositionTest.php} | 16 +- .../SimpleEarnLockedRedemptionRecordTest.php | 39 + .../SimpleEarnLockedRewardsHistoryTest.php | 37 + ...impleEarnLockedSubscriptionPreviewTest.php | 44 ++ ...SimpleEarnLockedSubscriptionRecordTest.php | 39 + .../SimpleEarnRateHistoryTest.php} | 16 +- .../SimpleEarnRedeemFlexibleProductTest.php} | 15 +- .../SimpleEarnRedeemLockedProductTest.php} | 15 +- ...SimpleEarnSetFlexibleAutoSubscribeTest.php | 44 ++ .../SimpleEarnSetLockedAutoSubscribeTest.php | 44 ++ ...eEarnSetLockedProductRedeemOptionTest.php} | 18 +- .../SimpleEarnSimpleAccountTest.php} | 10 +- ...SimpleEarnSubscribeFlexibleProductTest.php | 44 ++ .../SimpleEarnSubscribeLockedProductTest.php} | 14 +- .../SubAccountApiUpdateIpRestrictionTest.php | 57 ++ ...AccountEnableOptionsForSubaccountTest.php} | 15 +- .../SubAccountManagedDepositAddressTest.php | 52 ++ ...bAccountManagedFuturesAssetDetailsTest.php | 36 + .../subaccount/SubAccountManagedListTest.php | 40 ++ ...ubAccountManagedMarginAssetDetailsTest.php | 43 ++ ...AccountManagedTransferLogInvestorTest.php} | 21 +- ...countManagedTransferLogTradeParentTest.php | 40 ++ .../SubAccountTransactionStatisticsTest.php} | 14 +- tests/spot/trade/NewOCOOrderTest.php | 57 -- tests/spot/trade/NewOrderListOcoTest.php | 69 ++ tests/spot/trade/NewOrderListOtoTest.php | 54 ++ tests/spot/trade/NewOrderListOtocoTest.php | 58 ++ .../AccountInfoTest.php} | 8 +- ... => QueryAutoConvertingStableCoinTest.php} | 4 +- 167 files changed, 5369 insertions(+), 1784 deletions(-) rename examples/spot/{blvt/blvtRedeem.php => autoinvest/autoInvestAllSourceAssetTargetAsset.php} (80%) create mode 100644 examples/spot/autoinvest/autoInvestChangePlanStatus.php create mode 100644 examples/spot/autoinvest/autoInvestHoldingDetailsPlan.php rename examples/spot/{savings/savingsCustomizedPosition.php => autoinvest/autoInvestIndexDetails.php} (80%) rename examples/spot/{savings/savingsPurchaseCustomizedProject.php => autoinvest/autoInvestIndexLinkedPlanPositionDetails.php} (78%) rename examples/spot/{savings/savingsPurchaseRecord.php => autoinvest/autoInvestIndexLinkedPlanRebalanceDetails.php} (77%) create mode 100644 examples/spot/autoinvest/autoInvestIndexLinkedPlanRedemption.php create mode 100644 examples/spot/autoinvest/autoInvestIndexLinkedPlanRedemptionHistory.php create mode 100644 examples/spot/autoinvest/autoInvestListPlans.php rename examples/spot/{blvt/blvtSubscriptionRecord.php => autoinvest/autoInvestOneTimeTransaction.php} (52%) create mode 100644 examples/spot/autoinvest/autoInvestOnetimeTransactionStatus.php create mode 100644 examples/spot/autoinvest/autoInvestPlanAdjustment.php create mode 100644 examples/spot/autoinvest/autoInvestPlanCreation.php create mode 100644 examples/spot/autoinvest/autoInvestSourceAssetList.php create mode 100644 examples/spot/autoinvest/autoInvestSubscriptionTransactionHistory.php rename examples/spot/{cryptoloans/cryptoLoansBorrow.php => autoinvest/autoInvestTargetAssetList.php} (77%) rename examples/spot/{savings/savingsFlexibleProductPosition.php => autoinvest/autoInvestTargetAssetRoiData.php} (78%) delete mode 100644 examples/spot/blvt/blvtInfo.php delete mode 100644 examples/spot/blvt/blvtRedemptionRecord.php rename examples/spot/cryptoloans/{cryptoLoansOngoingOrders.php => cryptoLoansAdjustLtvHistory.php} (67%) rename examples/spot/cryptoloans/{cryptoLoansLoanableData.php => cryptoLoansFlexibleAssetsData.php} (84%) create mode 100644 examples/spot/cryptoloans/cryptoLoansFlexibleBorrow.php create mode 100644 examples/spot/cryptoloans/cryptoLoansFlexibleBorrowHistory.php rename examples/spot/cryptoloans/{cryptoLoansCustomizeMarginCall.php => cryptoLoansFlexibleCollateralAssetsData.php} (74%) create mode 100644 examples/spot/cryptoloans/cryptoLoansFlexibleOngoingOrders.php create mode 100644 examples/spot/cryptoloans/cryptoLoansFlexibleRepay.php create mode 100644 examples/spot/cryptoloans/cryptoLoansFlexibleRepayHistory.php create mode 100644 examples/spot/margin/marginNewOtoOrder.php create mode 100644 examples/spot/margin/marginNewOtocoOrder.php rename examples/spot/{cryptoloans/cryptoLoansCollateralData.php => portfoliomargin/portfolioMarginProBalance.php} (83%) create mode 100644 examples/spot/portfoliomargin/portfolioMarginProSpanAccount.php rename examples/spot/{blvt/blvtSubscribe.php => portfoliomargin/portfolioMarginProTieredCollateralRate.php} (80%) delete mode 100644 examples/spot/savings/savingsFlexiblePurchaseQuota.php delete mode 100644 examples/spot/savings/savingsFlexibleRedemptionQuota.php delete mode 100644 examples/spot/savings/savingsRedemptionRecord.php rename examples/spot/{savings/savingsFlexibleProducts.php => simpleearn/simpleEarnCollateralRecord.php} (85%) create mode 100644 examples/spot/simpleearn/simpleEarnFlexiblePersonalLeftQuota.php rename examples/spot/{savings/savingsInterestHistory.php => simpleearn/simpleEarnFlexibleProductList.php} (77%) create mode 100644 examples/spot/simpleearn/simpleEarnFlexibleProductPosition.php create mode 100644 examples/spot/simpleearn/simpleEarnFlexibleRedemptionRecord.php create mode 100644 examples/spot/simpleearn/simpleEarnFlexibleRewardsHistory.php rename examples/spot/{savings/SavingsFlexibleRedeem.php => simpleearn/simpleEarnFlexibleSubscriptionPreview.php} (78%) create mode 100644 examples/spot/simpleearn/simpleEarnFlexibleSubscriptionRecord.php create mode 100644 examples/spot/simpleearn/simpleEarnLockedPersonalLeftQuota.php rename examples/spot/{savings/savingsProductList.php => simpleearn/simpleEarnLockedProductList.php} (84%) create mode 100644 examples/spot/simpleearn/simpleEarnLockedProductPosition.php create mode 100644 examples/spot/simpleearn/simpleEarnLockedRedemptionRecord.php create mode 100644 examples/spot/simpleearn/simpleEarnLockedRewardsHistory.php create mode 100644 examples/spot/simpleearn/simpleEarnLockedSubscriptionPreview.php create mode 100644 examples/spot/simpleearn/simpleEarnLockedSubscriptionRecord.php create mode 100644 examples/spot/simpleearn/simpleEarnRateHistory.php create mode 100644 examples/spot/simpleearn/simpleEarnRedeemFlexibleProduct.php create mode 100644 examples/spot/simpleearn/simpleEarnRedeemLockedProduct.php create mode 100644 examples/spot/simpleearn/simpleEarnSetFlexibleAutoSubscribe.php rename examples/spot/{blvt/blvtUserLimitInfo.php => simpleearn/simpleEarnSetLockedAutoSubscribe.php} (76%) create mode 100644 examples/spot/simpleearn/simpleEarnSetLockedProductRedeemOption.php create mode 100644 examples/spot/simpleearn/simpleEarnSimpleAccount.php rename examples/spot/{savings/savingsPurchaseFlexibleProduct.php => simpleearn/simpleEarnSubscribeFlexibleProduct.php} (79%) rename examples/spot/{cryptoloans/cryptoLoansRepay.php => simpleearn/simpleEarnSubscribeLockedProduct.php} (79%) create mode 100644 examples/spot/subaccount/subAccountApiUpdateIpRestriction.php create mode 100644 examples/spot/subaccount/subAccountEnableOptionsForSubaccount.php rename examples/spot/{cryptoloans/cryptoLoansCollateralRepayRate.php => subaccount/subAccountManagedDepositAddress.php} (72%) create mode 100644 examples/spot/subaccount/subAccountManagedFuturesAssetDetails.php create mode 100644 examples/spot/subaccount/subAccountManagedList.php create mode 100644 examples/spot/subaccount/subAccountManagedMarginAssetDetails.php rename examples/spot/{savings/savingsChangeDailyPosition.php => subaccount/subAccountManagedTransferLogInvestor.php} (67%) create mode 100644 examples/spot/subaccount/subAccountManagedTransferLogTradeParent.php create mode 100644 examples/spot/subaccount/subAccountTransactionStatistics.php rename examples/spot/trade/{newOCOOrder.php => newOrderListOco.php} (65%) create mode 100644 examples/spot/trade/newOrderListOto.php create mode 100644 examples/spot/trade/newOrderListOtoco.php rename examples/spot/{savings/savingsAccount.php => wallet/accountInfo.php} (86%) create mode 100644 src/Binance/Spot/AutoInvest.php delete mode 100644 src/Binance/Spot/BLVT.php delete mode 100644 src/Binance/Spot/Savings.php create mode 100644 src/Binance/Spot/SimpleEarn.php rename tests/spot/{blvt/BlvtUserLimitInfoTest.php => autoinvest/AutoInvestAllSourceAssetTargetAssetTest.php} (68%) create mode 100644 tests/spot/autoinvest/AutoInvestChangePlanStatusTest.php create mode 100644 tests/spot/autoinvest/AutoInvestHoldingDetailsPlanTest.php create mode 100644 tests/spot/autoinvest/AutoInvestIndexDetailsTest.php create mode 100644 tests/spot/autoinvest/AutoInvestIndexLinkedPlanPositionDetailsTest.php create mode 100644 tests/spot/autoinvest/AutoInvestIndexLinkedPlanRebalanceDetailsTest.php create mode 100644 tests/spot/autoinvest/AutoInvestIndexLinkedPlanRedemptionHistoryTest.php create mode 100644 tests/spot/autoinvest/AutoInvestIndexLinkedPlanRedemptionTest.php rename tests/spot/{savings/SavingsCustomizedPositionTest.php => autoinvest/AutoInvestListPlansTest.php} (62%) create mode 100644 tests/spot/autoinvest/AutoInvestOneTimeTransactionTest.php create mode 100644 tests/spot/autoinvest/AutoInvestOnetimeTransactionStatusTest.php create mode 100644 tests/spot/autoinvest/AutoInvestPlanAdjustmentTest.php create mode 100644 tests/spot/autoinvest/AutoInvestPlanCreationTest.php rename tests/spot/{savings/SavingsInterestHistoryTest.php => autoinvest/AutoInvestSourceAssetListTest.php} (51%) create mode 100644 tests/spot/autoinvest/AutoInvestSubscriptionTransactionHistoryTest.php rename tests/spot/{savings/SavingsFlexibleProductsTest.php => autoinvest/AutoInvestTargetAssetListTest.php} (73%) rename tests/spot/{savings/SavingsFlexibleRedemptionQuotaTest.php => autoinvest/AutoInvestTargetAssetRoiDataTest.php} (53%) delete mode 100644 tests/spot/blvt/BlvtInfoTest.php delete mode 100644 tests/spot/blvt/BlvtSubscriptionRecordTest.php create mode 100644 tests/spot/cryptoloans/CryptoLoansAdjustLtvHistoryTest.php delete mode 100644 tests/spot/cryptoloans/CryptoLoansBorrowTest.php delete mode 100644 tests/spot/cryptoloans/CryptoLoansCollateralRepayRateTest.php delete mode 100644 tests/spot/cryptoloans/CryptoLoansCustomizeMarginCallTest.php rename tests/spot/cryptoloans/{CryptoLoansLoanableDataTest.php => CryptoLoansFlexibleAssetsDataTest.php} (72%) create mode 100644 tests/spot/cryptoloans/CryptoLoansFlexibleBorrowHistoryTest.php create mode 100644 tests/spot/cryptoloans/CryptoLoansFlexibleBorrowTest.php create mode 100644 tests/spot/cryptoloans/CryptoLoansFlexibleCollateralAssetsDataTest.php create mode 100644 tests/spot/cryptoloans/CryptoLoansFlexibleOngoingOrdersTest.php create mode 100644 tests/spot/cryptoloans/CryptoLoansFlexibleRepayHistoryTest.php create mode 100644 tests/spot/cryptoloans/CryptoLoansFlexibleRepayTest.php delete mode 100644 tests/spot/cryptoloans/CryptoLoansRepayTest.php create mode 100644 tests/spot/margin/MarginNewOtoOrderTest.php create mode 100644 tests/spot/margin/MarginNewOtocoOrderTest.php create mode 100644 tests/spot/portfoliomargin/PortfolioMarginProBalanceTest.php create mode 100644 tests/spot/portfoliomargin/PortfolioMarginProSpanAccountTest.php create mode 100644 tests/spot/portfoliomargin/PortfolioMarginProTieredCollateralRateTest.php delete mode 100644 tests/spot/savings/SavingsFlexibleRedeemTest.php delete mode 100644 tests/spot/savings/SavingsRedemptionRecordTest.php create mode 100644 tests/spot/simpleearn/SimpleEarnCollateralRecordTest.php create mode 100644 tests/spot/simpleearn/SimpleEarnFlexiblePersonalLeftQuotaTest.php create mode 100644 tests/spot/simpleearn/SimpleEarnFlexibleProductListTest.php create mode 100644 tests/spot/simpleearn/SimpleEarnFlexibleProductPositionTest.php create mode 100644 tests/spot/simpleearn/SimpleEarnFlexibleRedemptionRecordTest.php create mode 100644 tests/spot/simpleearn/SimpleEarnFlexibleRewardsHistoryTest.php create mode 100644 tests/spot/simpleearn/SimpleEarnFlexibleSubscriptionPreviewTest.php create mode 100644 tests/spot/simpleearn/SimpleEarnFlexibleSubscriptionRecordTest.php rename tests/spot/{savings/SavingsFlexibleProductPositionTest.php => simpleearn/SimpleEarnLockedPersonalLeftQuotaTest.php} (60%) rename tests/spot/{savings/SavingsPurchaseRecordTest.php => simpleearn/SimpleEarnLockedProductListTest.php} (59%) rename tests/spot/{cryptoloans/CryptoLoansOngoingOrdersTest.php => simpleearn/SimpleEarnLockedProductPositionTest.php} (61%) create mode 100644 tests/spot/simpleearn/SimpleEarnLockedRedemptionRecordTest.php create mode 100644 tests/spot/simpleearn/SimpleEarnLockedRewardsHistoryTest.php create mode 100644 tests/spot/simpleearn/SimpleEarnLockedSubscriptionPreviewTest.php create mode 100644 tests/spot/simpleearn/SimpleEarnLockedSubscriptionRecordTest.php rename tests/spot/{savings/SavingsProductListTest.php => simpleearn/SimpleEarnRateHistoryTest.php} (64%) rename tests/spot/{blvt/BlvtSubscribeTest.php => simpleearn/SimpleEarnRedeemFlexibleProductTest.php} (61%) rename tests/spot/{blvt/BlvtRedeemTest.php => simpleearn/SimpleEarnRedeemLockedProductTest.php} (61%) create mode 100644 tests/spot/simpleearn/SimpleEarnSetFlexibleAutoSubscribeTest.php create mode 100644 tests/spot/simpleearn/SimpleEarnSetLockedAutoSubscribeTest.php rename tests/spot/{savings/SavingsChangeDailyPositionTest.php => simpleearn/SimpleEarnSetLockedProductRedeemOptionTest.php} (57%) rename tests/spot/{cryptoloans/CryptoLoansCollateralDataTest.php => simpleearn/SimpleEarnSimpleAccountTest.php} (67%) create mode 100644 tests/spot/simpleearn/SimpleEarnSubscribeFlexibleProductTest.php rename tests/spot/{savings/SavingsPurchaseFlexibleProductTest.php => simpleearn/SimpleEarnSubscribeLockedProductTest.php} (61%) create mode 100644 tests/spot/subaccount/SubAccountApiUpdateIpRestrictionTest.php rename tests/spot/{savings/SavingsPurchaseCustomizedProjectTest.php => subaccount/SubAccountEnableOptionsForSubaccountTest.php} (58%) create mode 100644 tests/spot/subaccount/SubAccountManagedDepositAddressTest.php create mode 100644 tests/spot/subaccount/SubAccountManagedFuturesAssetDetailsTest.php create mode 100644 tests/spot/subaccount/SubAccountManagedListTest.php create mode 100644 tests/spot/subaccount/SubAccountManagedMarginAssetDetailsTest.php rename tests/spot/{blvt/BlvtRedemptionRecordTest.php => subaccount/SubAccountManagedTransferLogInvestorTest.php} (53%) create mode 100644 tests/spot/subaccount/SubAccountManagedTransferLogTradeParentTest.php rename tests/spot/{savings/SavingsFlexiblePurchaseQuotaTest.php => subaccount/SubAccountTransactionStatisticsTest.php} (60%) delete mode 100644 tests/spot/trade/NewOCOOrderTest.php create mode 100644 tests/spot/trade/NewOrderListOcoTest.php create mode 100644 tests/spot/trade/NewOrderListOtoTest.php create mode 100644 tests/spot/trade/NewOrderListOtocoTest.php rename tests/spot/{savings/SavingsAccountTest.php => wallet/AccountInfoTest.php} (74%) rename tests/spot/wallet/{QueryAutoConvertingStableCoinsTest.php => QueryAutoConvertingStableCoinTest.php} (86%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e5ab1f..d346d86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,132 @@ # CHANGELOG +## 1.7.0 - 2024-12-17 +### Added +- Auto Invest + - `GET /sapi/v1/lending/auto-invest/target-asset/list` + - `GET /sapi/v1/lending/auto-invest/target-asset/roi/list` + - `GET /sapi/v1/lending/auto-invest/all/asset` + - `GET /sapi/v1/lending/auto-invest/source-asset/list` + - `POST /sapi/v1/lending/auto-invest/plan/add` + - `POST /sapi/v1/lending/auto-invest/plan/edit` + - `POST /sapi/v1/lending/auto-invest/plan/edit-status` + - `GET /sapi/v1/lending/auto-invest/plan/list` + - `GET /sapi/v1/lending/auto-invest/plan/id` + - `GET /sapi/v1/lending/auto-invest/history/list` + - `GET /sapi/v1/lending/auto-invest/index/info` + - `GET /sapi/v1/lending/auto-invest/index/user-summary` + - `POST /sapi/v1/lending/auto-invest/one-off` + - `GET /sapi/v1/lending/auto-invest/one-off/status` + - `POST /sapi/v1/lending/auto-invest/redeem` + - `GET /sapi/v1/lending/auto-invest/redeem/history` + - `GET /sapi/v1/lending/auto-invest/rebalance/history` + +- CryptoLoans + - `POST /sapi/v2/loan/flexible/borrow` + - `GET /sapi/v2/loan/flexible/ongoing/orders` + - `GET /sapi/v2/loan/flexible/borrow/history` + - `POST /sapi/v2/loan/flexible/repay` + - `GET /sapi/v2/loan/flexible/repay/history` + - `POST /sapi/v2/loan/flexible/adjust/ltv` + - `GET /sapi/v2/loan/flexible/ltv/adjustment/history` + - `GET /sapi/v2/loan/flexible/loanable/data` + - `GET /sapi/v2/loan/flexible/collateral/data` + +- Margin + - `POST /sapi/v1/margin/order/oto` + - `POST /sapi/v1/margin/order/otoco` + +- PortfolioMargin + - `GET /sapi/v2/portfolio/account` + - `GET /sapi/v1/portfolio/balance` + - `GET /sapi/v2/portfolio/collateralRate` + +- SimpleEarns + - `GET /sapi/v1/simple-earn/flexible/list` + - `GET /sapi/v1/simple-earn/locked/list` + - `POST /sapi/v1/simple-earn/flexible/subscribe` + - `POST /sapi/v1/simple-earn/locked/subscribe` + - `POST /sapi/v1/simple-earn/flexible/redeem` + - `POST /sapi/v1/simple-earn/locked/redeem` + - `GET /sapi/v1/simple-earn/flexible/position` + - `GET /sapi/v1/simple-earn/locked/position` + - `GET /sapi/v1/simple-earn/account` + - `GET /sapi/v1/simple-earn/flexible/history/subscriptionRecord` + - `GET /sapi/v1/simple-earn/locked/history/subscriptionRecord` + - `GET /sapi/v1/simple-earn/flexible/history/redemptionRecord` + - `GET /sapi/v1/simple-earn/locked/history/redemptionRecord` + - `GET /sapi/v1/simple-earn/flexible/history/rewardsRecord` + - `GET /sapi/v1/simple-earn/locked/history/rewardsRecord` + - `POST /sapi/v1/simple-earn/flexible/setAutoSubscribe` + - `POST /sapi/v1/simple-earn/locked/setAutoSubscribe` + - `GET /sapi/v1/simple-earn/flexible/personalLeftQuota` + - `GET /sapi/v1/simple-earn/locked/personalLeftQuota` + - `GET /sapi/v1/simple-earn/flexible/subscriptionPreview` + - `GET /sapi/v1/simple-earn/locked/subscriptionPreview` + - `POST /sapi/v1/simple-earn/locked/setRedeemOption` + - `GET /sapi/v1/simple-earn/flexible/history/rateHistory` + - `GET /sapi/v1/simple-earn/flexible/history/collateralRecord` + +- SubAccount + - `GET /sapi/v1/managed-subaccount/queryTransLogForInvestor` + - `GET /sapi/v1/managed-subaccount/queryTransLogForTradeParent` + - `GET /sapi/v1/managed-subaccount/fetch-future-asset` + - `GET /sapi/v1/managed-subaccount/marginAsset` + - `GET /sapi/v1/managed-subaccount/info` + - `GET /sapi/v1/managed-subaccount/deposit/address` + - `GET /sapi/v1/managed-subaccount/query-trans-log` + - `GET /sapi/v1/sub-account/transaction-statistics` + - `POST /sapi/v1/sub-account/eoptions/enable` + - `POST /sapi/v2/sub-account/subAccountApi/ipRestriction` + - `GET /sapi/v4/sub-account/assets` + - `GET /sapi/v1/margin/crossMarginCollateralRatio` + +- Trade + - `POST /api/v3/orderList/oto` + - `POST /api/v3/orderList/otoco` + +- Wallet + - `GET /sapi/v1/account/info` + +### Updated +- Upgrade dependencies +- Update OCO endpoint from `POST /api/v3/order/oco` to `POST /api/v3/orderList/oco` + +### Removed +- Blvt + - `GET /sapi/v1/blvt/tokenInfo` + - `POST /sapi/v1/blvt/subscribe` + - `GET /sapi/v1/blvt/subscribe/record` + - `POST /sapi/v1/blvt/redeem` + - `GET /sapi/v1/blvt/redeem/record` + - `GET /sapi/v1/blvt/userLimit` + +- CryptoLoans + - `GET /sapi/v1/loan/loanable/data` + - `GET /sapi/v1/loan/collateral/data` + - `POST /sapi/v1/loan/borrow` + - `POST /sapi/v1/loan/repay` + - `GET /sapi/v1/loan/repay/collateral/rate` + - `POST /sapi/v1/loan/adjust/ltv` + - `POST /sapi/v1/loan/customize/margin_call` + - `GET /sapi/v1/loan/ongoing/orders` + +- Savings + - `GET /sapi/v1/lending/daily/product/list` + - `GET /sapi/v1/lending/daily/userLeftQuota` + - `POST /sapi/v1/lending/daily/purchase` + - `GET /sapi/v1/lending/daily/userRedemptionQuota` + - `POST /sapi/v1/lending/daily/redeem` + - `GET /sapi/v1/lending/daily/token/position` + - `GET /sapi/v1/lending/union/account` + - `GET /sapi/v1/lending/union/purchaseRecord` + - `GET /sapi/v1/lending/union/redemptionRecord` + - `GET /sapi/v1/lending/union/interestHistory` + - `POST /sapi/v1/lending/positionChanged` + - `GET /sapi/v1/lending/project/list` + - `GET /sapi/v1/lending/project/position/list` + - `POST /sapi/v1/lending/customizedFixed/purchase` + ## 1.6.0 - 2024-05-30 ### Added - Convert diff --git a/composer.lock b/composer.lock index 7448baa..ab505df 100644 --- a/composer.lock +++ b/composer.lock @@ -55,22 +55,22 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.8.1", + "version": "7.9.2", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "41042bc7ab002487b876a0683fc8dce04ddce104" + "reference": "d281ed313b989f213357e3be1a179f02196ac99b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/41042bc7ab002487b876a0683fc8dce04ddce104", - "reference": "41042bc7ab002487b876a0683fc8dce04ddce104", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d281ed313b989f213357e3be1a179f02196ac99b", + "reference": "d281ed313b989f213357e3be1a179f02196ac99b", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.5.3 || ^2.0.1", - "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", + "guzzlehttp/promises": "^1.5.3 || ^2.0.3", + "guzzlehttp/psr7": "^2.7.0", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.2 || ^3.0" @@ -81,9 +81,9 @@ "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", "ext-curl": "*", - "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", + "guzzle/client-integration-tests": "3.0.2", "php-http/message-factory": "^1.1", - "phpunit/phpunit": "^8.5.36 || ^9.6.15", + "phpunit/phpunit": "^8.5.39 || ^9.6.20", "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { @@ -161,7 +161,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.8.1" + "source": "https://github.com/guzzle/guzzle/tree/7.9.2" }, "funding": [ { @@ -177,20 +177,20 @@ "type": "tidelift" } ], - "time": "2023-12-03T20:35:24+00:00" + "time": "2024-07-24T11:22:20+00:00" }, { "name": "guzzlehttp/promises", - "version": "2.0.2", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223" + "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/bbff78d96034045e58e13dedd6ad91b5d1253223", - "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223", + "url": "https://api.github.com/repos/guzzle/promises/zipball/f9c436286ab2892c7db7be8c8da4ef61ccf7b455", + "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455", "shasum": "" }, "require": { @@ -198,7 +198,7 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.36 || ^9.6.15" + "phpunit/phpunit": "^8.5.39 || ^9.6.20" }, "type": "library", "extra": { @@ -244,7 +244,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.0.2" + "source": "https://github.com/guzzle/promises/tree/2.0.4" }, "funding": [ { @@ -260,20 +260,20 @@ "type": "tidelift" } ], - "time": "2023-12-03T20:19:20+00:00" + "time": "2024-10-17T10:06:22+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.6.2", + "version": "2.7.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221" + "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/45b30f99ac27b5ca93cb4831afe16285f57b8221", - "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201", + "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201", "shasum": "" }, "require": { @@ -288,8 +288,8 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^8.5.36 || ^9.6.15" + "http-interop/http-factory-tests": "0.9.0", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" @@ -360,7 +360,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.6.2" + "source": "https://github.com/guzzle/psr7/tree/2.7.0" }, "funding": [ { @@ -376,7 +376,7 @@ "type": "tidelift" } ], - "time": "2023-12-03T20:05:35+00:00" + "time": "2024-07-18T11:15:46+00:00" }, { "name": "psr/http-client", @@ -540,16 +540,16 @@ }, { "name": "psr/log", - "version": "3.0.0", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", "shasum": "" }, "require": { @@ -584,9 +584,9 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/3.0.0" + "source": "https://github.com/php-fig/log/tree/3.0.2" }, - "time": "2021-07-14T16:46:02+00:00" + "time": "2024-09-11T13:17:53+00:00" }, { "name": "ralouphie/getallheaders", @@ -817,28 +817,28 @@ }, { "name": "react/dns", - "version": "v1.12.0", + "version": "v1.13.0", "source": { "type": "git", "url": "https://github.com/reactphp/dns.git", - "reference": "c134600642fa615b46b41237ef243daa65bb64ec" + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/dns/zipball/c134600642fa615b46b41237ef243daa65bb64ec", - "reference": "c134600642fa615b46b41237ef243daa65bb64ec", + "url": "https://api.github.com/repos/reactphp/dns/zipball/eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", "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": "^3.2 || ^2.7 || ^1.2.1" }, "require-dev": { "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", - "react/async": "^4 || ^3 || ^2", - "react/promise-timer": "^1.9" + "react/async": "^4.3 || ^3 || ^2", + "react/promise-timer": "^1.11" }, "type": "library", "autoload": { @@ -881,7 +881,7 @@ ], "support": { "issues": "https://github.com/reactphp/dns/issues", - "source": "https://github.com/reactphp/dns/tree/v1.12.0" + "source": "https://github.com/reactphp/dns/tree/v1.13.0" }, "funding": [ { @@ -889,7 +889,7 @@ "type": "open_collective" } ], - "time": "2023-11-29T12:41:06+00:00" + "time": "2024-06-13T14:18:03+00:00" }, { "name": "react/event-loop", @@ -1038,31 +1038,31 @@ }, { "name": "react/socket", - "version": "v1.15.0", + "version": "v1.16.0", "source": { "type": "git", "url": "https://github.com/reactphp/socket.git", - "reference": "216d3aec0b87f04a40ca04f481e6af01bdd1d038" + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/socket/zipball/216d3aec0b87f04a40ca04f481e6af01bdd1d038", - "reference": "216d3aec0b87f04a40ca04f481e6af01bdd1d038", + "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", "shasum": "" }, "require": { "evenement/evenement": "^3.0 || ^2.0 || ^1.0", "php": ">=5.3.0", - "react/dns": "^1.11", + "react/dns": "^1.13", "react/event-loop": "^1.2", - "react/promise": "^3 || ^2.6 || ^1.2.1", - "react/stream": "^1.2" + "react/promise": "^3.2 || ^2.6 || ^1.2.1", + "react/stream": "^1.4" }, "require-dev": { "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", - "react/async": "^4 || ^3 || ^2", + "react/async": "^4.3 || ^3.3 || ^2", "react/promise-stream": "^1.4", - "react/promise-timer": "^1.10" + "react/promise-timer": "^1.11" }, "type": "library", "autoload": { @@ -1106,7 +1106,7 @@ ], "support": { "issues": "https://github.com/reactphp/socket/issues", - "source": "https://github.com/reactphp/socket/tree/v1.15.0" + "source": "https://github.com/reactphp/socket/tree/v1.16.0" }, "funding": [ { @@ -1114,20 +1114,20 @@ "type": "open_collective" } ], - "time": "2023-12-15T11:02:10+00:00" + "time": "2024-07-26T10:38:09+00:00" }, { "name": "react/stream", - "version": "v1.3.0", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/reactphp/stream.git", - "reference": "6fbc9672905c7d5a885f2da2fc696f65840f4a66" + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/stream/zipball/6fbc9672905c7d5a885f2da2fc696f65840f4a66", - "reference": "6fbc9672905c7d5a885f2da2fc696f65840f4a66", + "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d", "shasum": "" }, "require": { @@ -1137,7 +1137,7 @@ }, "require-dev": { "clue/stream-filter": "~1.2", - "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" }, "type": "library", "autoload": { @@ -1184,7 +1184,7 @@ ], "support": { "issues": "https://github.com/reactphp/stream/issues", - "source": "https://github.com/reactphp/stream/tree/v1.3.0" + "source": "https://github.com/reactphp/stream/tree/v1.4.0" }, "funding": [ { @@ -1192,20 +1192,20 @@ "type": "open_collective" } ], - "time": "2023-06-16T10:52:11+00:00" + "time": "2024-06-11T12:45:25+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", "shasum": "" }, "require": { @@ -1243,7 +1243,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" }, "funding": [ { @@ -1259,7 +1259,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-09-25T14:20:29+00:00" } ], "packages-dev": [ @@ -1394,30 +1394,38 @@ }, { "name": "composer/pcre", - "version": "3.1.4", + "version": "3.3.2", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "04229f163664973f68f38f6f73d917799168ef24" + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/04229f163664973f68f38f6f73d917799168ef24", - "reference": "04229f163664973f68f38f6f73d917799168ef24", + "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e", "shasum": "" }, "require": { "php": "^7.4 || ^8.0" }, + "conflict": { + "phpstan/phpstan": "<1.11.10" + }, "require-dev": { - "phpstan/phpstan": "^1.3", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^5" + "phpstan/phpstan": "^1.12 || ^2", + "phpstan/phpstan-strict-rules": "^1 || ^2", + "phpunit/phpunit": "^8 || ^9" }, "type": "library", "extra": { "branch-alias": { "dev-main": "3.x-dev" + }, + "phpstan": { + "includes": [ + "extension.neon" + ] } }, "autoload": { @@ -1445,7 +1453,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.1.4" + "source": "https://github.com/composer/pcre/tree/3.3.2" }, "funding": [ { @@ -1461,28 +1469,28 @@ "type": "tidelift" } ], - "time": "2024-05-27T13:40:54+00:00" + "time": "2024-11-12T16:29:46+00:00" }, { "name": "composer/semver", - "version": "3.4.0", + "version": "3.4.3", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", + "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1.4", - "symfony/phpunit-bridge": "^4.2 || ^5" + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" }, "type": "library", "extra": { @@ -1526,7 +1534,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.0" + "source": "https://github.com/composer/semver/tree/3.4.3" }, "funding": [ { @@ -1542,7 +1550,7 @@ "type": "tidelift" } ], - "time": "2023-08-31T09:50:34+00:00" + "time": "2024-09-19T14:15:21+00:00" }, { "name": "composer/xdebug-handler", @@ -1612,29 +1620,27 @@ }, { "name": "doctrine/deprecations", - "version": "1.1.3", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9", + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", - "phpstan/phpstan": "1.4.10 || 1.10.15", - "phpstan/phpstan-phpunit": "^1.0", + "doctrine/coding-standard": "^9 || ^12", + "phpstan/phpstan": "1.4.10 || 2.0.3", + "phpstan/phpstan-phpunit": "^1.0 || ^2", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psalm/plugin-phpunit": "0.18.4", - "psr/log": "^1 || ^2 || ^3", - "vimeo/psalm": "4.30.0 || 5.12.0" + "psr/log": "^1 || ^2 || ^3" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" @@ -1642,7 +1648,7 @@ "type": "library", "autoload": { "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + "Doctrine\\Deprecations\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1653,9 +1659,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.3" + "source": "https://github.com/doctrine/deprecations/tree/1.1.4" }, - "time": "2024-01-30T19:34:25+00:00" + "time": "2024-12-07T21:18:45+00:00" }, { "name": "doctrine/instantiator", @@ -1774,16 +1780,16 @@ }, { "name": "fidry/cpu-core-counter", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/theofidry/cpu-core-counter.git", - "reference": "f92996c4d5c1a696a6a970e20f7c4216200fcc42" + "reference": "8520451a140d3f46ac33042715115e290cf5785f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/f92996c4d5c1a696a6a970e20f7c4216200fcc42", - "reference": "f92996c4d5c1a696a6a970e20f7c4216200fcc42", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/8520451a140d3f46ac33042715115e290cf5785f", + "reference": "8520451a140d3f46ac33042715115e290cf5785f", "shasum": "" }, "require": { @@ -1823,7 +1829,7 @@ ], "support": { "issues": "https://github.com/theofidry/cpu-core-counter/issues", - "source": "https://github.com/theofidry/cpu-core-counter/tree/1.1.0" + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.2.0" }, "funding": [ { @@ -1831,20 +1837,20 @@ "type": "github" } ], - "time": "2024-02-07T09:43:46+00:00" + "time": "2024-08-06T10:04:20+00:00" }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.58.0", + "version": "v3.65.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "55d3483c80c09f91d876aa4e2971ce349d07310c" + "reference": "79d4f3e77b250a7d8043d76c6af8f0695e8a469f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/55d3483c80c09f91d876aa4e2971ce349d07310c", - "reference": "55d3483c80c09f91d876aa4e2971ce349d07310c", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/79d4f3e77b250a7d8043d76c6af8f0695e8a469f", + "reference": "79d4f3e77b250a7d8043d76c6af8f0695e8a469f", "shasum": "" }, "require": { @@ -1854,7 +1860,7 @@ "ext-filter": "*", "ext-json": "*", "ext-tokenizer": "*", - "fidry/cpu-core-counter": "^1.0", + "fidry/cpu-core-counter": "^1.2", "php": "^7.4 || ^8.0", "react/child-process": "^0.6.5", "react/event-loop": "^1.0", @@ -1874,18 +1880,18 @@ "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0" }, "require-dev": { - "facile-it/paraunit": "^1.3 || ^2.0", - "infection/infection": "^0.27.11", - "justinrainbow/json-schema": "^5.2", + "facile-it/paraunit": "^1.3.1 || ^2.4", + "infection/infection": "^0.29.8", + "justinrainbow/json-schema": "^5.3 || ^6.0", "keradus/cli-executor": "^2.1", - "mikey179/vfsstream": "^1.6.11", + "mikey179/vfsstream": "^1.6.12", "php-coveralls/php-coveralls": "^2.7", "php-cs-fixer/accessible-object": "^1.1", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.4", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.4", - "phpunit/phpunit": "^9.6 || ^10.5.5 || ^11.0.2", - "symfony/var-dumper": "^5.4 || ^6.0 || ^7.0", - "symfony/yaml": "^5.4 || ^6.0 || ^7.0" + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.5", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.5", + "phpunit/phpunit": "^9.6.21 || ^10.5.38 || ^11.4.3", + "symfony/var-dumper": "^5.4.47 || ^6.4.15 || ^7.1.8", + "symfony/yaml": "^5.4.45 || ^6.4.13 || ^7.1.6" }, "suggest": { "ext-dom": "For handling output formats in XML", @@ -1898,7 +1904,10 @@ "autoload": { "psr-4": { "PhpCsFixer\\": "src/" - } + }, + "exclude-from-classmap": [ + "src/Fixer/Internal/*" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1923,7 +1932,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.58.0" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.65.0" }, "funding": [ { @@ -1931,7 +1940,7 @@ "type": "github" } ], - "time": "2024-05-28T16:55:30+00:00" + "time": "2024-11-25T00:39:24+00:00" }, { "name": "microsoft/tolerant-php-parser", @@ -1980,16 +1989,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.11.1", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", "shasum": "" }, "require": { @@ -1997,11 +2006,12 @@ }, "conflict": { "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { "doctrine/collections": "^1.6.8", "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", @@ -2027,7 +2037,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" }, "funding": [ { @@ -2035,20 +2045,20 @@ "type": "tidelift" } ], - "time": "2023-03-08T13:26:56+00:00" + "time": "2024-11-08T17:47:46+00:00" }, { "name": "netresearch/jsonmapper", - "version": "v4.4.1", + "version": "v4.5.0", "source": { "type": "git", "url": "https://github.com/cweiske/jsonmapper.git", - "reference": "132c75c7dd83e45353ebb9c6c9f591952995bbf0" + "reference": "8e76efb98ee8b6afc54687045e1b8dba55ac76e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/132c75c7dd83e45353ebb9c6c9f591952995bbf0", - "reference": "132c75c7dd83e45353ebb9c6c9f591952995bbf0", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/8e76efb98ee8b6afc54687045e1b8dba55ac76e5", + "reference": "8e76efb98ee8b6afc54687045e1b8dba55ac76e5", "shasum": "" }, "require": { @@ -2084,22 +2094,22 @@ "support": { "email": "cweiske@cweiske.de", "issues": "https://github.com/cweiske/jsonmapper/issues", - "source": "https://github.com/cweiske/jsonmapper/tree/v4.4.1" + "source": "https://github.com/cweiske/jsonmapper/tree/v4.5.0" }, - "time": "2024-01-31T06:18:54+00:00" + "time": "2024-09-08T10:13:13+00:00" }, { "name": "nikic/php-parser", - "version": "v5.0.2", + "version": "v5.3.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13" + "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/139676794dc1e9231bf7bcd123cfc0c99182cb13", - "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8eea230464783aa9671db8eea6f8c6ac5285794b", + "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b", "shasum": "" }, "require": { @@ -2110,7 +2120,7 @@ }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^9.0" }, "bin": [ "bin/php-parse" @@ -2142,22 +2152,22 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.2" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.3.1" }, - "time": "2024-03-05T20:51:40+00:00" + "time": "2024-10-08T18:51:32+00:00" }, { "name": "phan/phan", - "version": "5.4.3", + "version": "5.4.5", "source": { "type": "git", "url": "https://github.com/phan/phan.git", - "reference": "86a7acd99c1239b8867b49feca2398851212e7fe" + "reference": "2b15302175931a0629a85c57d0c1f91d68b26a4d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phan/phan/zipball/86a7acd99c1239b8867b49feca2398851212e7fe", - "reference": "86a7acd99c1239b8867b49feca2398851212e7fe", + "url": "https://api.github.com/repos/phan/phan/zipball/2b15302175931a0629a85c57d0c1f91d68b26a4d", + "reference": "2b15302175931a0629a85c57d0c1f91d68b26a4d", "shasum": "" }, "require": { @@ -2222,9 +2232,9 @@ ], "support": { "issues": "https://github.com/phan/phan/issues", - "source": "https://github.com/phan/phan/tree/5.4.3" + "source": "https://github.com/phan/phan/tree/5.4.5" }, - "time": "2023-12-26T17:57:35+00:00" + "time": "2024-08-13T21:41:35+00:00" }, { "name": "phar-io/manifest", @@ -2399,16 +2409,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.4.1", + "version": "5.6.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c" + "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", - "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8", + "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8", "shasum": "" }, "require": { @@ -2417,17 +2427,17 @@ "php": "^7.4 || ^8.0", "phpdocumentor/reflection-common": "^2.2", "phpdocumentor/type-resolver": "^1.7", - "phpstan/phpdoc-parser": "^1.7", + "phpstan/phpdoc-parser": "^1.7|^2.0", "webmozart/assert": "^1.9.1" }, "require-dev": { - "mockery/mockery": "~1.3.5", + "mockery/mockery": "~1.3.5 || ~1.6.0", "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.8", "phpstan/phpstan-mockery": "^1.1", "phpstan/phpstan-webmozart-assert": "^1.2", "phpunit/phpunit": "^9.5", - "vimeo/psalm": "^5.13" + "psalm/phar": "^5.26" }, "type": "library", "extra": { @@ -2457,29 +2467,29 @@ "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.4.1" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.1" }, - "time": "2024-05-21T05:55:05+00:00" + "time": "2024-12-07T09:39:29+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.8.2", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "153ae662783729388a584b4361f2545e4d841e3c" + "reference": "679e3ce485b99e84c775d28e2e96fade9a7fb50a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/153ae662783729388a584b4361f2545e4d841e3c", - "reference": "153ae662783729388a584b4361f2545e4d841e3c", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/679e3ce485b99e84c775d28e2e96fade9a7fb50a", + "reference": "679e3ce485b99e84c775d28e2e96fade9a7fb50a", "shasum": "" }, "require": { "doctrine/deprecations": "^1.0", "php": "^7.3 || ^8.0", "phpdocumentor/reflection-common": "^2.0", - "phpstan/phpdoc-parser": "^1.13" + "phpstan/phpdoc-parser": "^1.18|^2.0" }, "require-dev": { "ext-tokenizer": "*", @@ -2515,36 +2525,36 @@ "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.8.2" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.10.0" }, - "time": "2024-02-23T11:10:43+00:00" + "time": "2024-11-09T15:12:26+00:00" }, { "name": "phpstan/phpdoc-parser", - "version": "1.29.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "536889f2b340489d328f5ffb7b02bb6b183ddedc" + "reference": "c00d78fb6b29658347f9d37ebe104bffadf36299" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/536889f2b340489d328f5ffb7b02bb6b183ddedc", - "reference": "536889f2b340489d328f5ffb7b02bb6b183ddedc", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/c00d78fb6b29658347f9d37ebe104bffadf36299", + "reference": "c00d78fb6b29658347f9d37ebe104bffadf36299", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { "doctrine/annotations": "^2.0", - "nikic/php-parser": "^4.15", + "nikic/php-parser": "^5.3.0", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.5", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.6", "symfony/process": "^5.2" }, "type": "library", @@ -2562,41 +2572,41 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.29.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.0.0" }, - "time": "2024-05-06T12:04:23+00:00" + "time": "2024-10-13T11:29:49+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.31", + "version": "9.2.32", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965" + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/48c34b5d8d983006bd2adc2d0de92963b9155965", - "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.18 || ^5.0", + "nikic/php-parser": "^4.19.1 || ^5.1.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" + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-text-template": "^2.0.4", + "sebastian/code-unit-reverse-lookup": "^2.0.3", + "sebastian/complexity": "^2.0.3", + "sebastian/environment": "^5.1.5", + "sebastian/lines-of-code": "^1.0.4", + "sebastian/version": "^3.0.2", + "theseer/tokenizer": "^1.2.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^9.6" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -2605,7 +2615,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.2-dev" + "dev-main": "9.2.x-dev" } }, "autoload": { @@ -2634,7 +2644,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.31" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" }, "funding": [ { @@ -2642,7 +2652,7 @@ "type": "github" } ], - "time": "2024-03-02T06:37:42+00:00" + "time": "2024-08-22T04:23:01+00:00" }, { "name": "phpunit/php-file-iterator", @@ -2887,45 +2897,45 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.19", + "version": "9.6.22", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a1a54a473501ef4cdeaae4e06891674114d79db8" + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a1a54a473501ef4cdeaae4e06891674114d79db8", - "reference": "a1a54a473501ef4cdeaae4e06891674114d79db8", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c", + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1 || ^2", + "doctrine/instantiator": "^1.5.0 || ^2", "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", + "myclabs/deep-copy": "^1.12.1", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.28", - "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-code-coverage": "^9.2.32", + "phpunit/php-file-iterator": "^3.0.6", "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", + "phpunit/php-text-template": "^2.0.4", + "phpunit/php-timer": "^5.0.3", + "sebastian/cli-parser": "^1.0.2", + "sebastian/code-unit": "^1.0.8", "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.5", - "sebastian/global-state": "^5.0.1", - "sebastian/object-enumerator": "^4.0.3", - "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.2", + "sebastian/diff": "^4.0.6", + "sebastian/environment": "^5.1.5", + "sebastian/exporter": "^4.0.6", + "sebastian/global-state": "^5.0.7", + "sebastian/object-enumerator": "^4.0.4", + "sebastian/resource-operations": "^3.0.4", + "sebastian/type": "^3.2.1", "sebastian/version": "^3.0.2" }, "suggest": { @@ -2970,7 +2980,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.19" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22" }, "funding": [ { @@ -2986,7 +2996,7 @@ "type": "tidelift" } ], - "time": "2024-04-05T04:35:58+00:00" + "time": "2024-12-05T13:48:26+00:00" }, { "name": "psr/container", @@ -3172,25 +3182,25 @@ }, { "name": "sabre/event", - "version": "5.1.4", + "version": "5.1.7", "source": { "type": "git", "url": "https://github.com/sabre-io/event.git", - "reference": "d7da22897125d34d7eddf7977758191c06a74497" + "reference": "86d57e305c272898ba3c28e9bd3d65d5464587c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sabre-io/event/zipball/d7da22897125d34d7eddf7977758191c06a74497", - "reference": "d7da22897125d34d7eddf7977758191c06a74497", + "url": "https://api.github.com/repos/sabre-io/event/zipball/86d57e305c272898ba3c28e9bd3d65d5464587c2", + "reference": "86d57e305c272898ba3c28e9bd3d65d5464587c2", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "~2.17.1", + "friendsofphp/php-cs-fixer": "~2.17.1||^3.63", "phpstan/phpstan": "^0.12", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.0" + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6" }, "type": "library", "autoload": { @@ -3234,7 +3244,7 @@ "issues": "https://github.com/sabre-io/event/issues", "source": "https://github.com/fruux/sabre-event" }, - "time": "2021-11-04T06:51:17+00:00" + "time": "2024-08-27T11:23:05+00:00" }, { "name": "sebastian/cli-parser", @@ -4201,16 +4211,16 @@ }, { "name": "symfony/console", - "version": "v7.0.7", + "version": "v7.2.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "c981e0e9380ce9f146416bde3150c79197ce9986" + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/c981e0e9380ce9f146416bde3150c79197ce9986", - "reference": "c981e0e9380ce9f146416bde3150c79197ce9986", + "url": "https://api.github.com/repos/symfony/console/zipball/fefcc18c0f5d0efe3ab3152f15857298868dc2c3", + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3", "shasum": "" }, "require": { @@ -4274,7 +4284,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.0.7" + "source": "https://github.com/symfony/console/tree/v7.2.1" }, "funding": [ { @@ -4290,20 +4300,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-12-11T03:49:26+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v7.0.7", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "db2a7fab994d67d92356bb39c367db115d9d30f9" + "reference": "910c5db85a5356d0fea57680defec4e99eb9c8c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/db2a7fab994d67d92356bb39c367db115d9d30f9", - "reference": "db2a7fab994d67d92356bb39c367db115d9d30f9", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/910c5db85a5356d0fea57680defec4e99eb9c8c1", + "reference": "910c5db85a5356d0fea57680defec4e99eb9c8c1", "shasum": "" }, "require": { @@ -4354,7 +4364,7 @@ "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/v7.0.7" + "source": "https://github.com/symfony/event-dispatcher/tree/v7.2.0" }, "funding": [ { @@ -4370,20 +4380,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-09-25T14:21:43+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "8f93aec25d41b72493c6ddff14e916177c9efc50" + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/8f93aec25d41b72493c6ddff14e916177c9efc50", - "reference": "8f93aec25d41b72493c6ddff14e916177c9efc50", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7642f5e970b672283b7823222ae8ef8bbc160b9f", + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f", "shasum": "" }, "require": { @@ -4430,7 +4440,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.5.1" }, "funding": [ { @@ -4446,26 +4456,28 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/filesystem", - "version": "v7.0.7", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "cc168be6fbdcdf3401f50ae863ee3818ed4338f5" + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/cc168be6fbdcdf3401f50ae863ee3818ed4338f5", - "reference": "cc168be6fbdcdf3401f50ae863ee3818ed4338f5", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b8dce482de9d7c9fe2891155035a7248ab5c7fdb", + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb", "shasum": "" }, "require": { "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8", + "symfony/polyfill-mbstring": "~1.8" + }, + "require-dev": { "symfony/process": "^6.4|^7.0" }, "type": "library", @@ -4494,7 +4506,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.0.7" + "source": "https://github.com/symfony/filesystem/tree/v7.2.0" }, "funding": [ { @@ -4510,20 +4522,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-10-25T15:15:23+00:00" }, { "name": "symfony/finder", - "version": "v7.0.7", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "4d58f0f4fe95a30d7b538d71197135483560b97c" + "reference": "6de263e5868b9a137602dd1e33e4d48bfae99c49" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/4d58f0f4fe95a30d7b538d71197135483560b97c", - "reference": "4d58f0f4fe95a30d7b538d71197135483560b97c", + "url": "https://api.github.com/repos/symfony/finder/zipball/6de263e5868b9a137602dd1e33e4d48bfae99c49", + "reference": "6de263e5868b9a137602dd1e33e4d48bfae99c49", "shasum": "" }, "require": { @@ -4558,7 +4570,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.0.7" + "source": "https://github.com/symfony/finder/tree/v7.2.0" }, "funding": [ { @@ -4574,20 +4586,20 @@ "type": "tidelift" } ], - "time": "2024-04-28T11:44:19+00:00" + "time": "2024-10-23T06:56:12+00:00" }, { "name": "symfony/options-resolver", - "version": "v7.0.7", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "23cc173858776ad451e31f053b1c9f47840b2cfa" + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/23cc173858776ad451e31f053b1c9f47840b2cfa", - "reference": "23cc173858776ad451e31f053b1c9f47840b2cfa", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/7da8fbac9dcfef75ffc212235d76b2754ce0cf50", + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50", "shasum": "" }, "require": { @@ -4625,7 +4637,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v7.0.7" + "source": "https://github.com/symfony/options-resolver/tree/v7.2.0" }, "funding": [ { @@ -4641,24 +4653,24 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-11-20T11:17:29+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.29.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-ctype": "*" @@ -4669,8 +4681,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -4704,7 +4716,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" }, "funding": [ { @@ -4720,24 +4732,24 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.29.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f" + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f", - "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" @@ -4745,8 +4757,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -4782,7 +4794,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" }, "funding": [ { @@ -4798,24 +4810,24 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.29.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "bc45c394692b948b4d383a08d7753968bed9a83d" + "reference": "3833d7255cc303546435cb650316bff708a1c75c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d", - "reference": "bc45c394692b948b4d383a08d7753968bed9a83d", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" @@ -4823,8 +4835,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -4863,7 +4875,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" }, "funding": [ { @@ -4879,24 +4891,24 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.29.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-mbstring": "*" @@ -4907,8 +4919,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -4943,7 +4955,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" }, "funding": [ { @@ -4959,30 +4971,30 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.29.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -5023,7 +5035,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" }, "funding": [ { @@ -5039,30 +5051,30 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.29.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d" + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/c565ad1e63f30e7477fc40738343c62b40bc672d", - "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -5099,7 +5111,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0" }, "funding": [ { @@ -5115,20 +5127,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/process", - "version": "v7.0.7", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "3839e56b94dd1dbd13235d27504e66baf23faba0" + "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/3839e56b94dd1dbd13235d27504e66baf23faba0", - "reference": "3839e56b94dd1dbd13235d27504e66baf23faba0", + "url": "https://api.github.com/repos/symfony/process/zipball/d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", + "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", "shasum": "" }, "require": { @@ -5160,7 +5172,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.0.7" + "source": "https://github.com/symfony/process/tree/v7.2.0" }, "funding": [ { @@ -5176,20 +5188,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-11-06T14:24:19+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f" + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0", "shasum": "" }, "require": { @@ -5243,7 +5255,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.5.1" }, "funding": [ { @@ -5259,20 +5271,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/stopwatch", - "version": "v7.0.7", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "41a7a24aa1dc82adf46a06bc292d1923acfe6b84" + "reference": "696f418b0d722a4225e1c3d95489d262971ca924" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/41a7a24aa1dc82adf46a06bc292d1923acfe6b84", - "reference": "41a7a24aa1dc82adf46a06bc292d1923acfe6b84", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/696f418b0d722a4225e1c3d95489d262971ca924", + "reference": "696f418b0d722a4225e1c3d95489d262971ca924", "shasum": "" }, "require": { @@ -5305,7 +5317,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v7.0.7" + "source": "https://github.com/symfony/stopwatch/tree/v7.2.0" }, "funding": [ { @@ -5321,20 +5333,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-09-25T14:21:43+00:00" }, { "name": "symfony/string", - "version": "v7.0.7", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "e405b5424dc2528e02e31ba26b83a79fd4eb8f63" + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/e405b5424dc2528e02e31ba26b83a79fd4eb8f63", - "reference": "e405b5424dc2528e02e31ba26b83a79fd4eb8f63", + "url": "https://api.github.com/repos/symfony/string/zipball/446e0d146f991dde3e73f45f2c97a9faad773c82", + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82", "shasum": "" }, "require": { @@ -5348,6 +5360,7 @@ "symfony/translation-contracts": "<2.5" }, "require-dev": { + "symfony/emoji": "^7.1", "symfony/error-handler": "^6.4|^7.0", "symfony/http-client": "^6.4|^7.0", "symfony/intl": "^6.4|^7.0", @@ -5391,7 +5404,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.0.7" + "source": "https://github.com/symfony/string/tree/v7.2.0" }, "funding": [ { @@ -5407,7 +5420,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-11-13T13:31:26+00:00" }, { "name": "theseer/tokenizer", diff --git a/examples/spot/blvt/blvtRedeem.php b/examples/spot/autoinvest/autoInvestAllSourceAssetTargetAsset.php similarity index 80% rename from examples/spot/blvt/blvtRedeem.php rename to examples/spot/autoinvest/autoInvestAllSourceAssetTargetAsset.php index 5be3997..9609380 100644 --- a/examples/spot/blvt/blvtRedeem.php +++ b/examples/spot/autoinvest/autoInvestAllSourceAssetTargetAsset.php @@ -10,9 +10,7 @@ 'secret' => $secret ]); -$response = $client->blvtRedeem( - 'BTCDOWN', - 1.01, +$response = $client->autoInvestAllSourceAssetTargetAsset( [ 'recvWindow' => 5000 ] diff --git a/examples/spot/autoinvest/autoInvestChangePlanStatus.php b/examples/spot/autoinvest/autoInvestChangePlanStatus.php new file mode 100644 index 0000000..1a523b7 --- /dev/null +++ b/examples/spot/autoinvest/autoInvestChangePlanStatus.php @@ -0,0 +1,15 @@ +autoInvestChangePlanStatus( + 1, + 'ONGOING', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/autoinvest/autoInvestHoldingDetailsPlan.php b/examples/spot/autoinvest/autoInvestHoldingDetailsPlan.php new file mode 100644 index 0000000..aca4e90 --- /dev/null +++ b/examples/spot/autoinvest/autoInvestHoldingDetailsPlan.php @@ -0,0 +1,13 @@ +autoInvestHoldingDetailsPlan( + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/savings/savingsCustomizedPosition.php b/examples/spot/autoinvest/autoInvestIndexDetails.php similarity index 80% rename from examples/spot/savings/savingsCustomizedPosition.php rename to examples/spot/autoinvest/autoInvestIndexDetails.php index 52333e4..fad16b1 100644 --- a/examples/spot/savings/savingsCustomizedPosition.php +++ b/examples/spot/autoinvest/autoInvestIndexDetails.php @@ -10,8 +10,8 @@ 'secret' => $secret ]); -$response = $client->savingsCustomizedPosition( - 'BTC', +$response = $client->autoInvestIndexDetails( + 1, [ 'recvWindow' => 5000 ] diff --git a/examples/spot/savings/savingsPurchaseCustomizedProject.php b/examples/spot/autoinvest/autoInvestIndexLinkedPlanPositionDetails.php similarity index 78% rename from examples/spot/savings/savingsPurchaseCustomizedProject.php rename to examples/spot/autoinvest/autoInvestIndexLinkedPlanPositionDetails.php index 0cb229d..d2bd8b3 100644 --- a/examples/spot/savings/savingsPurchaseCustomizedProject.php +++ b/examples/spot/autoinvest/autoInvestIndexLinkedPlanPositionDetails.php @@ -10,8 +10,7 @@ 'secret' => $secret ]); -$response = $client->savingsPurchaseCustomizedProject( - '1234', +$response = $client->autoInvestIndexLinkedPlanPositionDetails( 1, [ 'recvWindow' => 5000 diff --git a/examples/spot/savings/savingsPurchaseRecord.php b/examples/spot/autoinvest/autoInvestIndexLinkedPlanRebalanceDetails.php similarity index 77% rename from examples/spot/savings/savingsPurchaseRecord.php rename to examples/spot/autoinvest/autoInvestIndexLinkedPlanRebalanceDetails.php index cfa54f1..679b36e 100644 --- a/examples/spot/savings/savingsPurchaseRecord.php +++ b/examples/spot/autoinvest/autoInvestIndexLinkedPlanRebalanceDetails.php @@ -10,10 +10,8 @@ 'secret' => $secret ]); -$response = $client->savingsPurchaseRecord( - 'DAILY', +$response = $client->autoInvestIndexLinkedPlanRebalanceDetails( [ - 'asset' => 'BNB', 'current' => 1, 'size' => 100, 'recvWindow' => 5000 diff --git a/examples/spot/autoinvest/autoInvestIndexLinkedPlanRedemption.php b/examples/spot/autoinvest/autoInvestIndexLinkedPlanRedemption.php new file mode 100644 index 0000000..2d5e0e0 --- /dev/null +++ b/examples/spot/autoinvest/autoInvestIndexLinkedPlanRedemption.php @@ -0,0 +1,22 @@ + $key, + 'secret' => $secret +]); + +$response = $client->autoInvestIndexLinkedPlanRedemption( + 123456, + 10, + [ + 'requestId' => 'TR12354859', + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/autoinvest/autoInvestIndexLinkedPlanRedemptionHistory.php b/examples/spot/autoinvest/autoInvestIndexLinkedPlanRedemptionHistory.php new file mode 100644 index 0000000..b35b4e4 --- /dev/null +++ b/examples/spot/autoinvest/autoInvestIndexLinkedPlanRedemptionHistory.php @@ -0,0 +1,23 @@ + $key, + 'secret' => $secret +]); + +$response = $client->autoInvestIndexLinkedPlanRedemptionHistory( + 12345, + [ + 'current' => 1, + 'asset' => 'BTC', + 'size' => 100, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/autoinvest/autoInvestListPlans.php b/examples/spot/autoinvest/autoInvestListPlans.php new file mode 100644 index 0000000..f28f63b --- /dev/null +++ b/examples/spot/autoinvest/autoInvestListPlans.php @@ -0,0 +1,14 @@ +autoInvestListPlans( + 'SINGLE', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/blvt/blvtSubscriptionRecord.php b/examples/spot/autoinvest/autoInvestOneTimeTransaction.php similarity index 52% rename from examples/spot/blvt/blvtSubscriptionRecord.php rename to examples/spot/autoinvest/autoInvestOneTimeTransaction.php index e737660..9a60696 100644 --- a/examples/spot/blvt/blvtSubscriptionRecord.php +++ b/examples/spot/autoinvest/autoInvestOneTimeTransaction.php @@ -10,13 +10,15 @@ 'secret' => $secret ]); -$response = $client->blvtSubscriptionRecord( +$response = $client->autoInvestOneTimeTransaction( + 'MAIN_SITE', + 10.1, + 'USDT', [ - 'tokenName' => 'BTCUP', - 'id' => 123, - 'startTime' => 1640995200000, - 'endTime' => 1640995200000, - 'limit' => 500, + 'requestId' => 'TR12354859', + 'flexibleAllowedToUse' => true, + 'planId' => 12345, + 'indexId' => 1, 'recvWindow' => 5000 ] ); diff --git a/examples/spot/autoinvest/autoInvestOnetimeTransactionStatus.php b/examples/spot/autoinvest/autoInvestOnetimeTransactionStatus.php new file mode 100644 index 0000000..f215f19 --- /dev/null +++ b/examples/spot/autoinvest/autoInvestOnetimeTransactionStatus.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->autoInvestOnetimeTransactionStatus( + 12345, + [ + 'requestId' => 'TR12354859', + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/autoinvest/autoInvestPlanAdjustment.php b/examples/spot/autoinvest/autoInvestPlanAdjustment.php new file mode 100644 index 0000000..6df4a5f --- /dev/null +++ b/examples/spot/autoinvest/autoInvestPlanAdjustment.php @@ -0,0 +1,19 @@ +autoInvestPlanAdjustment( + 1, + 1.0, + 'WEEKLY', + 1, + 'USDT', + [ + 'flexibleAllowedToUse' => true, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/autoinvest/autoInvestPlanCreation.php b/examples/spot/autoinvest/autoInvestPlanCreation.php new file mode 100644 index 0000000..38890c3 --- /dev/null +++ b/examples/spot/autoinvest/autoInvestPlanCreation.php @@ -0,0 +1,32 @@ + $key, + 'secret' => $secret +]); + +$response = $client->autoInvestPlanCreation( + 'MAIN_SITE', + 'SINGLE', + 1.0, + 'WEEKLY', + 2, + 'USDT', + [ + [ + 'targetAsset' => 'BNB', + 'percentage' => 50 + ] + ], + [ + 'flexibleAllowedToUse' => true, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/autoinvest/autoInvestSourceAssetList.php b/examples/spot/autoinvest/autoInvestSourceAssetList.php new file mode 100644 index 0000000..c70454a --- /dev/null +++ b/examples/spot/autoinvest/autoInvestSourceAssetList.php @@ -0,0 +1,23 @@ + $key, + 'secret' => $secret +]); + +$response = $client->autoInvestSourceAssetList( + 'RECURRING', + [ + 'targetAsset' => 'BTC', + 'indexId' => 1, + 'flexibleAllowedToUse' => true, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/autoinvest/autoInvestSubscriptionTransactionHistory.php b/examples/spot/autoinvest/autoInvestSubscriptionTransactionHistory.php new file mode 100644 index 0000000..473a5f0 --- /dev/null +++ b/examples/spot/autoinvest/autoInvestSubscriptionTransactionHistory.php @@ -0,0 +1,15 @@ +autoInvestSubscriptionTransactionHistory( + [ + 'size' => 100, + 'current' => 1, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/cryptoloans/cryptoLoansBorrow.php b/examples/spot/autoinvest/autoInvestTargetAssetList.php similarity index 77% rename from examples/spot/cryptoloans/cryptoLoansBorrow.php rename to examples/spot/autoinvest/autoInvestTargetAssetList.php index 0a47b6a..694c2aa 100644 --- a/examples/spot/cryptoloans/cryptoLoansBorrow.php +++ b/examples/spot/autoinvest/autoInvestTargetAssetList.php @@ -10,11 +10,9 @@ 'secret' => $secret ]); -$response = $client->cryptoLoansBorrow( - 'BUSD', - 'BNB', - 15, +$response = $client->autoInvestTargetAssetList( [ + 'size' => 100, 'recvWindow' => 5000 ] ); diff --git a/examples/spot/savings/savingsFlexibleProductPosition.php b/examples/spot/autoinvest/autoInvestTargetAssetRoiData.php similarity index 78% rename from examples/spot/savings/savingsFlexibleProductPosition.php rename to examples/spot/autoinvest/autoInvestTargetAssetRoiData.php index 1a13562..e949927 100644 --- a/examples/spot/savings/savingsFlexibleProductPosition.php +++ b/examples/spot/autoinvest/autoInvestTargetAssetRoiData.php @@ -10,8 +10,9 @@ 'secret' => $secret ]); -$response = $client->savingsFlexibleProductPosition( +$response = $client->autoInvestTargetAssetRoiData( 'BTC', + 'FIVE_YEAR', [ 'recvWindow' => 5000 ] diff --git a/examples/spot/blvt/blvtInfo.php b/examples/spot/blvt/blvtInfo.php deleted file mode 100644 index 18b871b..0000000 --- a/examples/spot/blvt/blvtInfo.php +++ /dev/null @@ -1,17 +0,0 @@ - $key -]); - -$response = $client->blvtInfo( - [ - 'tokenName' => 'BTCUP' - ] -); - -echo json_encode($response); diff --git a/examples/spot/blvt/blvtRedemptionRecord.php b/examples/spot/blvt/blvtRedemptionRecord.php deleted file mode 100644 index 5ccd75c..0000000 --- a/examples/spot/blvt/blvtRedemptionRecord.php +++ /dev/null @@ -1,23 +0,0 @@ - $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/cryptoloans/cryptoLoansAdjustLtv.php b/examples/spot/cryptoloans/cryptoLoansAdjustLtv.php index 7afc39b..82dbc98 100644 --- a/examples/spot/cryptoloans/cryptoLoansAdjustLtv.php +++ b/examples/spot/cryptoloans/cryptoLoansAdjustLtv.php @@ -11,7 +11,8 @@ ]); $response = $client->cryptoLoansAdjustLtv( - 100000001, + 'BUSD', + 'BNB', 1.01, 'ADDITIONAL', [ diff --git a/examples/spot/cryptoloans/cryptoLoansOngoingOrders.php b/examples/spot/cryptoloans/cryptoLoansAdjustLtvHistory.php similarity index 67% rename from examples/spot/cryptoloans/cryptoLoansOngoingOrders.php rename to examples/spot/cryptoloans/cryptoLoansAdjustLtvHistory.php index 7b52a25..c96b038 100644 --- a/examples/spot/cryptoloans/cryptoLoansOngoingOrders.php +++ b/examples/spot/cryptoloans/cryptoLoansAdjustLtvHistory.php @@ -10,10 +10,12 @@ 'secret' => $secret ]); -$response = $client->cryptoLoansOngoingOrders( +$response = $client->cryptoLoansAdjustLtvHistory( [ - 'orderId' => 100000001, 'loanCoin' => 'BUSD', + 'collateralCoin' => 'BNB', + 'current' => 1, + 'limit' => 5, 'recvWindow' => 5000 ] ); diff --git a/examples/spot/cryptoloans/cryptoLoansLoanableData.php b/examples/spot/cryptoloans/cryptoLoansFlexibleAssetsData.php similarity index 84% rename from examples/spot/cryptoloans/cryptoLoansLoanableData.php rename to examples/spot/cryptoloans/cryptoLoansFlexibleAssetsData.php index c6cf0a0..685a7ef 100644 --- a/examples/spot/cryptoloans/cryptoLoansLoanableData.php +++ b/examples/spot/cryptoloans/cryptoLoansFlexibleAssetsData.php @@ -10,7 +10,7 @@ 'secret' => $secret ]); -$response = $client->cryptoLoansLoanableData( +$response = $client->cryptoLoansFlexibleAssetsData( [ 'loanCoin' => 'BUSD', 'recvWindow' => 5000 diff --git a/examples/spot/cryptoloans/cryptoLoansFlexibleBorrow.php b/examples/spot/cryptoloans/cryptoLoansFlexibleBorrow.php new file mode 100644 index 0000000..8877adf --- /dev/null +++ b/examples/spot/cryptoloans/cryptoLoansFlexibleBorrow.php @@ -0,0 +1,23 @@ + $key, + 'secret' => $secret +]); + +$response = $client->cryptoLoansFlexibleBorrow( + 'BUSD', + 'BNB', + [ + 'loanAmount' => 100.1, + 'collateralAmount' => 50.5, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/cryptoloans/cryptoLoansFlexibleBorrowHistory.php b/examples/spot/cryptoloans/cryptoLoansFlexibleBorrowHistory.php new file mode 100644 index 0000000..c2ca4c0 --- /dev/null +++ b/examples/spot/cryptoloans/cryptoLoansFlexibleBorrowHistory.php @@ -0,0 +1,23 @@ + $key, + 'secret' => $secret +]); + +$response = $client->cryptoLoansFlexibleBorrowHistory( + [ + 'loanCoin' => 'BUSD', + 'collateralCoin' => 'BNB', + 'current' => 1, + 'limit' => 5, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/cryptoloans/cryptoLoansCustomizeMarginCall.php b/examples/spot/cryptoloans/cryptoLoansFlexibleCollateralAssetsData.php similarity index 74% rename from examples/spot/cryptoloans/cryptoLoansCustomizeMarginCall.php rename to examples/spot/cryptoloans/cryptoLoansFlexibleCollateralAssetsData.php index c1a5717..c5b3d78 100644 --- a/examples/spot/cryptoloans/cryptoLoansCustomizeMarginCall.php +++ b/examples/spot/cryptoloans/cryptoLoansFlexibleCollateralAssetsData.php @@ -10,10 +10,8 @@ 'secret' => $secret ]); -$response = $client->cryptoLoansCustomizeMarginCall( - 0.1, +$response = $client->cryptoLoansFlexibleCollateralAssetsData( [ - 'orderID' => 100000001, 'collateralCoin' => 'BNB', 'recvWindow' => 5000 ] diff --git a/examples/spot/cryptoloans/cryptoLoansFlexibleOngoingOrders.php b/examples/spot/cryptoloans/cryptoLoansFlexibleOngoingOrders.php new file mode 100644 index 0000000..750cbd7 --- /dev/null +++ b/examples/spot/cryptoloans/cryptoLoansFlexibleOngoingOrders.php @@ -0,0 +1,23 @@ + $key, + 'secret' => $secret +]); + +$response = $client->cryptoLoansFlexibleOngoingOrders( + [ + 'loanCoin' => 'BUSD', + 'collateralCoin' => 'BNB', + 'current' => 1, + 'limit' => 5, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/cryptoloans/cryptoLoansFlexibleRepay.php b/examples/spot/cryptoloans/cryptoLoansFlexibleRepay.php new file mode 100644 index 0000000..4e86ff9 --- /dev/null +++ b/examples/spot/cryptoloans/cryptoLoansFlexibleRepay.php @@ -0,0 +1,24 @@ + $key, + 'secret' => $secret +]); + +$response = $client->cryptoLoansFlexibleRepay( + 'BUSD', + 'BNB', + 1.01, + [ + 'collateralReturn' => true, + 'fullRepayment' => true, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/cryptoloans/cryptoLoansFlexibleRepayHistory.php b/examples/spot/cryptoloans/cryptoLoansFlexibleRepayHistory.php new file mode 100644 index 0000000..08f1267 --- /dev/null +++ b/examples/spot/cryptoloans/cryptoLoansFlexibleRepayHistory.php @@ -0,0 +1,23 @@ + $key, + 'secret' => $secret +]); + +$response = $client->cryptoLoansFlexibleRepayHistory( + [ + 'loanCoin' => 'BUSD', + 'collateralCoin' => 'BNB', + 'current' => 1, + 'limit' => 5, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/giftcard/giftCardBuyCode.php b/examples/spot/giftcard/giftCardBuyCode.php index b14737a..6784d26 100644 --- a/examples/spot/giftcard/giftCardBuyCode.php +++ b/examples/spot/giftcard/giftCardBuyCode.php @@ -13,7 +13,7 @@ $response = $client->giftCardBuyCode( 'BUSD', 'BNB', - 1.01, + 1.002, [ 'recvWindow' => 5000 ] diff --git a/examples/spot/margin/marginNewOtoOrder.php b/examples/spot/margin/marginNewOtoOrder.php new file mode 100644 index 0000000..137d8fc --- /dev/null +++ b/examples/spot/margin/marginNewOtoOrder.php @@ -0,0 +1,29 @@ + $key, + 'secret' => $secret +]); + +$response = $client->marginNewOtoOrder( + 'BNBUSDT', + 'LIMIT', + 'BUY', + 600, + 1, + 'LIMIT', + 'BUY', + 1, + [ + 'workingTimeInForce' => 'GTC', + 'pendingPrice' => 595, + 'pendingTimeInForce' => 'GTC' + ] +); + +echo json_encode($response); diff --git a/examples/spot/margin/marginNewOtocoOrder.php b/examples/spot/margin/marginNewOtocoOrder.php new file mode 100644 index 0000000..ae23b54 --- /dev/null +++ b/examples/spot/margin/marginNewOtocoOrder.php @@ -0,0 +1,31 @@ + $key, + 'secret' => $secret +]); + +$response = $client->marginNewOtocoOrder( + 'BNBUSDT', + 'LIMIT', + 'BUY', + 600, + 1, + 'SELL', + 1, + 'LIMIT_MAKER', + [ + 'workingTimeInForce' => 'GTC', + 'pendingAbovePrice' => 605, + 'pendingBelowType' => 'LIMIT_MAKER', + 'pendingBelowPrice' => 595, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/cryptoloans/cryptoLoansCollateralData.php b/examples/spot/portfoliomargin/portfolioMarginProBalance.php similarity index 83% rename from examples/spot/cryptoloans/cryptoLoansCollateralData.php rename to examples/spot/portfoliomargin/portfolioMarginProBalance.php index 787523c..6cb0ec1 100644 --- a/examples/spot/cryptoloans/cryptoLoansCollateralData.php +++ b/examples/spot/portfoliomargin/portfolioMarginProBalance.php @@ -10,7 +10,7 @@ 'secret' => $secret ]); -$response = $client->cryptoLoansCollateralData( +$response = $client->portfolioMarginProBalance( [ 'recvWindow' => 5000 ] diff --git a/examples/spot/portfoliomargin/portfolioMarginProSpanAccount.php b/examples/spot/portfoliomargin/portfolioMarginProSpanAccount.php new file mode 100644 index 0000000..579f067 --- /dev/null +++ b/examples/spot/portfoliomargin/portfolioMarginProSpanAccount.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->portfolioMarginProSpanAccount( + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/blvt/blvtSubscribe.php b/examples/spot/portfoliomargin/portfolioMarginProTieredCollateralRate.php similarity index 80% rename from examples/spot/blvt/blvtSubscribe.php rename to examples/spot/portfoliomargin/portfolioMarginProTieredCollateralRate.php index 596b5fb..448fe0b 100644 --- a/examples/spot/blvt/blvtSubscribe.php +++ b/examples/spot/portfoliomargin/portfolioMarginProTieredCollateralRate.php @@ -10,9 +10,7 @@ 'secret' => $secret ]); -$response = $client->blvtSubscribe( - 'BTCDOWN', - 1.01, +$response = $client->portfolioMarginProTieredCollateralRate( [ 'recvWindow' => 5000 ] diff --git a/examples/spot/savings/savingsFlexiblePurchaseQuota.php b/examples/spot/savings/savingsFlexiblePurchaseQuota.php deleted file mode 100644 index d3fd05e..0000000 --- a/examples/spot/savings/savingsFlexiblePurchaseQuota.php +++ /dev/null @@ -1,20 +0,0 @@ - $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 deleted file mode 100644 index 8055a59..0000000 --- a/examples/spot/savings/savingsFlexibleRedemptionQuota.php +++ /dev/null @@ -1,21 +0,0 @@ - $key, - 'secret' => $secret -]); - -$response = $client->savingsFlexibleRedemptionQuota( - '1234', - 'FAST', - [ - 'recvWindow' => 5000 - ] -); - -echo json_encode($response); diff --git a/examples/spot/savings/savingsRedemptionRecord.php b/examples/spot/savings/savingsRedemptionRecord.php deleted file mode 100644 index 35a2d42..0000000 --- a/examples/spot/savings/savingsRedemptionRecord.php +++ /dev/null @@ -1,23 +0,0 @@ - $key, - 'secret' => $secret -]); - -$response = $client->savingsRedemptionRecord( - 'DAILY', - [ - 'asset' => 'BNB', - 'current' => 1, - 'size' => 100, - 'recvWindow' => 5000 - ] -); - -echo json_encode($response); diff --git a/examples/spot/savings/savingsFlexibleProducts.php b/examples/spot/simpleearn/simpleEarnCollateralRecord.php similarity index 85% rename from examples/spot/savings/savingsFlexibleProducts.php rename to examples/spot/simpleearn/simpleEarnCollateralRecord.php index 6702008..2e18035 100644 --- a/examples/spot/savings/savingsFlexibleProducts.php +++ b/examples/spot/simpleearn/simpleEarnCollateralRecord.php @@ -10,7 +10,7 @@ 'secret' => $secret ]); -$response = $client->savingsFlexibleProducts( +$response = $client->simpleEarnCollateralRecord( [ 'current' => 1, 'size' => 100, diff --git a/examples/spot/simpleearn/simpleEarnFlexiblePersonalLeftQuota.php b/examples/spot/simpleearn/simpleEarnFlexiblePersonalLeftQuota.php new file mode 100644 index 0000000..924c66a --- /dev/null +++ b/examples/spot/simpleearn/simpleEarnFlexiblePersonalLeftQuota.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->simpleEarnFlexiblePersonalLeftQuota( + '1', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/savings/savingsInterestHistory.php b/examples/spot/simpleearn/simpleEarnFlexibleProductList.php similarity index 77% rename from examples/spot/savings/savingsInterestHistory.php rename to examples/spot/simpleearn/simpleEarnFlexibleProductList.php index 9083c7e..8aab6e5 100644 --- a/examples/spot/savings/savingsInterestHistory.php +++ b/examples/spot/simpleearn/simpleEarnFlexibleProductList.php @@ -10,10 +10,9 @@ 'secret' => $secret ]); -$response = $client->savingsInterestHistory( - 'DAILY', +$response = $client->simpleEarnFlexibleProductList( [ - 'asset' => 'BNB', + 'asset' => 'BTC', 'current' => 1, 'size' => 100, 'recvWindow' => 5000 diff --git a/examples/spot/simpleearn/simpleEarnFlexibleProductPosition.php b/examples/spot/simpleearn/simpleEarnFlexibleProductPosition.php new file mode 100644 index 0000000..01ece0e --- /dev/null +++ b/examples/spot/simpleearn/simpleEarnFlexibleProductPosition.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->simpleEarnFlexibleProductPosition( + [ + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/simpleearn/simpleEarnFlexibleRedemptionRecord.php b/examples/spot/simpleearn/simpleEarnFlexibleRedemptionRecord.php new file mode 100644 index 0000000..b6b37ca --- /dev/null +++ b/examples/spot/simpleearn/simpleEarnFlexibleRedemptionRecord.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->simpleEarnFlexibleRedemptionRecord( + [ + 'current' => 1, + 'size' => 100 + ] +); + +echo json_encode($response); diff --git a/examples/spot/simpleearn/simpleEarnFlexibleRewardsHistory.php b/examples/spot/simpleearn/simpleEarnFlexibleRewardsHistory.php new file mode 100644 index 0000000..d4537c8 --- /dev/null +++ b/examples/spot/simpleearn/simpleEarnFlexibleRewardsHistory.php @@ -0,0 +1,15 @@ + $key, + 'secret' => $secret +]); + +$response = $client->simpleEarnFlexibleRewardsHistory('ALL'); + +echo json_encode($response); diff --git a/examples/spot/savings/SavingsFlexibleRedeem.php b/examples/spot/simpleearn/simpleEarnFlexibleSubscriptionPreview.php similarity index 78% rename from examples/spot/savings/SavingsFlexibleRedeem.php rename to examples/spot/simpleearn/simpleEarnFlexibleSubscriptionPreview.php index 1d25474..dc5d188 100644 --- a/examples/spot/savings/SavingsFlexibleRedeem.php +++ b/examples/spot/simpleearn/simpleEarnFlexibleSubscriptionPreview.php @@ -10,10 +10,9 @@ 'secret' => $secret ]); -$response = $client->savingsFlexibleRedeem( - '1234', +$response = $client->simpleEarnFlexibleSubscriptionPreview( + '1', 1.01, - 'FAST', [ 'recvWindow' => 5000 ] diff --git a/examples/spot/simpleearn/simpleEarnFlexibleSubscriptionRecord.php b/examples/spot/simpleearn/simpleEarnFlexibleSubscriptionRecord.php new file mode 100644 index 0000000..bcf5ae4 --- /dev/null +++ b/examples/spot/simpleearn/simpleEarnFlexibleSubscriptionRecord.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->simpleEarnFlexibleSubscriptionRecord( + [ + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/simpleearn/simpleEarnLockedPersonalLeftQuota.php b/examples/spot/simpleearn/simpleEarnLockedPersonalLeftQuota.php new file mode 100644 index 0000000..c092978 --- /dev/null +++ b/examples/spot/simpleearn/simpleEarnLockedPersonalLeftQuota.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->simpleEarnLockedPersonalLeftQuota( + '1', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/savings/savingsProductList.php b/examples/spot/simpleearn/simpleEarnLockedProductList.php similarity index 84% rename from examples/spot/savings/savingsProductList.php rename to examples/spot/simpleearn/simpleEarnLockedProductList.php index 5ccf168..65e7a26 100644 --- a/examples/spot/savings/savingsProductList.php +++ b/examples/spot/simpleearn/simpleEarnLockedProductList.php @@ -10,8 +10,7 @@ 'secret' => $secret ]); -$response = $client->savingsProductList( - 'ACTIVITY', +$response = $client->simpleEarnLockedProductList( [ 'asset' => 'BNB', 'current' => 1, diff --git a/examples/spot/simpleearn/simpleEarnLockedProductPosition.php b/examples/spot/simpleearn/simpleEarnLockedProductPosition.php new file mode 100644 index 0000000..54859fa --- /dev/null +++ b/examples/spot/simpleearn/simpleEarnLockedProductPosition.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->simpleEarnLockedProductPosition( + [ + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/simpleearn/simpleEarnLockedRedemptionRecord.php b/examples/spot/simpleearn/simpleEarnLockedRedemptionRecord.php new file mode 100644 index 0000000..1c11921 --- /dev/null +++ b/examples/spot/simpleearn/simpleEarnLockedRedemptionRecord.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->simpleEarnLockedRedemptionRecord( + [ + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/simpleearn/simpleEarnLockedRewardsHistory.php b/examples/spot/simpleearn/simpleEarnLockedRewardsHistory.php new file mode 100644 index 0000000..5371902 --- /dev/null +++ b/examples/spot/simpleearn/simpleEarnLockedRewardsHistory.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->simpleEarnLockedRewardsHistory( + [ + 'size' => 100, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/simpleearn/simpleEarnLockedSubscriptionPreview.php b/examples/spot/simpleearn/simpleEarnLockedSubscriptionPreview.php new file mode 100644 index 0000000..00c5b4c --- /dev/null +++ b/examples/spot/simpleearn/simpleEarnLockedSubscriptionPreview.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->simpleEarnLockedSubscriptionPreview( + '1', + 1.01, + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/simpleearn/simpleEarnLockedSubscriptionRecord.php b/examples/spot/simpleearn/simpleEarnLockedSubscriptionRecord.php new file mode 100644 index 0000000..749f89e --- /dev/null +++ b/examples/spot/simpleearn/simpleEarnLockedSubscriptionRecord.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->simpleEarnLockedSubscriptionRecord( + [ + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/simpleearn/simpleEarnRateHistory.php b/examples/spot/simpleearn/simpleEarnRateHistory.php new file mode 100644 index 0000000..82f1a70 --- /dev/null +++ b/examples/spot/simpleearn/simpleEarnRateHistory.php @@ -0,0 +1,22 @@ + $key, + 'secret' => $secret +]); + +$response = $client->simpleEarnRateHistory( + '1', + [ + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/simpleearn/simpleEarnRedeemFlexibleProduct.php b/examples/spot/simpleearn/simpleEarnRedeemFlexibleProduct.php new file mode 100644 index 0000000..10f6f00 --- /dev/null +++ b/examples/spot/simpleearn/simpleEarnRedeemFlexibleProduct.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->simpleEarnRedeemFlexibleProduct( + '1', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/simpleearn/simpleEarnRedeemLockedProduct.php b/examples/spot/simpleearn/simpleEarnRedeemLockedProduct.php new file mode 100644 index 0000000..aa57376 --- /dev/null +++ b/examples/spot/simpleearn/simpleEarnRedeemLockedProduct.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->simpleEarnRedeemLockedProduct( + '1', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/simpleearn/simpleEarnSetFlexibleAutoSubscribe.php b/examples/spot/simpleearn/simpleEarnSetFlexibleAutoSubscribe.php new file mode 100644 index 0000000..dc7604f --- /dev/null +++ b/examples/spot/simpleearn/simpleEarnSetFlexibleAutoSubscribe.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->simpleEarnSetFlexibleAutoSubscribe( + '1', + true, + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/blvt/blvtUserLimitInfo.php b/examples/spot/simpleearn/simpleEarnSetLockedAutoSubscribe.php similarity index 76% rename from examples/spot/blvt/blvtUserLimitInfo.php rename to examples/spot/simpleearn/simpleEarnSetLockedAutoSubscribe.php index 0e13273..2f5257d 100644 --- a/examples/spot/blvt/blvtUserLimitInfo.php +++ b/examples/spot/simpleearn/simpleEarnSetLockedAutoSubscribe.php @@ -10,9 +10,10 @@ 'secret' => $secret ]); -$response = $client->blvtUserLimitInfo( +$response = $client->simpleEarnSetLockedAutoSubscribe( + '1', + true, [ - 'tokenName' => 'BTCUP', 'recvWindow' => 5000 ] ); diff --git a/examples/spot/simpleearn/simpleEarnSetLockedProductRedeemOption.php b/examples/spot/simpleearn/simpleEarnSetLockedProductRedeemOption.php new file mode 100644 index 0000000..036a1ab --- /dev/null +++ b/examples/spot/simpleearn/simpleEarnSetLockedProductRedeemOption.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->simpleEarnSetLockedProductRedeemOption( + '1', + 'SPOT', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/simpleearn/simpleEarnSimpleAccount.php b/examples/spot/simpleearn/simpleEarnSimpleAccount.php new file mode 100644 index 0000000..631eed9 --- /dev/null +++ b/examples/spot/simpleearn/simpleEarnSimpleAccount.php @@ -0,0 +1,19 @@ + $key, + 'secret' => $secret +]); + +$response = $client->simpleEarnSimpleAccount( + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/savings/savingsPurchaseFlexibleProduct.php b/examples/spot/simpleearn/simpleEarnSubscribeFlexibleProduct.php similarity index 79% rename from examples/spot/savings/savingsPurchaseFlexibleProduct.php rename to examples/spot/simpleearn/simpleEarnSubscribeFlexibleProduct.php index 94ea37a..529675f 100644 --- a/examples/spot/savings/savingsPurchaseFlexibleProduct.php +++ b/examples/spot/simpleearn/simpleEarnSubscribeFlexibleProduct.php @@ -10,8 +10,8 @@ 'secret' => $secret ]); -$response = $client->savingsPurchaseFlexibleProduct( - '1234', +$response = $client->simpleEarnSubscribeFlexibleProduct( + '1', 1.01, [ 'recvWindow' => 5000 diff --git a/examples/spot/cryptoloans/cryptoLoansRepay.php b/examples/spot/simpleearn/simpleEarnSubscribeLockedProduct.php similarity index 79% rename from examples/spot/cryptoloans/cryptoLoansRepay.php rename to examples/spot/simpleearn/simpleEarnSubscribeLockedProduct.php index 0b5b6b6..17066c7 100644 --- a/examples/spot/cryptoloans/cryptoLoansRepay.php +++ b/examples/spot/simpleearn/simpleEarnSubscribeLockedProduct.php @@ -10,8 +10,8 @@ 'secret' => $secret ]); -$response = $client->cryptoLoansRepay( - 100000001, +$response = $client->simpleEarnSubscribeLockedProduct( + '1', 1.01, [ 'recvWindow' => 5000 diff --git a/examples/spot/subaccount/subAccountApiUpdateIpRestriction.php b/examples/spot/subaccount/subAccountApiUpdateIpRestriction.php new file mode 100644 index 0000000..fa20d38 --- /dev/null +++ b/examples/spot/subaccount/subAccountApiUpdateIpRestriction.php @@ -0,0 +1,22 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountApiUpdateIpRestriction( + 'test@test', + 'apikey', + '1', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountEnableOptionsForSubaccount.php b/examples/spot/subaccount/subAccountEnableOptionsForSubaccount.php new file mode 100644 index 0000000..3befd46 --- /dev/null +++ b/examples/spot/subaccount/subAccountEnableOptionsForSubaccount.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountEnableOptionsForSubaccount( + 'test@test', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/cryptoloans/cryptoLoansCollateralRepayRate.php b/examples/spot/subaccount/subAccountManagedDepositAddress.php similarity index 72% rename from examples/spot/cryptoloans/cryptoLoansCollateralRepayRate.php rename to examples/spot/subaccount/subAccountManagedDepositAddress.php index ec8e2a4..ab58fc5 100644 --- a/examples/spot/cryptoloans/cryptoLoansCollateralRepayRate.php +++ b/examples/spot/subaccount/subAccountManagedDepositAddress.php @@ -10,11 +10,11 @@ 'secret' => $secret ]); -$response = $client->cryptoLoansCollateralRepayRate( - 'BUSD', +$response = $client->subAccountManagedDepositAddress( + 'test@test', 'BNB', - 1000, [ + 'network' => 'BTC', 'recvWindow' => 5000 ] ); diff --git a/examples/spot/subaccount/subAccountManagedFuturesAssetDetails.php b/examples/spot/subaccount/subAccountManagedFuturesAssetDetails.php new file mode 100644 index 0000000..08c3eea --- /dev/null +++ b/examples/spot/subaccount/subAccountManagedFuturesAssetDetails.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountManagedFuturesAssetDetails( + 'test@test', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountManagedList.php b/examples/spot/subaccount/subAccountManagedList.php new file mode 100644 index 0000000..043eef3 --- /dev/null +++ b/examples/spot/subaccount/subAccountManagedList.php @@ -0,0 +1,21 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountManagedList( + [ + 'page' => 1, + 'limit' => 5, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountManagedMarginAssetDetails.php b/examples/spot/subaccount/subAccountManagedMarginAssetDetails.php new file mode 100644 index 0000000..582b27d --- /dev/null +++ b/examples/spot/subaccount/subAccountManagedMarginAssetDetails.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountManagedMarginAssetDetails( + 'test@test', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/savings/savingsChangeDailyPosition.php b/examples/spot/subaccount/subAccountManagedTransferLogInvestor.php similarity index 67% rename from examples/spot/savings/savingsChangeDailyPosition.php rename to examples/spot/subaccount/subAccountManagedTransferLogInvestor.php index e481080..951a712 100644 --- a/examples/spot/savings/savingsChangeDailyPosition.php +++ b/examples/spot/subaccount/subAccountManagedTransferLogInvestor.php @@ -10,11 +10,13 @@ 'secret' => $secret ]); -$response = $client->savingsChangeDailyPosition( - '1234', +$response = $client->subAccountManagedTransferLogInvestor( + 'test@test', + 1563189166000, + 1563282766000, 1, + 5, [ - 'positionId' => 100, 'recvWindow' => 5000 ] ); diff --git a/examples/spot/subaccount/subAccountManagedTransferLogTradeParent.php b/examples/spot/subaccount/subAccountManagedTransferLogTradeParent.php new file mode 100644 index 0000000..757966f --- /dev/null +++ b/examples/spot/subaccount/subAccountManagedTransferLogTradeParent.php @@ -0,0 +1,24 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountManagedTransferLogTradeParent( + 'test@test', + 1563189166000, + 1563282766000, + 1, + 5, + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/subaccount/subAccountTransactionStatistics.php b/examples/spot/subaccount/subAccountTransactionStatistics.php new file mode 100644 index 0000000..7e0b405 --- /dev/null +++ b/examples/spot/subaccount/subAccountTransactionStatistics.php @@ -0,0 +1,20 @@ + $key, + 'secret' => $secret +]); + +$response = $client->subAccountTransactionStatistics( + 'test@test', + [ + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/trade/newOCOOrder.php b/examples/spot/trade/newOrderListOco.php similarity index 65% rename from examples/spot/trade/newOCOOrder.php rename to examples/spot/trade/newOrderListOco.php index 599c0be..16af54b 100644 --- a/examples/spot/trade/newOCOOrder.php +++ b/examples/spot/trade/newOrderListOco.php @@ -10,15 +10,15 @@ 'secret' => $secret ]); -$response = $client->newOcoOrder( +$response = $client->newOrderListOco( 'BNBUSDT', 'SELL', - 0.1, - 400.15, - 390.3, + 1, + 'LIMIT_MAKER', + 'LIMIT_MAKER', [ - 'stopLimitPrice' => 380.3, - 'stopLimitTimeInForce' => 'GTC', + 'abovePrice' => 600, + 'belowPrice' => 590, 'recvWindow' => 5000 ] ); diff --git a/examples/spot/trade/newOrderListOto.php b/examples/spot/trade/newOrderListOto.php new file mode 100644 index 0000000..52f87c4 --- /dev/null +++ b/examples/spot/trade/newOrderListOto.php @@ -0,0 +1,29 @@ + $key, + 'secret' => $secret +]); + +$response = $client->newOrderListOto( + 'BNBUSDT', + 'LIMIT', + 'BUY', + 600, + 1, + 'LIMIT', + 'BUY', + 1, + [ + 'workingTimeInForce' => 'GTC', + 'pendingPrice' => 595, + 'pendingTimeInForce' => 'GTC' + ] +); + +echo json_encode($response); diff --git a/examples/spot/trade/newOrderListOtoco.php b/examples/spot/trade/newOrderListOtoco.php new file mode 100644 index 0000000..d78a6ae --- /dev/null +++ b/examples/spot/trade/newOrderListOtoco.php @@ -0,0 +1,31 @@ + $key, + 'secret' => $secret +]); + +$response = $client->newOrderListOtoco( + 'BNBUSDT', + 'LIMIT', + 'BUY', + 600, + 1, + 'SELL', + 1, + 'LIMIT_MAKER', + [ + 'workingTimeInForce' => 'GTC', + 'pendingAbovePrice' => 605, + 'pendingBelowType' => 'LIMIT_MAKER', + 'pendingBelowPrice' => 595, + 'recvWindow' => 5000 + ] +); + +echo json_encode($response); diff --git a/examples/spot/savings/savingsAccount.php b/examples/spot/wallet/accountInfo.php similarity index 86% rename from examples/spot/savings/savingsAccount.php rename to examples/spot/wallet/accountInfo.php index e0d56e0..c5109f2 100644 --- a/examples/spot/savings/savingsAccount.php +++ b/examples/spot/wallet/accountInfo.php @@ -10,7 +10,7 @@ 'secret' => $secret ]); -$response = $client->savingsAccount( +$response = $client->accountInfo( [ 'recvWindow' => 5000 ] diff --git a/examples/spot/wallet/fetchDepositAddressListNetwork.php b/examples/spot/wallet/fetchDepositAddressListNetwork.php index 2424218..b6bd60c 100644 --- a/examples/spot/wallet/fetchDepositAddressListNetwork.php +++ b/examples/spot/wallet/fetchDepositAddressListNetwork.php @@ -11,7 +11,7 @@ ]); $response = $client->fetchDepositAddressListNetwork( - 'BTC', + 'BNB', [ 'recvWindow' => 5000 ] diff --git a/src/Binance/Spot.php b/src/Binance/Spot.php index 49da210..88c1f24 100644 --- a/src/Binance/Spot.php +++ b/src/Binance/Spot.php @@ -6,7 +6,7 @@ class Spot extends APIClient { - use Spot\BLVT; + use Spot\AutoInvest; use Spot\C2C; use Spot\Convert; use Spot\CryptoLoans; @@ -22,7 +22,7 @@ class Spot extends APIClient use Spot\Pay; use Spot\PortfolioMargin; use Spot\Rebate; - use Spot\Savings; + use Spot\SimpleEarn; use Spot\Stream; use Spot\SubAccount; use Spot\Trade; diff --git a/src/Binance/Spot/AutoInvest.php b/src/Binance/Spot/AutoInvest.php new file mode 100644 index 0000000..9eaa78f --- /dev/null +++ b/src/Binance/Spot/AutoInvest.php @@ -0,0 +1,436 @@ +signRequest('GET', '/sapi/v1/lending/auto-invest/target-asset/list', $options); + } + + /** + * Get target asset ROI data (USER_DATA) + * + * GET /sapi/v1/lending/auto-invest/target-asset/roi/list + * + * ROI return list for target asset + * + * Weight(IP): 1 + * + * @param string $targetAsset + * @param string $hisRoiType + * @param array $options + */ + public function autoInvestTargetAssetRoiData(string $targetAsset, string $hisRoiType, array $options = []) + { + if (Strings::isEmpty($targetAsset)) { + throw new MissingArgumentException('targetAsset'); + } + if (Strings::isEmpty($hisRoiType)) { + throw new MissingArgumentException('hisRoiType'); + } + + return $this->signRequest('GET', '/sapi/v1/lending/auto-invest/target-asset/roi/list', array_merge( + $options, + [ + 'targetAsset' => $targetAsset, + 'hisRoiType' => $hisRoiType + ] + )); + } + + /** + * Query all source asset and target asset (USER_DATA) + * + * GET /sapi/v1/lending/auto-invest/all/asset + * + * Query all source assets and target assets + * + * Weight(IP): 1 + * + * @param array $options + */ + public function autoInvestAllSourceAssetTargetAsset(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/lending/auto-invest/all/asset', $options); + } + + /** + * Query source asset list (USER_DATA) + * + * GET /sapi/v1/lending/auto-invest/source-asset/list + * + * Query Source Asset to be used for investment + * + * Weight(IP): 1 + * + * @param string $usageType + * @param array $options + */ + public function autoInvestSourceAssetList(string $usageType, array $options = []) + { + if (Strings::isEmpty($usageType)) { + throw new MissingArgumentException('usageType'); + } + + return $this->signRequest('GET', '/sapi/v1/lending/auto-invest/source-asset/list', array_merge( + $options, + [ + 'usageType' => $usageType + ] + )); + } + + /** + * Investment plan creation (USER_DATA) + * + * POST /sapi/v1/lending/auto-invest/plan/add + * + * Post an investment plan creation + * + * Weight(IP): 1 + * + * @param string $sourceType + * @param string $planType + * @param mixed $subscriptionAmount + * @param string $subscriptionCycle + * @param int $subscriptionStartTime + * @param string $sourceAsset + * @param array $details + * @param array $options + */ + public function autoInvestPlanCreation(string $sourceType, string $planType, $subscriptionAmount, string $subscriptionCycle, int $subscriptionStartTime, string $sourceAsset, array $details, array $options = []) + { + if (Strings::isEmpty($sourceType)) { + throw new MissingArgumentException('sourceType'); + } + if (Strings::isEmpty($planType)) { + throw new MissingArgumentException('planType'); + } + if (Strings::isEmpty($subscriptionCycle)) { + throw new MissingArgumentException('subscriptionCycle'); + } + if (Strings::isEmpty($sourceAsset)) { + throw new MissingArgumentException('sourceAsset'); + } + if (count($details) === 0) { + throw new MissingArgumentException('details'); + } + + return $this->signRequest('POST', '/sapi/v1/lending/auto-invest/plan/add', array_merge( + $options, + [ + 'sourceType' => $sourceType, + 'planType' => $planType, + 'subscriptionAmount' => $subscriptionAmount, + 'subscriptionCycle' => $subscriptionCycle, + 'subscriptionStartTime' => $subscriptionStartTime, + 'sourceAsset' => $sourceAsset, + 'details' => json_encode($details) + ] + )); + } + + /** + * Investment plan adjustment + * + * POST /sapi/v1/lending/auto-invest/plan/edit + * + * Query Source Asset to be used for investment + * + * Weight(IP): 1 + * + * @param int $planId + * @param mixed $subscriptionAmount + * @param string $subscriptionCycle + * @param int $subscriptionStartTime + * @param string $sourceAsset + * @param array $options + */ + public function autoInvestPlanAdjustment(int $planId, $subscriptionAmount, string $subscriptionCycle, int $subscriptionStartTime, string $sourceAsset, array $options = []) + { + if (Strings::isEmpty($subscriptionCycle)) { + throw new MissingArgumentException('subscriptionCycle'); + } + if (Strings::isEmpty($sourceAsset)) { + throw new MissingArgumentException('sourceAsset'); + } + + return $this->publicRequest('POST', '/sapi/v1/lending/auto-invest/plan/edit', array_merge( + $options, + [ + 'planId' => $planId, + 'subscriptionAmount' => $subscriptionAmount, + 'subscriptionCycle' => $subscriptionCycle, + 'subscriptionStartTime' => $subscriptionStartTime, + 'sourceAsset' => $sourceAsset + ] + )); + } + + /** + * Change Plan Status + * + * POST /sapi/v1/lending/auto-invest/plan/edit-status + * + * Change Plan Status + * + * Weight(IP): 1 + * + * @param int $planId + * @param string $status + * @param array $options + */ + public function autoInvestChangePlanStatus(int $planId, string $status, array $options = []) + { + if (Strings::isEmpty($status)) { + throw new MissingArgumentException('status'); + } + + return $this->publicRequest('POST', '/sapi/v1/lending/auto-invest/plan/edit-status', array_merge( + $options, + [ + 'planId' => $planId, + 'status' => $status + ] + )); + } + + /** + * Get list of plans + * + * GET /sapi/v1/lending/auto-invest/plan/list + * + * Query plan lists + * + * Weight(IP): 1 + * + * @param string $planType + * @param array $options + */ + public function autoInvestListPlans(string $planType, array $options = []) + { + if (Strings::isEmpty($planType)) { + throw new MissingArgumentException('planType'); + } + + return $this->signRequest('GET', '/sapi/v1/lending/auto-invest/plan/list', array_merge( + $options, + [ + 'planType' => $planType + ] + )); + } + + /** + * Query holding details of the plan + * + * GET /sapi/v1/lending/auto-invest/plan/id + * + * Query holding details of the plan + * + * Weight(IP): 1 + * + * @param array $options + */ + public function autoInvestHoldingDetailsPlan(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/lending/auto-invest/plan/id', $options); + } + + /** + * Query subscription transaction history + * + * GET /sapi/v1/lending/auto-invest/history/list + * + * Query subscription transaction history of a plan + * + * Weight(IP): 1 + * + * @param array $options + */ + public function autoInvestSubscriptionTransactionHistory(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/lending/auto-invest/history/list', $options); + } + + /** + * Query Index Details (USER_DATA) + * + * GET /sapi/v1/lending/auto-invest/index/info + * + * Query index details + * + * Weight(IP): 1 + * + * @param int $indexId + * @param array $options + */ + public function autoInvestIndexDetails(int $indexId, array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/lending/auto-invest/index/info', array_merge( + $options, + [ + 'indexId' => $indexId + ] + )); + } + + /** + * Query Index Linked Plan Position Details (USER_DATA) + * + * GET /sapi/v1/lending/auto-invest/index/user-summary + * + * Details on users Index-Linked plan position details + * + * Weight(IP): 1 + * + * @param int $indexId + * @param array $options + */ + public function autoInvestIndexLinkedPlanPositionDetails(int $indexId, array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/lending/auto-invest/index/user-summary', array_merge( + $options, + [ + 'indexId' => $indexId + ] + )); + } + + /** + * One Time Transaction (TRADE) + * + * POST /sapi/v1/lending/auto-invest/one-off + * + * One time transaction + * + * Weight(IP): 1 + * + * @param string $sourceType + * @param mixed $subscriptionAmount + * @param string $sourceAsset + * @param array $options + */ + public function autoInvestOneTimeTransaction(string $sourceType, $subscriptionAmount, string $sourceAsset, array $options = []) + { + if (Strings::isEmpty($sourceType)) { + throw new MissingArgumentException('sourceType'); + } + if (Strings::isEmpty($sourceAsset)) { + throw new MissingArgumentException('sourceAsset'); + } + + return $this->signRequest('POST', '/sapi/v1/lending/auto-invest/one-off', array_merge( + $options, + [ + 'sourceType' => $sourceType, + 'subscriptionAmount' => $subscriptionAmount, + 'sourceAsset' => $sourceAsset + ] + )); + } + + /** + * Query One-Time Transaction Status (USER_DATA) + * + * GET /sapi/v1/lending/auto-invest/one-off/status + * + * Transaction status for one-time transaction + * + * Weight(IP): 1 + * + * @param int $transactionId + * @param array $options + */ + public function autoInvestOnetimeTransactionStatus(int $transactionId, array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/lending/auto-invest/one-off/status', array_merge( + $options, + [ + 'transactionId' => $transactionId + ] + )); + } + + /** + * Index Linked Plan Redemption (TRADE) + * + * POST /sapi/v1/lending/auto-invest/redeem + * + * To redeem index-Linked plan holdings + * + * Weight(IP): 1 + * + * @param int $indexId + * @param int $redemptionPercentage + * @param array $options + */ + public function autoInvestIndexLinkedPlanRedemption(int $indexId, int $redemptionPercentage, array $options = []) + { + return $this->signRequest('POST', '/sapi/v1/lending/auto-invest/redeem', array_merge( + $options, + [ + 'indexId' => $indexId, + 'redemptionPercentage' => $redemptionPercentage + ] + )); + } + + /** + * Index Linked Plan Redemption History (USER_DATA) + * + * GET /sapi/v1/lending/auto-invest/redeem/history + * + * Get the history of Index Linked Plan Redemption transactions + * + * Max 30 day difference between startTime and endTime + * If no startTime and endTime, default to show past 30 day records + * + * Weight(IP): 1 + * + * @param int $requestId + * @param array $options + */ + public function autoInvestIndexLinkedPlanRedemptionHistory(int $requestId, array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/lending/auto-invest/redeem/history', array_merge( + $options, + [ + 'requestId' => $requestId + ] + )); + } + + /** + * Index Linked Plan Rebalance Details (USER_DATA) + * + * GET /sapi/v1/lending/auto-invest/rebalance/history + * + * Get the history of Index Linked Plan Redemption transactions + * + * Max 30 day difference between startTime and endTime + * If no startTime and endTime, default to show past 30 day records + * + * Weight(IP): 1 + * + * @param array $options + */ + public function autoInvestIndexLinkedPlanRebalanceDetails(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/lending/auto-invest/rebalance/history', $options); + } +} diff --git a/src/Binance/Spot/BLVT.php b/src/Binance/Spot/BLVT.php deleted file mode 100644 index 4d173c1..0000000 --- a/src/Binance/Spot/BLVT.php +++ /dev/null @@ -1,121 +0,0 @@ -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/CryptoLoans.php b/src/Binance/Spot/CryptoLoans.php index 7db385c..201c0cc 100644 --- a/src/Binance/Spot/CryptoLoans.php +++ b/src/Binance/Spot/CryptoLoans.php @@ -36,44 +36,26 @@ public function cryptoLoansIncomeHistory(string $asset, array $options = []) } /** - * Borrow - Crypto Loan Borrow (TRADE) + * Borrow - Get Loan Borrow History (USER_DATA) * - * POST /sapi/v1/loan/borrow + * GET /sapi/v1/loan/borrow/history * - * Weight(UID): 36000 - * Request Limit: 1 time/second per UID + * - If startTime and endTime are not sent, the recent 90-day data will be returned. + * - The max interval between startTime and endTime is 180 days. + * + * Weight(IP): 400 * - * @param string $loanCoin - * @param string $collateralCoin - * @param int $loanTerm * @param array $options */ - public function cryptoLoansBorrow(string $loanCoin, string $collateralCoin, int $loanTerm, array $options = []) + public function cryptoLoansBorrowHistory(array $options = []) { - if (Strings::isEmpty($loanCoin)) { - throw new MissingArgumentException('loanCoin'); - } - if (Strings::isEmpty($collateralCoin)) { - throw new MissingArgumentException('collateralCoin'); - } - if ($loanTerm < 7 || $loanTerm > 30) { - throw new InvalidArgumentException('loanTerm', $loanTerm, '7-30', 'Loan term should be between 7 and 30 days'); - } - - return $this->signRequest('POST', '/sapi/v1/loan/borrow', array_merge( - $options, - [ - 'loanCoin' => $loanCoin, - 'collateralCoin' => $collateralCoin, - 'loanTerm' => $loanTerm - ] - )); + return $this->signRequest('GET', '/sapi/v1/loan/borrow/history', $options); } /** - * Borrow - Get Loan Borrow History (USER_DATA) + * Repay - Get Loan Repayment History (USER_DATA) * - * GET /sapi/v1/loan/borrow/history + * GET /sapi/v1/loan/repay/history * * - If startTime and endTime are not sent, the recent 90-day data will be returned. * - The max interval between startTime and endTime is 180 days. @@ -82,55 +64,77 @@ public function cryptoLoansBorrow(string $loanCoin, string $collateralCoin, int * * @param array $options */ - public function cryptoLoansBorrowHistory(array $options = []) + public function cryptoLoansRepayHistory(array $options = []) { - return $this->signRequest('GET', '/sapi/v1/loan/borrow/history', $options); + return $this->signRequest('GET', '/sapi/v1/loan/repay/history', $options); } /** - * Borrow - Get Loan Ongoing Orders (USER_DATA) + * Adjust LTV - Get Loan LTV Adjustment History (USER_DATA) + * + * GET /sapi/v1/loan/ltv/adjustment/history * - * GET /sapi/v1/loan/ongoing/orders + * - If startTime and endTime are not sent, the recent 90-day data will be returned. + * - The max interval between startTime and endTime is 180 days. * - * Weight(IP): 300 + * Weight(IP): 400 * * @param array $options */ - public function cryptoLoansOngoingOrders(array $options = []) + public function cryptoLoansLtvAdjustmentHistory(array $options = []) { - return $this->signRequest('GET', '/sapi/v1/loan/ongoing/orders', $options); + return $this->signRequest('GET', '/sapi/v1/loan/ltv/adjustment/history', $options); } /** - * Repay - Crypto Loan Repay (TRADE) + * Borrow - Flexible Loan Borrow (TRADE) * - * POST /sapi/v1/loan/repay + * POST /sapi/v2/loan/flexible/borrow + * + * Only available for master account * * Weight(UID): 6000 * - * @param int $orderId - * @param float $amount + * @param string $loanCoin + * @param string $collateralCoin * @param array $options */ - public function cryptoLoansRepay(int $orderId, float $amount, array $options = []) + public function cryptoLoansFlexibleBorrow(string $loanCoin, string $collateralCoin, array $options = []) { - if ($amount <= 0) { - throw new InvalidArgumentException('amount', $amount, 'greater than 0'); + if (Strings::isEmpty($loanCoin)) { + throw new MissingArgumentException('loanCoin'); + } + if (Strings::isEmpty($collateralCoin)) { + throw new MissingArgumentException('collateralCoin'); } - return $this->signRequest('POST', '/sapi/v1/loan/repay', array_merge( + return $this->signRequest('POST', '/sapi/v2/loan/flexible/borrow', array_merge( $options, [ - 'orderId' => $orderId, - 'amount' => $amount + 'loanCoin' => $loanCoin, + 'collateralCoin' => $collateralCoin ] )); } /** - * Repay - Get Loan Repayment History (USER_DATA) + * Borrow - Get Flexible Loan Ongoing Orders (USER_DATA) * - * GET /sapi/v1/loan/repay/history + * GET /sapi/v2/loan/flexible/ongoing/orders + * + * Weight(IP): 300 + * + * @param array $options + */ + public function cryptoLoansFlexibleOngoingOrders(array $options = []) + { + return $this->signRequest('GET', '/sapi/v2/loan/flexible/ongoing/orders', $options); + } + + /** + * Borrow - Get Flexible Loan Borrow History (USER_DATA) + * + * GET /sapi/v2/loan/flexible/borrow/history * * - If startTime and endTime are not sent, the recent 90-day data will be returned. * - The max interval between startTime and endTime is 180 days. @@ -139,46 +143,47 @@ public function cryptoLoansRepay(int $orderId, float $amount, array $options = [ * * @param array $options */ - public function cryptoLoansRepayHistory(array $options = []) + public function cryptoLoansFlexibleBorrowHistory(array $options = []) { - return $this->signRequest('GET', '/sapi/v1/loan/repay/history', $options); + return $this->signRequest('GET', '/sapi/v2/loan/flexible/borrow/history', $options); } /** - * Adjust LTV - Crypto Loan Adjust LTV (TRADE) + * Repay - Flexible Loan Repay (TRADE) * - * POST /sapi/v1/loan/adjust/ltv + * POST /sapi/v2/loan/flexible/repay * - * Weight(UID): 6000 + * - repayAmount is mandatory even fullRepayment = FALSE * - * @param int $orderId - * @param float $amount - * @param string $direction + * Weight(IP): 6000 + * + * @param string $loanCoin + * @param string $collateralCoin + * @param mixed $repayAmount * @param array $options */ - public function cryptoLoansAdjustLtv(int $orderId, float $amount, string $direction, array $options = []) + public function cryptoLoansFlexibleRepay(string $loanCoin, string $collateralCoin, $repayAmount, array $options = []) { - if ($amount <= 0) { - throw new InvalidArgumentException('amount', $amount, 'greater than 0'); + if (Strings::isEmpty($loanCoin)) { + throw new MissingArgumentException('loanCoin'); } - if (Strings::isEmpty($direction)) { - throw new MissingArgumentException('direction'); + if (Strings::isEmpty($collateralCoin)) { + throw new MissingArgumentException('collateralCoin'); } - - return $this->signRequest('POST', '/sapi/v1/loan/adjust/ltv', array_merge( + return $this->signRequest('POST', '/sapi/v2/loan/flexible/repay', array_merge( $options, [ - 'orderId' => $orderId, - 'amount' => $amount, - 'direction' => $direction + 'loanCoin' => $loanCoin, + 'collateralCoin' => $collateralCoin, + 'repayAmount' => $repayAmount ] )); } /** - * Adjust LTV - Get Loan LTV Adjustment History (USER_DATA) + * Repay - Get Flexible Loan Repayment History (USER_DATA) * - * GET /sapi/v1/loan/ltv/adjustment/history + * GET /sapi/v2/loan/flexible/repay/history * * - If startTime and endTime are not sent, the recent 90-day data will be returned. * - The max interval between startTime and endTime is 180 days. @@ -187,104 +192,95 @@ public function cryptoLoansAdjustLtv(int $orderId, float $amount, string $direct * * @param array $options */ - public function cryptoLoansLtvAdjustmentHistory(array $options = []) + public function cryptoLoansFlexibleRepayHistory(array $options = []) { - return $this->signRequest('GET', '/sapi/v1/loan/ltv/adjustment/history', $options); + return $this->signRequest('GET', '/sapi/v2/loan/flexible/repay/history', $options); } /** - * Get Loanable Assets Data (USER_DATA) + * Adjust LTV - Flexible Loan Adjust LTV (TRADE) * - * GET /sapi/v1/loan/loanable/data + * POST /sapi/v2/loan/flexible/adjust/ltv * - * Get interest rate and borrow limit of loanable assets. The borrow limit is shown in USD value. + * - API Key needs Spot & Margin Trading permission for this endpoint * - * Weight(IP): 400 - * Request Limit: 1 time/2 seconds per UID + * Weight(UID): 6000 * + * @param string $loanCoin + * @param string $collateralCoin + * @param mixed $adjustmentAmount + * @param string $direction * @param array $options */ - public function cryptoLoansLoanableData(array $options = []) + public function cryptoLoansAdjustLtv(string $loanCoin, string $collateralCoin, $adjustmentAmount, string $direction, array $options = []) { - return $this->signRequest('GET', '/sapi/v1/loan/loanable/data', $options); + if (Strings::isEmpty($loanCoin)) { + throw new MissingArgumentException('loanCoin'); + } + if (Strings::isEmpty($collateralCoin)) { + throw new MissingArgumentException('collateralCoin'); + } + if (Strings::isEmpty($direction)) { + throw new MissingArgumentException('direction'); + } + + return $this->signRequest('POST', '/sapi/v2/loan/flexible/adjust/ltv', array_merge( + $options, + [ + 'loanCoin' => $loanCoin, + 'collateralCoin' => $collateralCoin, + 'adjustmentAmount' => $adjustmentAmount, + 'direction' => $direction + ] + )); } /** - * Get Collateral Assets Data (USER_DATA) + * Adjust LTV - Get Flexible Loan LTV Adjustment History (USER_DATA) * - * GET /sapi/v1/loan/collateral/data + * GET /sapi/v2/loan/flexible/ltv/adjustment/history * - * Get LTV information and collateral limit of collateral assets. The collateral limit is shown in USD value. + * - If startTime and endTime are not sent, the recent 90-day data will be returned. + * - The max interval between startTime and endTime is 180 days. * * Weight(IP): 400 - * Request Limit: 1 time/2 seconds per UID * * @param array $options */ - public function cryptoLoansCollateralData(array $options = []) + public function cryptoLoansAdjustLtvHistory(array $options = []) { - return $this->signRequest('GET', '/sapi/v1/loan/collateral/data', $options); + return $this->signRequest('GET', '/sapi/v2/loan/flexible/ltv/adjustment/history', $options); } /** - * Check Collateral Repay Rate (USER_DATA) + * Get Flexible Loan Assets Data (USER_DATA) * - * GET /sapi/v1/loan/repay/collateral/rate + * GET /sapi/v2/loan/flexible/loanable/data * - * Get the the rate of collateral coin / loan coin when using collateral repay, the rate will be valid within 8 second. + * Get interest rate and borrow limit of flexible loanable assets. The borrow limit is shown in USD value. * - * Weight(IP): 6000 + * Weight(IP): 400 * - * @param string $loanCoin - * @param string $collateralCoin - * @param float $repayAmount * @param array $options */ - public function cryptoLoansCollateralRepayRate(string $loanCoin, string $collateralCoin, float $repayAmount, array $options = []) + public function cryptoLoansFlexibleAssetsData(array $options = []) { - if (Strings::isEmpty($loanCoin)) { - throw new MissingArgumentException('loanCoin'); - } - if (Strings::isEmpty($collateralCoin)) { - throw new MissingArgumentException('collateralCoin'); - } - if ($repayAmount <= 0) { - throw new InvalidArgumentException('repayAmount', $repayAmount, 'greater than 0'); - } - - return $this->signRequest('GET', '/sapi/v1/loan/repay/collateral/rate', array_merge( - $options, - [ - 'loanCoin' => $loanCoin, - 'collateralCoin' => $collateralCoin, - 'repayAmount' => $repayAmount - ] - )); + return $this->signRequest('GET', '/sapi/v2/loan/flexible/loanable/data', $options); } /** - * Crypto Loan Customize Margin Call (TRADE) + * Get Flexible Loan Collateral Assets Data (USER_DATA) * - * POST /sapi/v1/loan/customize/margin_call + * GET /sapi/v2/loan/flexible/collateral/data * - * Customize margin call for ongoing orders only. + * Get LTV information and collateral limit of flexible loan's collateral assets. The collateral limit is shown in USD value. * - * Weight(UID): 6000 + * Weight(IP): 400 * - * @param float $marginCall * @param array $options */ - public function cryptoLoansCustomizeMarginCall(float $marginCall, array $options = []) + public function cryptoLoansFlexibleCollateralAssetsData(array $options = []) { - if ($marginCall <= 0) { - throw new InvalidArgumentException('marginCall', $marginCall, 'greater than 0'); - } - - return $this->signRequest('POST', '/sapi/v1/loan/customize/margin_call', array_merge( - $options, - [ - 'marginCall' => $marginCall - ] - )); + return $this->signRequest('GET', '/sapi/v2/loan/flexible/collateral/data', $options); } } diff --git a/src/Binance/Spot/Margin.php b/src/Binance/Spot/Margin.php index fbfee45..9880506 100644 --- a/src/Binance/Spot/Margin.php +++ b/src/Binance/Spot/Margin.php @@ -1004,6 +1004,111 @@ public function marginManualLiquidation(string $type, array $options = []) )); } + /** + * Margin Account New OTO (TRADE) + * + * POST /sapi/v1/margin/order/oto + * + * Post a new OTO order for margin account + * + * Weight(UID): 6 + * + * @param string $symbol + * @param string $workingType + * @param string $workingSide + * @param mixed $workingPrice + * @param mixed $workingQuantity + * @param string $pendingType + * @param string $pendingSide + * @param mixed $pendingQuantity + * @param array $options + */ + public function marginNewOtoOrder(string $symbol, string $workingType, string $workingSide, $workingPrice, $workingQuantity, string $pendingType, string $pendingSide, $pendingQuantity, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + if (Strings::isEmpty($workingType)) { + throw new MissingArgumentException('workingType'); + } + if (Strings::isEmpty($workingSide)) { + throw new MissingArgumentException('workingSide'); + } + if (Strings::isEmpty($pendingType)) { + throw new MissingArgumentException('pendingType'); + } + if (Strings::isEmpty($pendingSide)) { + throw new MissingArgumentException('pendingSide'); + } + + return $this->signRequest('POST', '/sapi/v1/margin/order/oto', array_merge( + $options, + [ + 'symbol' => $symbol, + 'workingType' => $workingType, + 'workingSide' => $workingSide, + 'workingPrice' => $workingPrice, + 'workingQuantity' => $workingQuantity, + 'pendingType' => $pendingType, + 'pendingSide' => $pendingSide, + 'pendingQuantity' => $pendingQuantity + ] + )); + } + + + /** + * Margin Account New OTOCO (TRADE) + * + * POST /sapi/v1/margin/order/otoco + * + * Post a new OTOCO order for margin account + * + * Weight(UID): 6 + * + * @param string $symbol + * @param string $workingType + * @param string $workingSide + * @param mixed $workingPrice + * @param mixed $workingQuantity + * @param string $pendingSide + * @param mixed $pendingQuantity + * @param string $pendingAboveType + * @param array $options + */ + public function marginNewOtocoOrder(string $symbol, string $workingType, string $workingSide, $workingPrice, $workingQuantity, string $pendingSide, $pendingQuantity, string $pendingAboveType, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + if (Strings::isEmpty($workingType)) { + throw new MissingArgumentException('workingType'); + } + if (Strings::isEmpty($workingSide)) { + throw new MissingArgumentException('workingSide'); + } + if (Strings::isEmpty($pendingAboveType)) { + throw new MissingArgumentException('pendingAboveType'); + } + if (Strings::isEmpty($pendingSide)) { + throw new MissingArgumentException('pendingSide'); + } + + return $this->signRequest('POST', '/api/v3/orderList/otoco', array_merge( + $options, + [ + 'symbol' => $symbol, + 'workingType' => $workingType, + 'workingSide' => $workingSide, + 'workingPrice' => $workingPrice, + 'workingQuantity' => $workingQuantity, + 'pendingSide' => $pendingSide, + 'pendingQuantity' => $pendingQuantity, + 'pendingAboveType' => $pendingAboveType + ] + )); + } + /** * Query Liability Coin Leverage Bracket in Cross Margin Pro Mode(MARKET_DATA) * diff --git a/src/Binance/Spot/Market.php b/src/Binance/Spot/Market.php index 76a8165..2d8e096 100644 --- a/src/Binance/Spot/Market.php +++ b/src/Binance/Spot/Market.php @@ -89,7 +89,7 @@ public function depth(string $symbol, array $options = []) * * Get recent trades. * - * Weight(IP): 10 + * Weight(IP): 25 * * @param string $symbol * @param array $options @@ -115,7 +115,7 @@ public function trades(string $symbol, array $options = []) * * Get older market trades. * - * Weight(IP): 10 + * Weight(IP): 25 * * @param string $symbol * @param array $options diff --git a/src/Binance/Spot/PortfolioMargin.php b/src/Binance/Spot/PortfolioMargin.php index acb5e4b..944391b 100644 --- a/src/Binance/Spot/PortfolioMargin.php +++ b/src/Binance/Spot/PortfolioMargin.php @@ -36,6 +36,22 @@ public function portfolioMarginCollateralRate() return $this->publicRequest('GET', '/sapi/v1/portfolio/collateralRate'); } + /** + * Portfolio Margin Pro Tiered Collateral Rate (USER_DATA) + * + * GET /sapi/v2/portfolio/collateralRate + * + * Portfolio Margin PRO Tiered Collateral Rate + * + * Weight(IP): 50 + * + * @param array $options + */ + public function portfolioMarginProTieredCollateralRate(array $options = []) + { + return $this->signRequest('GET', '/sapi/v2/portfolio/collateralRate', $options); + } + /** * Query Portfolio Margin Bankruptcy Loan Amount (USER_DATA) * @@ -84,6 +100,38 @@ public function portfolioMarginInterestHistory(array $options = []) return $this->signRequest('GET', '/sapi/v1/portfolio/interest-history', $options); } + /** + * Get Portfolio Margin Pro SPAN Account Info (USER_DATA) + * + * GET /sapi/v2/portfolio/account + * + * Get Portfolio Margin Pro SPAN account info + * + * Weight(IP): 5 + * + * @param array $options + */ + public function portfolioMarginProSpanAccount(array $options = []) + { + return $this->signRequest('GET', '/sapi/v2/portfolio/account', $options); + } + + /** + * Get Portfolio Margin Pro Account Balance (USER_DATA) + * + * GET /sapi/v1/portfolio/balance + * + * Query Portfolio Margin Pro account balance + * + * Weight(IP): 20 + * + * @param array $options + */ + public function portfolioMarginProBalance(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/portfolio/balance', $options); + } + /** * Query Portfolio Margin Asset Index Price (MARKET_DATA) * diff --git a/src/Binance/Spot/Savings.php b/src/Binance/Spot/Savings.php deleted file mode 100644 index 6be9545..0000000 --- a/src/Binance/Spot/Savings.php +++ /dev/null @@ -1,354 +0,0 @@ -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/SimpleEarn.php b/src/Binance/Spot/SimpleEarn.php new file mode 100644 index 0000000..855581e --- /dev/null +++ b/src/Binance/Spot/SimpleEarn.php @@ -0,0 +1,504 @@ +signRequest('GET', '/sapi/v1/simple-earn/flexible/list', $options); + } + + /** + * Get Simple Earn Locked Product List (USER_DATA) + * + * GET /sapi/v1/simple-earn/locked/list + * + * Weight(IP): 150 + * + * @param array $options + */ + public function simpleEarnLockedProductList(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/simple-earn/locked/list', $options); + } + + /** + * Subscribe Flexible Product (TRADE) + * + * POST /sapi/v1/simple-earn/flexible/subscribe + * + * Weight(IP): 1 + * + * Rate Limit: 1/3s per account + * + * @param string $productId + * @param mixed $amount + * @param array $options + */ + public function simpleEarnSubscribeFlexibleProduct(string $productId, $amount, array $options = []) + { + if (Strings::isEmpty($productId)) { + throw new MissingArgumentException('productId'); + } + + return $this->signRequest('POST', '/sapi/v1/simple-earn/flexible/subscribe', array_merge( + $options, + [ + 'productId' => $productId, + 'amount' => $amount + ] + )); + } + + /** + * Subscribe Locked Product (TRADE) + * + * POST /sapi/v1/simple-earn/locked/subscribe + * + * Weight(IP): 1 + * + * Rate Limit: 1/3s per account + * + * @param string $projectId + * @param mixed $amount + * @param array $options + */ + public function simpleEarnSubscribeLockedProduct(string $projectId, $amount, array $options = []) + { + if (Strings::isEmpty($projectId)) { + throw new MissingArgumentException('projectId'); + } + + return $this->signRequest('POST', '/sapi/v1/simple-earn/locked/subscribe', array_merge( + $options, + [ + 'projectId' => $projectId, + 'amount' => $amount + ] + )); + } + + /** + * Redeem Flexible Product (TRADE) + * + * POST /sapi/v1/simple-earn/flexible/redeem + * + * Weight(IP): 1 + * + * Rate Limit: 1/3s per account + * + * @param string $productId + * @param array $options + */ + public function simpleEarnRedeemFlexibleProduct(string $productId, array $options = []) + { + if (Strings::isEmpty($productId)) { + throw new MissingArgumentException('productId'); + } + + return $this->signRequest('POST', '/sapi/v1/simple-earn/flexible/redeem', array_merge( + $options, + [ + 'productId' => $productId + ] + )); + } + + /** + * Redeem Locked Product (TRADE) + * + * POST /sapi/v1/simple-earn/locked/redeem + * + * Weight(IP): 1 + * + * Rate Limit: 1/3s per account + * + * @param string $positionId + * @param array $options + */ + public function simpleEarnRedeemLockedProduct(string $positionId, array $options = []) + { + if (Strings::isEmpty($positionId)) { + throw new MissingArgumentException('positionId'); + } + + return $this->signRequest('POST', '/sapi/v1/simple-earn/locked/redeem', array_merge( + $options, + [ + 'positionId' => $positionId + ] + )); + } + + /** + * Get Flexible Product Position (USER_DATA) + * + * GET /sapi/v1/simple-earn/flexible/position + * + * Weight(IP): 150 + * + * @param array $options + */ + public function simpleEarnFlexibleProductPosition(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/simple-earn/flexible/position', $options); + } + + /** + * Get Locked Product Position (USER_DATA) + * + * GET /sapi/v1/simple-earn/locked/position + * + * Weight(IP): 150 + * + * @param array $options + */ + public function simpleEarnLockedProductPosition(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/simple-earn/locked/position', $options); + } + + /** + * Simple Account (USER_DATA) + * + * GET /sapi/v1/simple-earn/account + * + * Weight(IP): 150 + * + * @param array $options + */ + public function simpleEarnSimpleAccount(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/simple-earn/account', $options); + } + + /** + * Get Flexible Subscription Record (USER_DATA) + * + * GET /sapi/v1/simple-earn/flexible/history/subscriptionRecord + * + * Weight(IP): 150 + * + * @param array $options + */ + public function simpleEarnFlexibleSubscriptionRecord(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/simple-earn/flexible/history/subscriptionRecord', $options); + } + + /** + * Get Locked Subscription Record (USER_DATA) + * + * GET /sapi/v1/simple-earn/locked/history/subscriptionRecord + * + * Weight(IP): 150 + * + * @param array $options + */ + public function simpleEarnLockedSubscriptionRecord(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/simple-earn/locked/history/subscriptionRecord', $options); + } + + /** + * Get Flexible Redemption Record (USER_DATA) + * + * GET /sapi/v1/simple-earn/flexible/history/redemptionRecord + * + * Weight(IP): 150 + * + * @param array $options + */ + public function simpleEarnFlexibleRedemptionRecord(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/simple-earn/flexible/history/redemptionRecord', $options); + } + + /** + * Get Locked Redemption Record (USER_DATA) + * + * GET /sapi/v1/simple-earn/locked/history/redemptionRecord + * + * Weight(IP): 150 + * + * @param array $options + */ + public function simpleEarnLockedRedemptionRecord(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/simple-earn/locked/history/redemptionRecord', $options); + } + + /** + * Get Flexible Rewards History (USER_DATA) + * + * GET /sapi/v1/simple-earn/flexible/history/rewardsRecord + * + * Weight(IP): 150 + * + * @param string $type + * @param array $options + */ + public function simpleEarnFlexibleRewardsHistory(string $type, array $options = []) + { + if (Strings::isEmpty($type)) { + throw new MissingArgumentException('type'); + } + + return $this->signRequest('GET', '/sapi/v1/simple-earn/flexible/history/rewardsRecord', array_merge( + $options, + [ + 'type' => $type + ] + )); + } + + /** + * Get Locked Rewards History (USER_DATA) + * + * GET /sapi/v1/simple-earn/locked/history/rewardsRecord + * + * Weight(IP): 150 + * + * @param array $options + */ + public function simpleEarnLockedRewardsHistory(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/simple-earn/locked/history/rewardsRecord', $options); + } + + /** + * Set Flexible Auto Subscribe (USER_DATA) + * + * POST /sapi/v1/simple-earn/flexible/setAutoSubscribe + * + * Weight(IP): 150 + * + * @param string $productId + * @param bool $autoSubscribe + * @param array $options + */ + public function simpleEarnSetFlexibleAutoSubscribe(string $productId, bool $autoSubscribe, array $options = []) + { + if (Strings::isEmpty($productId)) { + throw new MissingArgumentException('productId'); + } + + return $this->signRequest('POST', '/sapi/v1/simple-earn/flexible/setAutoSubscribe', array_merge( + $options, + [ + 'productId' => $productId, + 'autoSubscribe' => $autoSubscribe + ] + )); + } + + /** + * Set Locked Auto Subscribe (USER_DATA) + * + * POST /sapi/v1/simple-earn/locked/setAutoSubscribe + * + * Weight(IP): 150 + * + * @param string $positionId + * @param bool $autoSubscribe + * @param array $options + */ + public function simpleEarnSetLockedAutoSubscribe(string $positionId, bool $autoSubscribe, array $options = []) + { + if (Strings::isEmpty($positionId)) { + throw new MissingArgumentException('positionId'); + } + + return $this->signRequest('POST', '/sapi/v1/simple-earn/locked/setAutoSubscribe', array_merge( + $options, + [ + 'positionId' => $positionId, + 'autoSubscribe' => $autoSubscribe + ] + )); + } + + /** + * Get Flexible Personal Left Quota (USER_DATA) + * + * GET /sapi/v1/simple-earn/flexible/personalLeftQuota + * + * Weight(IP): 150 + * + * @param string $productId + * @param array $options + */ + public function simpleEarnFlexiblePersonalLeftQuota(string $productId, array $options = []) + { + if (Strings::isEmpty($productId)) { + throw new MissingArgumentException('productId'); + } + + return $this->signRequest('GET', '/sapi/v1/simple-earn/flexible/personalLeftQuota', array_merge( + $options, + [ + 'productId' => $productId + ] + )); + } + + /** + * Get Locked Personal Left Quota (USER_DATA) + * + * GET /sapi/v1/simple-earn/locked/personalLeftQuota + * + * Weight(IP): 150 + * + * @param string $projectId + * @param array $options + */ + public function simpleEarnLockedPersonalLeftQuota(string $projectId, array $options = []) + { + if (Strings::isEmpty($projectId)) { + throw new MissingArgumentException('projectId'); + } + + return $this->signRequest('GET', '/sapi/v1/simple-earn/locked/personalLeftQuota', array_merge( + $options, + [ + 'projectId' => $projectId + ] + )); + } + + /** + * Get Flexible Subscription Preview (USER_DATA) + * + * GET /sapi/v1/simple-earn/flexible/subscriptionPreview + * + * Weight(IP): 150 + * + * @param string $productId + * @param mixed $amount + * @param array $options + */ + public function simpleEarnFlexibleSubscriptionPreview(string $productId, $amount, array $options = []) + { + if (Strings::isEmpty($productId)) { + throw new MissingArgumentException('productId'); + } + + return $this->signRequest('GET', '/sapi/v1/simple-earn/flexible/subscriptionPreview', array_merge( + $options, + [ + 'productId' => $productId, + 'amount' => $amount + ] + )); + } + + /** + * Get Locked Subscription Preview (USER_DATA) + * + * GET /sapi/v1/simple-earn/locked/subscriptionPreview + * + * Weight(IP): 150 + * + * @param string $projectId + * @param mixed $amount + * @param array $options + */ + public function simpleEarnLockedSubscriptionPreview(string $projectId, $amount, array $options = []) + { + if (Strings::isEmpty($projectId)) { + throw new MissingArgumentException('projectId'); + } + + return $this->signRequest('GET', '/sapi/v1/simple-earn/locked/subscriptionPreview', array_merge( + $options, + [ + 'projectId' => $projectId, + 'amount' => $amount + ] + )); + } + + /** + * Set Locked Product Redeem Option (USER_DATA) + * + * POST /sapi/v1/simple-earn/locked/setRedeemOption + * + * Set redeem option for Locked product + * + * Weight(IP): 50 + * + * @param string $positionId + * @param string $redeemTo + * @param array $options + */ + public function simpleEarnSetLockedProductRedeemOption(string $positionId, string $redeemTo, array $options = []) + { + if (Strings::isEmpty($positionId)) { + throw new MissingArgumentException('positionId'); + } + if (Strings::isEmpty($redeemTo)) { + throw new MissingArgumentException('redeemTo'); + } + + return $this->signRequest('POST', '/sapi/v1/simple-earn/locked/setRedeemOption', array_merge( + $options, + [ + 'positionId' => $positionId, + 'redeemTo' => $redeemTo + ] + )); + } + + /** + * Get Rate History (USER_DATA) + * + * GET /sapi/v1/simple-earn/flexible/history/rateHistory + * + * Weight(IP): 150 + * + * @param string $productId + * @param array $options + */ + public function simpleEarnRateHistory(string $productId, array $options = []) + { + if (Strings::isEmpty($productId)) { + throw new MissingArgumentException('productId'); + } + + return $this->signRequest('GET', '/sapi/v1/simple-earn/flexible/history/rateHistory', array_merge( + $options, + [ + 'productId' => $productId + ] + )); + } + + /** + * Get Collateral Record (USER_DATA) + * + * GET /sapi/v1/simple-earn/flexible/history/collateralRecord + * + * Weight(IP): 1 + * + * @param array $options + */ + public function simpleEarnCollateralRecord(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/simple-earn/flexible/history/collateralRecord', $options); + } +} diff --git a/src/Binance/Spot/SubAccount.php b/src/Binance/Spot/SubAccount.php index 78b7cbb..0c4c396 100644 --- a/src/Binance/Spot/SubAccount.php +++ b/src/Binance/Spot/SubAccount.php @@ -842,6 +842,173 @@ public function subAccountToggleIpRestriction(string $email, string $subAccountA )); } + /** + * Query Managed Sub Account Transfer Log (For Investor Master Account) + * + * GET /sapi/v1/managed-subaccount/queryTransLogForInvestor + * + * Investor can use this api to query managed sub account transfer log. This endpoint is available for investor of Managed Sub-Account. A Managed Sub-Account is an account type for investors who value flexibility in asset allocation and account application, while delegating trades to a professional trading team. + * + * Weight(IP): 1 + * + * @param string $email + * @param int $startTime + * @param int $endTime + * @param int $page + * @param int $limit + * @param array $options + */ + public function subAccountManagedTransferLogInvestor(string $email, int $startTime, int $endTime, int $page, int $limit, array $options = []) + { + if (Strings::isEmpty($email)) { + throw new MissingArgumentException('email'); + } + + return $this->signRequest('GET', '/sapi/v1/managed-subaccount/queryTransLogForInvestor', array_merge( + $options, + [ + 'email' => $email, + 'startTime' => $startTime, + 'endTime' => $endTime, + 'page' => $page, + 'limit' => $limit + ] + )); + } + + /** + * Query Managed Sub Account Transfer Log (For Trading Team Master Account) + * + * GET /sapi/v1/managed-subaccount/queryTransLogForTradeParent + * + * Trading team can use this api to query managed sub account transfer log. This endpoint is available for trading team of Managed Sub-Account. A Managed Sub-Account is an account type for investors who value flexibility in asset allocation and account application, while delegating trades to a professional trading team + * + * Weight(IP): 60 + * + * @param string $email + * @param int $startTime + * @param int $endTime + * @param int $page + * @param int $limit + * @param array $options + */ + public function subAccountManagedTransferLogTradeParent(string $email, int $startTime, int $endTime, int $page, int $limit, array $options = []) + { + if (Strings::isEmpty($email)) { + throw new MissingArgumentException('email'); + } + + return $this->signRequest('GET', '/sapi/v1/managed-subaccount/queryTransLogForTradeParent', array_merge( + $options, + [ + 'email' => $email, + 'startTime' => $startTime, + 'endTime' => $endTime, + 'page' => $page, + 'limit' => $limit + ] + )); + } + + /** + * Query Managed Sub-account Futures Asset Details (For Investor Master Account) + * + * GET /sapi/v1/managed-subaccount/fetch-future-asset + * + * Investor can use this api to query managed sub account futures asset details + * + * Weight(UID): 60 + * + * @param string $email + * @param array $options + */ + public function subAccountManagedFuturesAssetDetails(string $email, array $options = []) + { + if (Strings::isEmpty($email)) { + throw new MissingArgumentException('email'); + } + + return $this->signRequest('GET', '/sapi/v1/managed-subaccount/fetch-future-asset', array_merge( + $options, + [ + 'email' => $email + ] + )); + } + + /** + * Query Managed Sub-account Margin Asset Details (For Investor Master Account) + * + * GET /sapi/v1/managed-subaccount/marginAsset + * + * Investor can use this api to query managed sub account margin asset details + * + * Weight(IP): 1 + * + * @param string $email + * @param array $options + */ + public function subAccountManagedMarginAssetDetails(string $email, array $options = []) + { + if (Strings::isEmpty($email)) { + throw new MissingArgumentException('email'); + } + + return $this->signRequest('GET', '/sapi/v1/managed-subaccount/marginAsset', array_merge( + $options, + [ + 'email' => $email + ] + )); + } + + /** + * Query Managed Sub-account List (For Investor) + * + * GET /sapi/v1/managed-subaccount/info + * + * Get investor's managed sub-account list. + * + * Weight(UID): 60 + * + * @param array $options + */ + public function subAccountManagedList(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/managed-subaccount/info', $options); + } + + /** + * Get Managed Sub-account Deposit Address (For Investor Master Account) + * + * GET /sapi/v1/managed-subaccount/deposit/address + * + * Get investor's managed sub-account deposit address + * + * Weight(UID): 1 + * + * @param string $email + * @param string $coin + * @param array $options + */ + public function subAccountManagedDepositAddress(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/managed-subaccount/deposit/address', array_merge( + $options, + [ + 'email' => $email, + 'coin' => $coin + ] + )); + } + /** * Get IP Restriction for a Sub-account API Key (For Master Account) * @@ -940,4 +1107,92 @@ public function subAccountDeleteIpList(string $email, string $subAccountApiKey, ] )); } + + /** + * Query Sub-account Transaction Statistics (For Master Account) + * + * GET /sapi/v1/sub-account/transaction-statistics + * + * Query Sub-account Transaction statistics (For Master Account). + * + * Weight(UID): 60 + * + * @param string $email + * @param array $options + */ + public function subAccountTransactionStatistics(string $email, array $options = []) + { + if (Strings::isEmpty($email)) { + throw new MissingArgumentException('email'); + } + + return $this->signRequest('GET', '/sapi/v1/sub-account/transaction-statistics', array_merge( + $options, + [ + 'email' => $email + ] + )); + } + + /** + * Enable Options for Sub-account (For Master Account) + * + * POST /sapi/v1/sub-account/eoptions/enable + * + * Enable Options for Sub-account (For Master Account). + * + * Weight(IP): 1 + * + * @param string $email + * @param array $options + */ + public function subAccountEnableOptionsForSubaccount(string $email, array $options = []) + { + if (Strings::isEmpty($email)) { + throw new MissingArgumentException('email'); + } + + return $this->signRequest('POST', '/sapi/v1/sub-account/eoptions/enable', array_merge( + $options, + [ + 'email' => $email + ] + )); + } + + /** + * Update IP Restriction for Sub-Account API key (For Master Account) + * + * POST /sapi/v2/sub-account/subAccountApi/ipRestriction + * + * Update IP Restriction for Sub-Account API key + * + * Weight(UID): 3000 + * + * @param string $email + * @param string $subAccountApiKey + * @param string $status + * @param array $options + */ + public function subAccountApiUpdateIpRestriction(string $email, string $subAccountApiKey, string $status, array $options = []) + { + if (Strings::isEmpty($email)) { + throw new MissingArgumentException('email'); + } + if (Strings::isEmpty($subAccountApiKey)) { + throw new MissingArgumentException('subAccountApiKey'); + } + if (Strings::isEmpty($status)) { + throw new MissingArgumentException('status'); + } + + return $this->signRequest('POST', '/sapi/v2/sub-account/subAccountApi/ipRestriction', array_merge( + $options, + [ + 'email' => $email, + 'subAccountApiKey' => $subAccountApiKey, + 'status' => $status + ] + )); + } } diff --git a/src/Binance/Spot/Trade.php b/src/Binance/Spot/Trade.php index e859722..a208308 100644 --- a/src/Binance/Spot/Trade.php +++ b/src/Binance/Spot/Trade.php @@ -229,31 +229,29 @@ public function allOrders(string $symbol, array $options = []) } /** - * New OCO (TRADE) + * New Order list - OCO (TRADE) * - * POST /api/v3/order/oco + * POST /api/v3/orderList/oco * - * Send in a new OCO + * Send in an one-cancels-the-other (OCO) pair, where activation of one order immediately cancels the other. * - * - 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. + * - An `OCO` has 2 orders called the above order and below order. + * - One of the orders must be a `LIMIT_MAKER` order and the other must be `STOP_LOSS` or`STOP_LOSS_LIMIT` order. + * - Price restrictions: + * - If the `OCO` is on the `SELL` side: `LIMIT_MAKER` price > Last Traded Price > stopPrice + * - If the `OCO` is on the `BUY` side: `LIMIT_MAKER` price < Last Traded Price < stopPrice + * - OCOs add 2 orders to the unfilled order count, `EXCHANGE_MAX_ORDERS` filter, and the `MAX_NUM_ORDERS` filter. * * Weight(IP): 1 * * @param string $symbol * @param string $side * @param mixed $quantity - * @param mixed $price - * @param mixed $stopPrice + * @param string $aboveType + * @param string $belowType * @param array $options */ - public function newOcoOrder(string $symbol, string $side, $quantity, $price, $stopPrice, array $options = []) + public function newOrderListOco(string $symbol, string $side, $quantity, string $aboveType, string $belowType, array $options = []) { if (Strings::isEmpty($symbol)) { throw new MissingArgumentException('symbol'); @@ -261,15 +259,137 @@ public function newOcoOrder(string $symbol, string $side, $quantity, $price, $st if (Strings::isEmpty($side)) { throw new MissingArgumentException('side'); } + if (Strings::isEmpty($aboveType)) { + throw new MissingArgumentException('aboveType'); + } + if (Strings::isEmpty($belowType)) { + throw new MissingArgumentException('belowType'); + } - return $this->signRequest('POST', '/api/v3/order/oco', array_merge( + return $this->signRequest('POST', '/api/v3/orderList/oco', array_merge( $options, [ 'symbol' => $symbol, 'side' => $side, 'quantity' => $quantity, - 'price' => $price, - 'stopPrice' => $stopPrice + 'aboveType' => $aboveType, + 'belowType' => $belowType + ] + )); + } + + /** + * New Order List - OTO (TRADE) + * + * POST /api/v3/orderList/oto + * + * Places an `OTO`. + * - An `OTO` (One-Triggers-the-Other) is an order list comprised of 2 orders. + * - The first order is called the working order and must be `LIMIT` or `LIMIT_MAKER`. Initially, only the working order goes on the order book. + * - The second order is called the pending order. It can be any order type except for `MARKET` orders using parameter `quoteOrderQty`. The pending order is only placed on the order book when the working order gets fully filled. + * - If either the working order or the pending order is cancelled individually, the other order in the order list will also be canceled or expired. + * - When the order list is placed, if the working order gets immediately fully filled, the placement response will show the working order as `FILLED` but the pending order will still appear as `PENDING_NEW`. You need to query the status of the pending order again to see its updated status. + * - OTOs add 2 orders to the unfilled order count, `EXCHANGE_MAX_NUM_ORDERS` filter and `MAX_NUM_ORDERS` filter. + * + * Weight: 1 + * + * @param string $symbol + * @param string $workingType + * @param string $workingSide + * @param mixed $workingPrice + * @param mixed $workingQuantity + * @param string $pendingType + * @param string $pendingSide + * @param mixed $pendingQuantity + * @param array $options + */ + public function newOrderListOto(string $symbol, string $workingType, string $workingSide, $workingPrice, $workingQuantity, string $pendingType, string $pendingSide, $pendingQuantity, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + if (Strings::isEmpty($workingType)) { + throw new MissingArgumentException('workingType'); + } + if (Strings::isEmpty($workingSide)) { + throw new MissingArgumentException('workingSide'); + } + if (Strings::isEmpty($pendingType)) { + throw new MissingArgumentException('pendingType'); + } + if (Strings::isEmpty($pendingSide)) { + throw new MissingArgumentException('pendingSide'); + } + + return $this->signRequest('POST', '/api/v3/orderList/oto', array_merge( + $options, + [ + 'symbol' => $symbol, + 'workingType' => $workingType, + 'workingSide' => $workingSide, + 'workingPrice' => $workingPrice, + 'workingQuantity' => $workingQuantity, + 'pendingType' => $pendingType, + 'pendingSide' => $pendingSide, + 'pendingQuantity' => $pendingQuantity + ] + )); + } + + /** + * New Order List - OTOCO (TRADE) + * + * POST /api/v3/orderList/otoco + * + * Place an `OTOCO`. + * - An `OTOCO` (One-Triggers-One-Cancels-the-Other) is an order list comprised of 3 orders. + * - The first order is called the working order and must be `LIMIT` or `LIMIT_MAKER`. Initially, only the working order goes on the order book. + * - The behavior of the working order is the same as the `OTO`. + * - `OTOCO` has 2 pending orders (pending above and pending below), forming an `OCO` pair. The pending orders are only placed on the order book when the working order gets fully filled. + * - The rules of the pending above and pending below follow the same rules as the Order List `OCO`. + * - OTOCOs add 3 orders against the unfilled order count, `EXCHANGE_MAX_NUM_ORDERS` filter, and `MAX_NUM_ORDERS` filter. + * + * Weight: 1 + * + * @param string $symbol + * @param string $workingType + * @param string $workingSide + * @param mixed $workingPrice + * @param mixed $workingQuantity + * @param string $pendingSide + * @param mixed $pendingQuantity + * @param string $pendingAboveType + * @param array $options + */ + public function newOrderListOtoco(string $symbol, string $workingType, string $workingSide, $workingPrice, $workingQuantity, string $pendingSide, $pendingQuantity, string $pendingAboveType, array $options = []) + { + if (Strings::isEmpty($symbol)) { + throw new MissingArgumentException('symbol'); + } + if (Strings::isEmpty($workingType)) { + throw new MissingArgumentException('workingType'); + } + if (Strings::isEmpty($workingSide)) { + throw new MissingArgumentException('workingSide'); + } + if (Strings::isEmpty($pendingAboveType)) { + throw new MissingArgumentException('pendingAboveType'); + } + if (Strings::isEmpty($pendingSide)) { + throw new MissingArgumentException('pendingSide'); + } + + return $this->signRequest('POST', '/api/v3/orderList/otoco', array_merge( + $options, + [ + 'symbol' => $symbol, + 'workingType' => $workingType, + 'workingSide' => $workingSide, + 'workingPrice' => $workingPrice, + 'workingQuantity' => $workingQuantity, + 'pendingSide' => $pendingSide, + 'pendingQuantity' => $pendingQuantity, + 'pendingAboveType' => $pendingAboveType ] )); } diff --git a/src/Binance/Spot/Wallet.php b/src/Binance/Spot/Wallet.php index d97c986..c569de0 100644 --- a/src/Binance/Spot/Wallet.php +++ b/src/Binance/Spot/Wallet.php @@ -465,22 +465,6 @@ public function fundingWallet(array $options = []) return $this->signRequest('POST', '/sapi/v1/asset/get-funding-asset', $options); } - /** - * Get symbols delist schedule for spot (MARKET_DATA) - * - * GET /sapi/v1/spot/delist-schedule - * - * - Get symbols delist schedule for spot - * - * Weight(IP): 100 - * - * @param array $options - */ - public function getSymbolsDelistScheduleForSpot(array $options = []) - { - return $this->publicRequest('GET', '/sapi/v1/spot/delist-schedule', $options); - } - /** * Get API Key Permission (USER_DATA) * @@ -496,51 +480,63 @@ public function apiKeyPermission(array $options = []) } /** - * One click arrival deposit apply (for expired address deposit) (USER_DATA) + * Query auto-converting stable coins (USER_DATA) * - * POST /sapi/v1/capital/deposit/credit-apply + * GET /sapi/v1/capital/contract/convertible-coins * - * - Apply deposit credit for expired address (One click arrival) + * - Get a user's auto-conversion settings in deposit/withdrawal * - * Weight(IP): 1 + * Weight(UID): 600 * * @param array $options */ - public function depositCreditApply(array $options = []) + public function queryAutoConvertingStableCoin(array $options = []) { - return $this->signRequest('POST', '/sapi/v1/capital/deposit/credit-apply', $options); + return $this->signRequest('GET', '/sapi/v1/capital/contract/convertible-coins', $options); } /** - * Query auto-converting stable coins (USER_DATA) + * Switch on/off BUSD and stable coins conversion (USER_DATA) * - * GET /sapi/v1/capital/contract/convertible-coins + * POST /sapi/v1/capital/contract/convertible-coins * - * - Get a user's auto-conversion settings in deposit/withdrawal + * User can use it to turn on or turn off the BUSD auto-conversion from/to a specific stable coin. * * Weight(UID): 600 * + * @param string $coin + * @param bool $enable * @param array $options */ - public function queryAutoConvertingStableCoin(array $options = []) + public function switchConvertCoin(string $coin, bool $enable, array $options = []) { - return $this->signRequest('GET', '/sapi/v1/capital/contract/convertible-coins', $options); + if (Strings::isEmpty($coin)) { + throw new MissingArgumentException('coin'); + } + + return $this->signRequest('POST', '/sapi/v1/capital/contract/convertible-coins', array_merge( + $options, + [ + 'coin' => $coin, + 'enable' => $enable + ] + )); } /** - * Query User Wallet Balance (USER_DATA) + * One click arrival deposit apply (for expired address deposit) (USER_DATA) * - * GET /sapi/v1/asset/wallet/balance + * POST /sapi/v1/capital/deposit/credit-apply * - * - Query User Wallet Balance + * - Apply deposit credit for expired address (One click arrival) * - * Weight(IP): 60 + * Weight(IP): 1 * * @param array $options */ - public function queryUserWalletBalance(array $options = []) + public function depositCreditApply(array $options = []) { - return $this->signRequest('GET', '/sapi/v1/asset/wallet/balance', $options); + return $this->signRequest('POST', '/sapi/v1/capital/deposit/credit-apply', $options); } /** @@ -570,31 +566,19 @@ public function fetchDepositAddressListNetwork(string $coin, array $options = [] } /** - * Switch on/off BUSD and stable coins conversion (USER_DATA) + * Query User Wallet Balance (USER_DATA) * - * POST /sapi/v1/capital/contract/convertible-coins + * GET /sapi/v1/asset/wallet/balance * - * User can use it to turn on or turn off the BUSD auto-conversion from/to a specific stable coin. + * - Query User Wallet Balance * - * Weight(UID): 600 + * Weight(IP): 60 * - * @param string $coin - * @param bool $enable * @param array $options */ - public function switchConvertCoin(string $coin, bool $enable, array $options = []) + public function queryUserWalletBalance(array $options = []) { - if (Strings::isEmpty($coin)) { - throw new MissingArgumentException('coin'); - } - - return $this->signRequest('POST', '/sapi/v1/capital/contract/convertible-coins', array_merge( - $options, - [ - 'coin' => $coin, - 'enable' => $enable - ] - )); + return $this->signRequest('GET', '/sapi/v1/asset/wallet/balance', $options); } /** @@ -627,6 +611,22 @@ public function custodyTransferHistory(string $email, int $startTime, int $endTi )); } + /** + * Get symbols delist schedule for spot (MARKET_DATA) + * + * GET /sapi/v1/spot/delist-schedule + * + * Get symbols delist schedule for spot + * + * Weight(IP): 100 + * + * @param array $options + */ + public function getSymbolsDelistScheduleForSpot(array $options = []) + { + return $this->publicRequest('GET', '/sapi/v1/spot/delist-schedule', $options); + } + /** * Fetch withdraw address list (USER_DATA) * @@ -640,4 +640,20 @@ public function withdrawAddressList() { return $this->signRequest('GET', '/sapi/v1/capital/withdraw/address/list'); } + + /** + * Account info (USER_DATA) + * + * GET /sapi/v1/account/info + * + * Fetch account info detail. + * + * Weight(IP): 1 + * + * @param array $options + */ + public function accountInfo(array $options = []) + { + return $this->signRequest('GET', '/sapi/v1/account/info', $options); + } } diff --git a/tests/spot/blvt/BlvtUserLimitInfoTest.php b/tests/spot/autoinvest/AutoInvestAllSourceAssetTargetAssetTest.php similarity index 68% rename from tests/spot/blvt/BlvtUserLimitInfoTest.php rename to tests/spot/autoinvest/AutoInvestAllSourceAssetTargetAssetTest.php index 7609fae..94f9fc1 100644 --- a/tests/spot/blvt/BlvtUserLimitInfoTest.php +++ b/tests/spot/autoinvest/AutoInvestAllSourceAssetTargetAssetTest.php @@ -3,27 +3,25 @@ use Binance\Tests\BaseTestCase; use Aeris\GuzzleHttpMock\Expect; -class BlvtUserLimitInfoTest extends BaseTestCase +class AutoInvestAllSourceAssetTargetAssetTest extends BaseTestCase { public function setUp(): void { parent::setUp(); } - public function testBlvtUserLimitInfo() + public function testAutoInvestAllSourceAssetTargetAsset() { $this->httpMock ->shouldReceiveRequest() - ->withUrl(new Expect\Equals('/sapi/v1/blvt/userLimit')) + ->withUrl(new Expect\Equals('/sapi/v1/lending/auto-invest/all/asset')) ->withMethod('GET') ->withQueryParams(new Expect\ArrayEquals([ - 'tokenName' => 'BTCUP', 'recvWindow' => '5000' ]), ['timestamp', 'signature']) ->andRespondWithJson($this->data, $statusCode = 200); - $response = $this->spotClient->blvtUserLimitInfo([ - 'tokenName' => 'BTCUP', + $response = $this->spotClient->autoInvestAllSourceAssetTargetAsset([ 'recvWindow' => 5000 ]); diff --git a/tests/spot/autoinvest/AutoInvestChangePlanStatusTest.php b/tests/spot/autoinvest/AutoInvestChangePlanStatusTest.php new file mode 100644 index 0000000..eeab0d4 --- /dev/null +++ b/tests/spot/autoinvest/AutoInvestChangePlanStatusTest.php @@ -0,0 +1,37 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/lending/auto-invest/plan/edit-status')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'planId' => '1', + 'status' => 'ONGOING', + 'recvWindow' => '5000' + ])) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->autoInvestChangePlanStatus(1, 'ONGOING', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/autoinvest/AutoInvestHoldingDetailsPlanTest.php b/tests/spot/autoinvest/AutoInvestHoldingDetailsPlanTest.php new file mode 100644 index 0000000..eca1fd5 --- /dev/null +++ b/tests/spot/autoinvest/AutoInvestHoldingDetailsPlanTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/lending/auto-invest/plan/id')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->autoInvestHoldingDetailsPlan([ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/autoinvest/AutoInvestIndexDetailsTest.php b/tests/spot/autoinvest/AutoInvestIndexDetailsTest.php new file mode 100644 index 0000000..7cca579 --- /dev/null +++ b/tests/spot/autoinvest/AutoInvestIndexDetailsTest.php @@ -0,0 +1,36 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/lending/auto-invest/index/info')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'indexId' => '1', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->autoInvestIndexDetails(1, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/autoinvest/AutoInvestIndexLinkedPlanPositionDetailsTest.php b/tests/spot/autoinvest/AutoInvestIndexLinkedPlanPositionDetailsTest.php new file mode 100644 index 0000000..5c1e9c6 --- /dev/null +++ b/tests/spot/autoinvest/AutoInvestIndexLinkedPlanPositionDetailsTest.php @@ -0,0 +1,36 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/lending/auto-invest/index/user-summary')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'indexId' => '1', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->autoInvestIndexLinkedPlanPositionDetails(1, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/autoinvest/AutoInvestIndexLinkedPlanRebalanceDetailsTest.php b/tests/spot/autoinvest/AutoInvestIndexLinkedPlanRebalanceDetailsTest.php new file mode 100644 index 0000000..3e9a5de --- /dev/null +++ b/tests/spot/autoinvest/AutoInvestIndexLinkedPlanRebalanceDetailsTest.php @@ -0,0 +1,39 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/lending/auto-invest/rebalance/history')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'current' => '1', + 'size' => '100', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->AutoInvestIndexLinkedPlanRebalanceDetails([ + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/autoinvest/AutoInvestIndexLinkedPlanRedemptionHistoryTest.php b/tests/spot/autoinvest/AutoInvestIndexLinkedPlanRedemptionHistoryTest.php new file mode 100644 index 0000000..afb96f4 --- /dev/null +++ b/tests/spot/autoinvest/AutoInvestIndexLinkedPlanRedemptionHistoryTest.php @@ -0,0 +1,42 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/lending/auto-invest/redeem/history')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'requestId' => '12345', + 'current' => '1', + 'asset' => 'BTC', + 'size' => '100', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->autoInvestIndexLinkedPlanRedemptionHistory(12345, [ + 'current' => 1, + 'asset' => 'BTC', + 'size' => 100, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/autoinvest/AutoInvestIndexLinkedPlanRedemptionTest.php b/tests/spot/autoinvest/AutoInvestIndexLinkedPlanRedemptionTest.php new file mode 100644 index 0000000..1b3f7af --- /dev/null +++ b/tests/spot/autoinvest/AutoInvestIndexLinkedPlanRedemptionTest.php @@ -0,0 +1,39 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/lending/auto-invest/redeem')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'indexId' => '123456', + 'requestId' => 'TR12354859', + 'redemptionPercentage' => '10', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->autoInvestIndexLinkedPlanRedemption(123456, 10, [ + 'requestId' => 'TR12354859', + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/savings/SavingsCustomizedPositionTest.php b/tests/spot/autoinvest/AutoInvestListPlansTest.php similarity index 62% rename from tests/spot/savings/SavingsCustomizedPositionTest.php rename to tests/spot/autoinvest/AutoInvestListPlansTest.php index dbe7756..b70ac5e 100644 --- a/tests/spot/savings/SavingsCustomizedPositionTest.php +++ b/tests/spot/autoinvest/AutoInvestListPlansTest.php @@ -4,32 +4,32 @@ use Aeris\GuzzleHttpMock\Expect; use Binance\Exception\MissingArgumentException; -class SavingsCustomizedPositionTest extends BaseTestCase +class AutoInvestListPlansTest extends BaseTestCase { public function setUp(): void { parent::setUp(); } - public function testSavingsCustomizedPositionThrowsExceptionWithoutAsset() + public function testAutoInvestListPlansThrowsExceptionWithoutPlanType() { $this->expectException(MissingArgumentException::class); - $response = $this->spotClient->savingsCustomizedPosition(''); + $response = $this->spotClient->autoInvestListPlans(''); } - public function testSavingsCustomizedPosition() + public function testAutoInvestListPlans() { $this->httpMock ->shouldReceiveRequest() - ->withUrl(new Expect\Equals('/sapi/v1/lending/project/position/list')) + ->withUrl(new Expect\Equals('/sapi/v1/lending/auto-invest/plan/list')) ->withMethod('GET') ->withQueryParams(new Expect\ArrayEquals([ - 'asset' => 'BTC', + 'planType' => 'SINGLE', 'recvWindow' => '5000' ]), ['timestamp', 'signature']) ->andRespondWithJson($this->data, $statusCode = 200); - $response = $this->spotClient->savingsCustomizedPosition('BTC', [ + $response = $this->spotClient->autoInvestListPlans('SINGLE', [ 'recvWindow' => 5000 ]); diff --git a/tests/spot/autoinvest/AutoInvestOneTimeTransactionTest.php b/tests/spot/autoinvest/AutoInvestOneTimeTransactionTest.php new file mode 100644 index 0000000..6dbed20 --- /dev/null +++ b/tests/spot/autoinvest/AutoInvestOneTimeTransactionTest.php @@ -0,0 +1,59 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->autoInvestOneTimeTransaction('', 10.1, 'USDT'); + } + + public function testAutoInvestOneTimeTransactionThrowsExceptionWithoutSourceAsset() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->autoInvestOneTimeTransaction('MAIN_SITE', 10.1, ''); + } + + public function testAutoInvestOneTimeTransaction() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/lending/auto-invest/one-off')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'sourceType' => 'MAIN_SITE', + 'requestId' => 'TR12354859', + 'subscriptionAmount' => '10.1', + 'sourceAsset' => 'USDT', + 'flexibleAllowedToUse' => 'true', + 'planId' => '12345', + 'indexId' => '1', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->autoInvestOneTimeTransaction('MAIN_SITE', 10.1, 'USDT', [ + 'requestId' => 'TR12354859', + 'flexibleAllowedToUse' => true, + 'planId' => 12345, + 'indexId' => 1, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/autoinvest/AutoInvestOnetimeTransactionStatusTest.php b/tests/spot/autoinvest/AutoInvestOnetimeTransactionStatusTest.php new file mode 100644 index 0000000..b6dff43 --- /dev/null +++ b/tests/spot/autoinvest/AutoInvestOnetimeTransactionStatusTest.php @@ -0,0 +1,38 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/lending/auto-invest/one-off/status')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'transactionId' => '12345', + 'requestId' => 'TR12354859', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->autoInvestOnetimeTransactionStatus(12345, [ + 'requestId' => 'TR12354859', + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/autoinvest/AutoInvestPlanAdjustmentTest.php b/tests/spot/autoinvest/AutoInvestPlanAdjustmentTest.php new file mode 100644 index 0000000..94aaa93 --- /dev/null +++ b/tests/spot/autoinvest/AutoInvestPlanAdjustmentTest.php @@ -0,0 +1,44 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->autoInvestPlanAdjustment(1, 1, '', 1, ''); + } + + public function testAutoInvestPlanAdjustment() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/lending/auto-invest/plan/edit')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'planId' => '1', + 'subscriptionAmount' => '1', + 'subscriptionCycle' => 'WEEKLY', + 'subscriptionStartTime' => '1', + 'sourceAsset' => 'USDT' + ])) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->autoInvestPlanAdjustment(1, 1, 'WEEKLY', 1, 'USDT'); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/autoinvest/AutoInvestPlanCreationTest.php b/tests/spot/autoinvest/AutoInvestPlanCreationTest.php new file mode 100644 index 0000000..cd30dcf --- /dev/null +++ b/tests/spot/autoinvest/AutoInvestPlanCreationTest.php @@ -0,0 +1,64 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->autoInvestPlanCreation('MAIN_SITE', 'SINGLE', 1.0, 'WEEKLY', 2, '', [['targetAsset' => 'BNB', 'percentage' => 50]]); + } + + public function testAutoInvestPlanCreation() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/lending/auto-invest/plan/add')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'sourceType' => 'MAIN_SITE', + 'planType' => 'SINGLE', + 'subscriptionAmount' => '1', + 'subscriptionCycle' => 'WEEKLY', + 'subscriptionStartTime' => '2', + 'sourceAsset' => 'USDT', + 'details' => json_encode([['targetAsset' => 'BNB', 'percentage' => 50]]), + 'flexibleAllowedToUse' => 'true', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->autoInvestPlanCreation( + 'MAIN_SITE', + 'SINGLE', + 1, + 'WEEKLY', + 2, + 'USDT', + [ + [ + 'targetAsset' => 'BNB', + 'percentage' => 50 + ] + ], + [ + 'flexibleAllowedToUse' => true, + 'recvWindow' => 5000 + ] + ); + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/savings/SavingsInterestHistoryTest.php b/tests/spot/autoinvest/AutoInvestSourceAssetListTest.php similarity index 51% rename from tests/spot/savings/SavingsInterestHistoryTest.php rename to tests/spot/autoinvest/AutoInvestSourceAssetListTest.php index 95c7916..dc52106 100644 --- a/tests/spot/savings/SavingsInterestHistoryTest.php +++ b/tests/spot/autoinvest/AutoInvestSourceAssetListTest.php @@ -4,38 +4,38 @@ use Aeris\GuzzleHttpMock\Expect; use Binance\Exception\MissingArgumentException; -class SavingsInterestHistoryTest extends BaseTestCase +class AutoInvestSourceAssetListTest extends BaseTestCase { public function setUp(): void { parent::setUp(); } - public function testSavingsInterestHistoryThrowsExceptionWithoutLendingType() + public function testAutoInvestSourceAssetListThrowsExceptionWithoutUsageType() { $this->expectException(MissingArgumentException::class); - $response = $this->spotClient->savingsInterestHistory(''); + $response = $this->spotClient->autoInvestSourceAssetList(''); } - public function testSavingsInterestHistory() + public function testAutoInvestSourceAssetList() { $this->httpMock ->shouldReceiveRequest() - ->withUrl(new Expect\Equals('/sapi/v1/lending/union/interestHistory')) + ->withUrl(new Expect\Equals('/sapi/v1/lending/auto-invest/source-asset/list')) ->withMethod('GET') ->withQueryParams(new Expect\ArrayEquals([ - 'lendingType' => 'DAILY', - 'asset' => 'BNB', - 'current' => '1', - 'size' => '100', + 'usageType' => 'RECURRING', + 'targetAsset' => 'BTC', + 'indexId' => '1', + 'flexibleAllowedToUse' => 'true', 'recvWindow' => '5000' ]), ['timestamp', 'signature']) ->andRespondWithJson($this->data, $statusCode = 200); - $response = $this->spotClient->savingsInterestHistory('DAILY', [ - 'asset' => 'BNB', - 'current' => 1, - 'size' => 100, + $response = $this->spotClient->autoInvestSourceAssetList('RECURRING', [ + 'targetAsset' => 'BTC', + 'indexId' => 1, + 'flexibleAllowedToUse' => true, 'recvWindow' => 5000 ]); diff --git a/tests/spot/autoinvest/AutoInvestSubscriptionTransactionHistoryTest.php b/tests/spot/autoinvest/AutoInvestSubscriptionTransactionHistoryTest.php new file mode 100644 index 0000000..7d4939d --- /dev/null +++ b/tests/spot/autoinvest/AutoInvestSubscriptionTransactionHistoryTest.php @@ -0,0 +1,39 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/lending/auto-invest/history/list')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'size' => '100', + 'current' => '1', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->autoInvestSubscriptionTransactionHistory([ + 'size' => 100, + 'current' => 1, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/savings/SavingsFlexibleProductsTest.php b/tests/spot/autoinvest/AutoInvestTargetAssetListTest.php similarity index 73% rename from tests/spot/savings/SavingsFlexibleProductsTest.php rename to tests/spot/autoinvest/AutoInvestTargetAssetListTest.php index 01f66f7..2d75647 100644 --- a/tests/spot/savings/SavingsFlexibleProductsTest.php +++ b/tests/spot/autoinvest/AutoInvestTargetAssetListTest.php @@ -3,29 +3,29 @@ use Binance\Tests\BaseTestCase; use Aeris\GuzzleHttpMock\Expect; -class SavingsFlexibleProductsTest extends BaseTestCase +class AutoInvestTargetAssetListTest extends BaseTestCase { public function setUp(): void { parent::setUp(); } - public function testSavingsFlexibleProducts() + public function testAutoInvestTargetAssetList() { $this->httpMock ->shouldReceiveRequest() - ->withUrl(new Expect\Equals('/sapi/v1/lending/daily/product/list')) + ->withUrl(new Expect\Equals('/sapi/v1/lending/auto-invest/target-asset/list')) ->withMethod('GET') ->withQueryParams(new Expect\ArrayEquals([ - 'current' => '1', 'size' => '100', + 'current' => '1', 'recvWindow' => '5000' ]), ['timestamp', 'signature']) ->andRespondWithJson($this->data, $statusCode = 200); - $response = $this->spotClient->savingsFlexibleProducts([ - 'current' => 1, + $response = $this->spotClient->autoInvestTargetAssetList([ 'size' => 100, + 'current' => 1, 'recvWindow' => 5000 ]); diff --git a/tests/spot/savings/SavingsFlexibleRedemptionQuotaTest.php b/tests/spot/autoinvest/AutoInvestTargetAssetRoiDataTest.php similarity index 53% rename from tests/spot/savings/SavingsFlexibleRedemptionQuotaTest.php rename to tests/spot/autoinvest/AutoInvestTargetAssetRoiDataTest.php index d9e3e0f..c970e12 100644 --- a/tests/spot/savings/SavingsFlexibleRedemptionQuotaTest.php +++ b/tests/spot/autoinvest/AutoInvestTargetAssetRoiDataTest.php @@ -4,39 +4,39 @@ use Aeris\GuzzleHttpMock\Expect; use Binance\Exception\MissingArgumentException; -class SavingsFlexibleRedemptionQuotaTest extends BaseTestCase +class AutoInvestTargetAssetRoiDataTest extends BaseTestCase { public function setUp(): void { parent::setUp(); } - public function testSavingsFlexibleRedemptionQuotaThrowsExceptionWithoutProductId() + public function testAutoInvestTargetAssetRoiDataThrowsExceptionWithoutTargetAsset() { $this->expectException(MissingArgumentException::class); - $response = $this->spotClient->savingsFlexibleRedemptionQuota('', 'FAST'); + $response = $this->spotClient->autoInvestTargetAssetRoiData('', 'FIVE_YEAR'); } - public function testSavingsFlexibleRedemptionQuotaThrowsExceptionWithoutType() + public function testAutoInvestTargetAssetRoiDataThrowsExceptionWithoutHisRoiType() { $this->expectException(MissingArgumentException::class); - $response = $this->spotClient->savingsFlexibleRedemptionQuota('1234', ''); + $response = $this->spotClient->autoInvestTargetAssetRoiData('BTC', ''); } - public function testSavingsFlexibleRedemptionQuota() + public function testAutoInvestTargetAssetRoiData() { $this->httpMock ->shouldReceiveRequest() - ->withUrl(new Expect\Equals('/sapi/v1/lending/daily/userRedemptionQuota')) + ->withUrl(new Expect\Equals('/sapi/v1/lending/auto-invest/target-asset/roi/list')) ->withMethod('GET') ->withQueryParams(new Expect\ArrayEquals([ - 'productId' => '1234', - 'type' => 'FAST', + 'targetAsset' => 'BTC', + 'hisRoiType' => 'FIVE_YEAR', 'recvWindow' => '5000' ]), ['timestamp', 'signature']) ->andRespondWithJson($this->data, $statusCode = 200); - $response = $this->spotClient->savingsFlexibleRedemptionQuota('1234', 'FAST', [ + $response = $this->spotClient->autoInvestTargetAssetRoiData('BTC', 'FIVE_YEAR', [ 'recvWindow' => 5000 ]); diff --git a/tests/spot/blvt/BlvtInfoTest.php b/tests/spot/blvt/BlvtInfoTest.php deleted file mode 100644 index f560c23..0000000 --- a/tests/spot/blvt/BlvtInfoTest.php +++ /dev/null @@ -1,35 +0,0 @@ -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/BlvtSubscriptionRecordTest.php b/tests/spot/blvt/BlvtSubscriptionRecordTest.php deleted file mode 100644 index 7df35a9..0000000 --- a/tests/spot/blvt/BlvtSubscriptionRecordTest.php +++ /dev/null @@ -1,45 +0,0 @@ -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/cryptoloans/CryptoLoansAdjustLtvHistoryTest.php b/tests/spot/cryptoloans/CryptoLoansAdjustLtvHistoryTest.php new file mode 100644 index 0000000..dc86ac9 --- /dev/null +++ b/tests/spot/cryptoloans/CryptoLoansAdjustLtvHistoryTest.php @@ -0,0 +1,43 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v2/loan/flexible/ltv/adjustment/history')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'loanCoin' => 'BUSD', + 'collateralCoin' => 'BNB', + 'current' => '1', + 'limit' => '5', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->cryptoLoansAdjustLtvHistory([ + 'loanCoin' => 'BUSD', + 'collateralCoin' => 'BNB', + 'current' => 1, + 'limit' => 5, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/cryptoloans/CryptoLoansAdjustLtvTest.php b/tests/spot/cryptoloans/CryptoLoansAdjustLtvTest.php index 616f2b5..d9406da 100644 --- a/tests/spot/cryptoloans/CryptoLoansAdjustLtvTest.php +++ b/tests/spot/cryptoloans/CryptoLoansAdjustLtvTest.php @@ -2,8 +2,6 @@ use Binance\Tests\BaseTestCase; use Aeris\GuzzleHttpMock\Expect; -use Binance\Exception\MissingArgumentException; -use Binance\Exception\InvalidArgumentException; class CryptoLoansAdjustLtvTest extends BaseTestCase { @@ -12,33 +10,22 @@ public function setUp(): void parent::setUp(); } - public function testCryptoLoansAdjustLtvThrowsExceptionWithoutAmount() - { - $this->expectException(InvalidArgumentException::class); - $response = $this->spotClient->cryptoLoansAdjustLtv(100000001, 0.0, 'ADDITIONAL'); - } - - public function testCryptoLoansAdjustLtvThrowsExceptionWithoutDirection() - { - $this->expectException(MissingArgumentException::class); - $response = $this->spotClient->cryptoLoansAdjustLtv(100000001, 1.01, ''); - } - public function testCryptoLoansAdjustLtv() { $this->httpMock ->shouldReceiveRequest() - ->withUrl(new Expect\Equals('/sapi/v1/loan/adjust/ltv')) + ->withUrl(new Expect\Equals('/sapi/v2/loan/flexible/adjust/ltv')) ->withMethod('POST') ->withQueryParams(new Expect\ArrayEquals([ - 'orderId' => '100000001', - 'amount' => '1.01', + 'loanCoin' => 'BUSD', + 'collateralCoin' => 'BNB', + 'adjustmentAmount' => '1.01', 'direction' => 'ADDITIONAL', 'recvWindow' => '5000' ]), ['timestamp', 'signature']) ->andRespondWithJson($this->data, $statusCode = 200); - $response = $this->spotClient->cryptoLoansAdjustLtv(100000001, 1.01, 'ADDITIONAL', [ + $response = $this->spotClient->cryptoLoansAdjustLtv('BUSD', 'BNB', 1.01, 'ADDITIONAL', [ 'recvWindow' => 5000 ]); diff --git a/tests/spot/cryptoloans/CryptoLoansBorrowTest.php b/tests/spot/cryptoloans/CryptoLoansBorrowTest.php deleted file mode 100644 index b849c0a..0000000 --- a/tests/spot/cryptoloans/CryptoLoansBorrowTest.php +++ /dev/null @@ -1,58 +0,0 @@ -expectException(MissingArgumentException::class); - $response = $this->spotClient->cryptoLoansBorrow('', 'BNB', 15); - } - - public function testCryptoLoansBorrowThrowsExceptionWithoutCollateralCoin() - { - $this->expectException(MissingArgumentException::class); - $response = $this->spotClient->cryptoLoansBorrow('BUSD', '', 15); - } - - public function testCryptoLoansBorrowThrowsExceptionWithoutLoanTerm() - { - $this->expectException(InvalidArgumentException::class); - $response = $this->spotClient->cryptoLoansBorrow('BUSD', 'BNB', 0); - } - - public function testCryptoLoansBorrow() - { - $this->httpMock - ->shouldReceiveRequest() - ->withUrl(new Expect\Equals('/sapi/v1/loan/borrow')) - ->withMethod('POST') - ->withQueryParams(new Expect\ArrayEquals([ - 'loanCoin' => 'BUSD', - 'collateralCoin' => 'BNB', - 'loanTerm' => '15', - 'recvWindow' => '5000' - ]), ['timestamp', 'signature']) - ->andRespondWithJson($this->data, $statusCode = 200); - - $response = $this->spotClient->cryptoLoansBorrow('BUSD', 'BNB', 15, [ - 'recvWindow' => 5000 - ]); - - $this->assertEquals($response, $this->data); - } - - public function tearDown(): void - { - parent::tearDown(); - } -} diff --git a/tests/spot/cryptoloans/CryptoLoansCollateralRepayRateTest.php b/tests/spot/cryptoloans/CryptoLoansCollateralRepayRateTest.php deleted file mode 100644 index e7d3eac..0000000 --- a/tests/spot/cryptoloans/CryptoLoansCollateralRepayRateTest.php +++ /dev/null @@ -1,58 +0,0 @@ -expectException(MissingArgumentException::class); - $response = $this->spotClient->cryptoLoansCollateralRepayRate('', 'BNB', 1000); - } - - public function testCryptoLoansCollateralRepayRateThrowsExceptionWithoutCollateralCoin() - { - $this->expectException(MissingArgumentException::class); - $response = $this->spotClient->cryptoLoansCollateralRepayRate('BUSD', '', 1000); - } - - public function testCryptoLoansCollateralRepayRateThrowsExceptionWithoutRepayAmount() - { - $this->expectException(InvalidArgumentException::class); - $response = $this->spotClient->cryptoLoansCollateralRepayRate('BUSD', 'BNB', 0.0); - } - - public function testCryptoLoansCollateralRepayRate() - { - $this->httpMock - ->shouldReceiveRequest() - ->withUrl(new Expect\Equals('/sapi/v1/loan/repay/collateral/rate')) - ->withMethod('GET') - ->withQueryParams(new Expect\ArrayEquals([ - 'loanCoin' => 'BUSD', - 'collateralCoin' => 'BNB', - 'repayAmount' => '1000', - 'recvWindow' => '5000' - ]), ['timestamp', 'signature']) - ->andRespondWithJson($this->data, $statusCode = 200); - - $response = $this->spotClient->cryptoLoansCollateralRepayRate('BUSD', 'BNB', 1000, [ - 'recvWindow' => 5000 - ]); - - $this->assertEquals($response, $this->data); - } - - public function tearDown(): void - { - parent::tearDown(); - } -} diff --git a/tests/spot/cryptoloans/CryptoLoansCustomizeMarginCallTest.php b/tests/spot/cryptoloans/CryptoLoansCustomizeMarginCallTest.php deleted file mode 100644 index 3fa0369..0000000 --- a/tests/spot/cryptoloans/CryptoLoansCustomizeMarginCallTest.php +++ /dev/null @@ -1,47 +0,0 @@ -expectException(InvalidArgumentException::class); - $response = $this->spotClient->cryptoLoansCustomizeMarginCall(0.0); - } - - public function testCryptoLoansCustomizeMarginCall() - { - $this->httpMock - ->shouldReceiveRequest() - ->withUrl(new Expect\Equals('/sapi/v1/loan/customize/margin_call')) - ->withMethod('POST') - ->withQueryParams(new Expect\ArrayEquals([ - 'marginCall' => '0.1', - 'orderID' => '100000001', - 'collateralCoin' => 'BNB', - 'recvWindow' => '5000' - ]), ['timestamp', 'signature']) - ->andRespondWithJson($this->data, $statusCode = 200); - - $response = $this->spotClient->cryptoLoansCustomizeMarginCall(0.1, [ - 'orderID' => 100000001, - 'collateralCoin' => 'BNB', - 'recvWindow' => 5000 - ]); - - $this->assertEquals($response, $this->data); - } - - public function tearDown(): void - { - parent::tearDown(); - } -} diff --git a/tests/spot/cryptoloans/CryptoLoansLoanableDataTest.php b/tests/spot/cryptoloans/CryptoLoansFlexibleAssetsDataTest.php similarity index 72% rename from tests/spot/cryptoloans/CryptoLoansLoanableDataTest.php rename to tests/spot/cryptoloans/CryptoLoansFlexibleAssetsDataTest.php index d527e4c..bc6244a 100644 --- a/tests/spot/cryptoloans/CryptoLoansLoanableDataTest.php +++ b/tests/spot/cryptoloans/CryptoLoansFlexibleAssetsDataTest.php @@ -3,18 +3,18 @@ use Binance\Tests\BaseTestCase; use Aeris\GuzzleHttpMock\Expect; -class CryptoLoansLoanableDataTest extends BaseTestCase +class CryptoLoansFlexibleAssetsDataTest extends BaseTestCase { public function setUp(): void { parent::setUp(); } - public function testCryptoLoansLoanableData() + public function testCryptoLoansFlexibleAssetsData() { $this->httpMock ->shouldReceiveRequest() - ->withUrl(new Expect\Equals('/sapi/v1/loan/loanable/data')) + ->withUrl(new Expect\Equals('/sapi/v2/loan/flexible/loanable/data')) ->withMethod('GET') ->withQueryParams(new Expect\ArrayEquals([ 'loanCoin' => 'BUSD', @@ -22,7 +22,7 @@ public function testCryptoLoansLoanableData() ]), ['timestamp', 'signature']) ->andRespondWithJson($this->data, $statusCode = 200); - $response = $this->spotClient->cryptoLoansLoanableData([ + $response = $this->spotClient->cryptoLoansFlexibleAssetsData([ 'loanCoin' => 'BUSD', 'recvWindow' => 5000 ]); diff --git a/tests/spot/cryptoloans/CryptoLoansFlexibleBorrowHistoryTest.php b/tests/spot/cryptoloans/CryptoLoansFlexibleBorrowHistoryTest.php new file mode 100644 index 0000000..0a4da59 --- /dev/null +++ b/tests/spot/cryptoloans/CryptoLoansFlexibleBorrowHistoryTest.php @@ -0,0 +1,43 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v2/loan/flexible/borrow/history')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'loanCoin' => 'BUSD', + 'collateralCoin' => 'BNB', + 'current' => '1', + 'limit' => '5', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->cryptoLoansFlexibleBorrowHistory([ + 'loanCoin' => 'BUSD', + 'collateralCoin' => 'BNB', + 'current' => 1, + 'limit' => 5, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/cryptoloans/CryptoLoansFlexibleBorrowTest.php b/tests/spot/cryptoloans/CryptoLoansFlexibleBorrowTest.php new file mode 100644 index 0000000..47f9949 --- /dev/null +++ b/tests/spot/cryptoloans/CryptoLoansFlexibleBorrowTest.php @@ -0,0 +1,41 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v2/loan/flexible/borrow')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'loanCoin' => 'BUSD', + 'loanAmount' => '100.1', + 'collateralCoin' => 'BNB', + 'collateralAmount' => '50.5', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->cryptoLoansFlexibleBorrow('BUSD', 'BNB', [ + 'loanAmount' => 100.1, + 'collateralAmount' => 50.5, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/cryptoloans/CryptoLoansFlexibleCollateralAssetsDataTest.php b/tests/spot/cryptoloans/CryptoLoansFlexibleCollateralAssetsDataTest.php new file mode 100644 index 0000000..17b2fea --- /dev/null +++ b/tests/spot/cryptoloans/CryptoLoansFlexibleCollateralAssetsDataTest.php @@ -0,0 +1,37 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v2/loan/flexible/collateral/data')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'collateralCoin' => 'BNB', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->cryptoLoansFlexibleCollateralAssetsData([ + 'collateralCoin' => 'BNB', + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/cryptoloans/CryptoLoansFlexibleOngoingOrdersTest.php b/tests/spot/cryptoloans/CryptoLoansFlexibleOngoingOrdersTest.php new file mode 100644 index 0000000..20d1ea0 --- /dev/null +++ b/tests/spot/cryptoloans/CryptoLoansFlexibleOngoingOrdersTest.php @@ -0,0 +1,43 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v2/loan/flexible/ongoing/orders')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'loanCoin' => 'BUSD', + 'collateralCoin' => 'BNB', + 'current' => '1', + 'limit' => '5', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->cryptoLoansFlexibleOngoingOrders([ + 'loanCoin' => 'BUSD', + 'collateralCoin' => 'BNB', + 'current' => 1, + 'limit' => 5, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/cryptoloans/CryptoLoansFlexibleRepayHistoryTest.php b/tests/spot/cryptoloans/CryptoLoansFlexibleRepayHistoryTest.php new file mode 100644 index 0000000..8f45408 --- /dev/null +++ b/tests/spot/cryptoloans/CryptoLoansFlexibleRepayHistoryTest.php @@ -0,0 +1,43 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v2/loan/flexible/repay/history')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'loanCoin' => 'BUSD', + 'collateralCoin' => 'BNB', + 'current' => '1', + 'limit' => '5', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->cryptoLoansFlexibleRepayHistory([ + 'loanCoin' => 'BUSD', + 'collateralCoin' => 'BNB', + 'current' => 1, + 'limit' => 5, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/cryptoloans/CryptoLoansFlexibleRepayTest.php b/tests/spot/cryptoloans/CryptoLoansFlexibleRepayTest.php new file mode 100644 index 0000000..864e7bb --- /dev/null +++ b/tests/spot/cryptoloans/CryptoLoansFlexibleRepayTest.php @@ -0,0 +1,42 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v2/loan/flexible/repay')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'loanCoin' => 'BUSD', + 'collateralCoin' => 'BNB', + 'repayAmount' => '1.01', + 'collateralReturn' => 'true', + 'fullRepayment' => 'true', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->cryptoLoansFlexibleRepay('BUSD', 'BNB', 1.01, [ + 'collateralReturn' => true, + 'fullRepayment' => true, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/cryptoloans/CryptoLoansRepayTest.php b/tests/spot/cryptoloans/CryptoLoansRepayTest.php deleted file mode 100644 index 3f3e604..0000000 --- a/tests/spot/cryptoloans/CryptoLoansRepayTest.php +++ /dev/null @@ -1,44 +0,0 @@ -expectException(InvalidArgumentException::class); - $response = $this->spotClient->cryptoLoansRepay(100000001, 0.0); - } - - public function testCryptoLoansRepay() - { - $this->httpMock - ->shouldReceiveRequest() - ->withUrl(new Expect\Equals('/sapi/v1/loan/repay')) - ->withMethod('POST') - ->withQueryParams(new Expect\ArrayEquals([ - 'orderId' => '100000001', - 'amount' => '1.01', - 'recvWindow' => '5000' - ]), ['timestamp', 'signature']) - ->andRespondWithJson($this->data, $statusCode = 200); - - $response = $this->spotClient->cryptoLoansRepay(100000001, 1.01, [ - 'recvWindow' => 5000 - ]); - - $this->assertEquals($response, $this->data); - } - - public function tearDown(): void - { - parent::tearDown(); - } -} diff --git a/tests/spot/margin/MarginNewOtoOrderTest.php b/tests/spot/margin/MarginNewOtoOrderTest.php new file mode 100644 index 0000000..0dde6d8 --- /dev/null +++ b/tests/spot/margin/MarginNewOtoOrderTest.php @@ -0,0 +1,54 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->marginNewOtoOrder('BNBUSDT', 'LIMIT', '', 600, 1, 'LIMIT', '', 1); + } + + public function testMarginNewOtoOrder() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/margin/order/oto')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'workingType' => 'LIMIT', + 'workingSide' => 'BUY', + 'workingPrice' => '600', + 'workingQuantity' => '1', + 'pendingType' => 'LIMIT', + 'pendingSide' => 'BUY', + 'pendingQuantity' => '1', + 'workingTimeInForce' => 'GTC', + 'pendingPrice' => '595', + 'pendingTimeInForce' => 'GTC' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginNewOtoOrder('BNBUSDT', 'LIMIT', 'BUY', 600, 1, 'LIMIT', 'BUY', 1, [ + 'workingTimeInForce' => 'GTC', + 'pendingPrice' => 595, + 'pendingTimeInForce' => 'GTC' + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/margin/MarginNewOtocoOrderTest.php b/tests/spot/margin/MarginNewOtocoOrderTest.php new file mode 100644 index 0000000..58a89e5 --- /dev/null +++ b/tests/spot/margin/MarginNewOtocoOrderTest.php @@ -0,0 +1,60 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->marginNewOtocoOrder('BNBUSDT', '', '', 600, 1, 'SELL', 1, 'LIMIT_MAKER'); + } + + public function testMarginNewOtocoOrder() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/orderList/otoco')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'workingType' => 'LIMIT', + 'workingSide' => 'BUY', + 'workingPrice' => '600', + 'workingQuantity' => '1', + 'pendingSide' => 'SELL', + 'pendingQuantity' => '1', + 'pendingAboveType' => 'LIMIT_MAKER', + 'workingTimeInForce' => 'GTC', + 'pendingAbovePrice' => '605', + 'pendingBelowType' => 'LIMIT_MAKER', + 'pendingBelowPrice' => '595', + 'workingIcebergQty' => '0.1', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->marginNewOtocoOrder('BNBUSDT', 'LIMIT', 'BUY', 600, 1, 'SELL', 1, 'LIMIT_MAKER', [ + 'workingTimeInForce' => 'GTC', + 'pendingAbovePrice' => 605, + 'pendingBelowType' => 'LIMIT_MAKER', + 'pendingBelowPrice' => 595, + 'workingIcebergQty' => 0.1, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/portfoliomargin/PortfolioMarginProBalanceTest.php b/tests/spot/portfoliomargin/PortfolioMarginProBalanceTest.php new file mode 100644 index 0000000..488cae4 --- /dev/null +++ b/tests/spot/portfoliomargin/PortfolioMarginProBalanceTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/portfolio/balance')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->portfolioMarginProBalance([ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/portfoliomargin/PortfolioMarginProSpanAccountTest.php b/tests/spot/portfoliomargin/PortfolioMarginProSpanAccountTest.php new file mode 100644 index 0000000..b5834cc --- /dev/null +++ b/tests/spot/portfoliomargin/PortfolioMarginProSpanAccountTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v2/portfolio/account')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->portfolioMarginProSpanAccount([ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/portfoliomargin/PortfolioMarginProTieredCollateralRateTest.php b/tests/spot/portfoliomargin/PortfolioMarginProTieredCollateralRateTest.php new file mode 100644 index 0000000..9eddf5d --- /dev/null +++ b/tests/spot/portfoliomargin/PortfolioMarginProTieredCollateralRateTest.php @@ -0,0 +1,35 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v2/portfolio/collateralRate')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->portfolioMarginProTieredCollateralRate([ + '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 deleted file mode 100644 index f2f0dc9..0000000 --- a/tests/spot/savings/SavingsFlexibleRedeemTest.php +++ /dev/null @@ -1,51 +0,0 @@ -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/SavingsRedemptionRecordTest.php b/tests/spot/savings/SavingsRedemptionRecordTest.php deleted file mode 100644 index 8b5fae6..0000000 --- a/tests/spot/savings/SavingsRedemptionRecordTest.php +++ /dev/null @@ -1,49 +0,0 @@ -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/simpleearn/SimpleEarnCollateralRecordTest.php b/tests/spot/simpleearn/SimpleEarnCollateralRecordTest.php new file mode 100644 index 0000000..b2a80c0 --- /dev/null +++ b/tests/spot/simpleearn/SimpleEarnCollateralRecordTest.php @@ -0,0 +1,39 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/simple-earn/flexible/history/collateralRecord')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'current' => '1', + 'size' => '100', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->simpleEarnCollateralRecord([ + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/simpleearn/SimpleEarnFlexiblePersonalLeftQuotaTest.php b/tests/spot/simpleearn/SimpleEarnFlexiblePersonalLeftQuotaTest.php new file mode 100644 index 0000000..f69b8bb --- /dev/null +++ b/tests/spot/simpleearn/SimpleEarnFlexiblePersonalLeftQuotaTest.php @@ -0,0 +1,43 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->simpleEarnFlexiblePersonalLeftQuota(''); + } + + public function testSimpleEarnFlexiblePersonalLeftQuota() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/simple-earn/flexible/personalLeftQuota')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'productId' => '1', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->simpleEarnFlexiblePersonalLeftQuota('1', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/simpleearn/SimpleEarnFlexibleProductListTest.php b/tests/spot/simpleearn/SimpleEarnFlexibleProductListTest.php new file mode 100644 index 0000000..04b2556 --- /dev/null +++ b/tests/spot/simpleearn/SimpleEarnFlexibleProductListTest.php @@ -0,0 +1,41 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/simple-earn/flexible/list')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'asset' => 'BTC', + 'current' => '1', + 'size' => '100', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->simpleEarnFlexibleProductList([ + 'asset' => 'BTC', + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/simpleearn/SimpleEarnFlexibleProductPositionTest.php b/tests/spot/simpleearn/SimpleEarnFlexibleProductPositionTest.php new file mode 100644 index 0000000..9908211 --- /dev/null +++ b/tests/spot/simpleearn/SimpleEarnFlexibleProductPositionTest.php @@ -0,0 +1,39 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/simple-earn/flexible/position')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'current' => '1', + 'size' => '100', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->simpleEarnFlexibleProductPosition([ + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/simpleearn/SimpleEarnFlexibleRedemptionRecordTest.php b/tests/spot/simpleearn/SimpleEarnFlexibleRedemptionRecordTest.php new file mode 100644 index 0000000..ca3768f --- /dev/null +++ b/tests/spot/simpleearn/SimpleEarnFlexibleRedemptionRecordTest.php @@ -0,0 +1,37 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/simple-earn/flexible/history/redemptionRecord')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'current' => '1', + 'size' => '100' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->simpleEarnFlexibleRedemptionRecord([ + 'current' => 1, + 'size' => 100 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/simpleearn/SimpleEarnFlexibleRewardsHistoryTest.php b/tests/spot/simpleearn/SimpleEarnFlexibleRewardsHistoryTest.php new file mode 100644 index 0000000..3a4b8ff --- /dev/null +++ b/tests/spot/simpleearn/SimpleEarnFlexibleRewardsHistoryTest.php @@ -0,0 +1,40 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->simpleEarnFlexibleRewardsHistory(''); + } + + public function testSimpleEarnFlexibleRewardsHistory() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/simple-earn/flexible/history/rewardsRecord')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'type' => 'ALL' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->simpleEarnFlexibleRewardsHistory('ALL'); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/simpleearn/SimpleEarnFlexibleSubscriptionPreviewTest.php b/tests/spot/simpleearn/SimpleEarnFlexibleSubscriptionPreviewTest.php new file mode 100644 index 0000000..d6adbad --- /dev/null +++ b/tests/spot/simpleearn/SimpleEarnFlexibleSubscriptionPreviewTest.php @@ -0,0 +1,44 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->simpleEarnFlexibleSubscriptionPreview('', 1.01); + } + + public function testSimpleEarnFlexibleSubscriptionPreview() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/simple-earn/flexible/subscriptionPreview')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'productId' => '1', + 'amount' => '1.01', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->simpleEarnFlexibleSubscriptionPreview('1', 1.01, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/simpleearn/SimpleEarnFlexibleSubscriptionRecordTest.php b/tests/spot/simpleearn/SimpleEarnFlexibleSubscriptionRecordTest.php new file mode 100644 index 0000000..5e50733 --- /dev/null +++ b/tests/spot/simpleearn/SimpleEarnFlexibleSubscriptionRecordTest.php @@ -0,0 +1,39 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/simple-earn/flexible/history/subscriptionRecord')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'current' => '1', + 'size' => '100', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->simpleEarnFlexibleSubscriptionRecord([ + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/savings/SavingsFlexibleProductPositionTest.php b/tests/spot/simpleearn/SimpleEarnLockedPersonalLeftQuotaTest.php similarity index 60% rename from tests/spot/savings/SavingsFlexibleProductPositionTest.php rename to tests/spot/simpleearn/SimpleEarnLockedPersonalLeftQuotaTest.php index e41f470..24524c9 100644 --- a/tests/spot/savings/SavingsFlexibleProductPositionTest.php +++ b/tests/spot/simpleearn/SimpleEarnLockedPersonalLeftQuotaTest.php @@ -4,32 +4,32 @@ use Aeris\GuzzleHttpMock\Expect; use Binance\Exception\MissingArgumentException; -class SavingsFlexibleProductPositionTest extends BaseTestCase +class SimpleEarnLockedPersonalLeftQuotaTest extends BaseTestCase { public function setUp(): void { parent::setUp(); } - public function testSavingsFlexibleProductPositionThrowsExceptionWithoutAsset() + public function testSimpleEarnLockedPersonalLeftQuotaThrowsExceptionWithoutProjectId() { $this->expectException(MissingArgumentException::class); - $response = $this->spotClient->savingsFlexibleProductPosition(''); + $response = $this->spotClient->simpleEarnLockedPersonalLeftQuota(''); } - public function testSavingsFlexibleProductPosition() + public function testSimpleEarnLockedPersonalLeftQuota() { $this->httpMock ->shouldReceiveRequest() - ->withUrl(new Expect\Equals('/sapi/v1/lending/daily/token/position')) + ->withUrl(new Expect\Equals('/sapi/v1/simple-earn/locked/personalLeftQuota')) ->withMethod('GET') ->withQueryParams(new Expect\ArrayEquals([ - 'asset' => 'BTC', + 'projectId' => '1', 'recvWindow' => '5000' ]), ['timestamp', 'signature']) ->andRespondWithJson($this->data, $statusCode = 200); - $response = $this->spotClient->savingsFlexibleProductPosition('BTC', [ + $response = $this->spotClient->simpleEarnLockedPersonalLeftQuota('1', [ 'recvWindow' => 5000 ]); diff --git a/tests/spot/savings/SavingsPurchaseRecordTest.php b/tests/spot/simpleearn/SimpleEarnLockedProductListTest.php similarity index 59% rename from tests/spot/savings/SavingsPurchaseRecordTest.php rename to tests/spot/simpleearn/SimpleEarnLockedProductListTest.php index 1e1aea7..03af7ef 100644 --- a/tests/spot/savings/SavingsPurchaseRecordTest.php +++ b/tests/spot/simpleearn/SimpleEarnLockedProductListTest.php @@ -2,29 +2,21 @@ use Binance\Tests\BaseTestCase; use Aeris\GuzzleHttpMock\Expect; -use Binance\Exception\MissingArgumentException; -class SavingsPurchaseRecordTest extends BaseTestCase +class SimpleEarnLockedProductListTest extends BaseTestCase { public function setUp(): void { parent::setUp(); } - public function testSavingsPurchaseRecordThrowsExceptionWithoutLendingType() - { - $this->expectException(MissingArgumentException::class); - $response = $this->spotClient->savingsPurchaseRecord(''); - } - - public function testSavingsPurchaseRecord() + public function testSimpleEarnLockedProductList() { $this->httpMock ->shouldReceiveRequest() - ->withUrl(new Expect\Equals('/sapi/v1/lending/union/purchaseRecord')) + ->withUrl(new Expect\Equals('/sapi/v1/simple-earn/locked/list')) ->withMethod('GET') ->withQueryParams(new Expect\ArrayEquals([ - 'lendingType' => 'DAILY', 'asset' => 'BNB', 'current' => '1', 'size' => '100', @@ -32,7 +24,7 @@ public function testSavingsPurchaseRecord() ]), ['timestamp', 'signature']) ->andRespondWithJson($this->data, $statusCode = 200); - $response = $this->spotClient->savingsPurchaseRecord('DAILY', [ + $response = $this->spotClient->simpleEarnLockedProductList([ 'asset' => 'BNB', 'current' => 1, 'size' => 100, diff --git a/tests/spot/cryptoloans/CryptoLoansOngoingOrdersTest.php b/tests/spot/simpleearn/SimpleEarnLockedProductPositionTest.php similarity index 61% rename from tests/spot/cryptoloans/CryptoLoansOngoingOrdersTest.php rename to tests/spot/simpleearn/SimpleEarnLockedProductPositionTest.php index 9df6326..e3b9fd2 100644 --- a/tests/spot/cryptoloans/CryptoLoansOngoingOrdersTest.php +++ b/tests/spot/simpleearn/SimpleEarnLockedProductPositionTest.php @@ -3,29 +3,29 @@ use Binance\Tests\BaseTestCase; use Aeris\GuzzleHttpMock\Expect; -class CryptoLoansOngoingOrdersTest extends BaseTestCase +class SimpleEarnLockedProductPositionTest extends BaseTestCase { public function setUp(): void { parent::setUp(); } - public function testCryptoLoansOngoingOrders() + public function testSimpleEarnLockedProductPosition() { $this->httpMock ->shouldReceiveRequest() - ->withUrl(new Expect\Equals('/sapi/v1/loan/ongoing/orders')) + ->withUrl(new Expect\Equals('/sapi/v1/simple-earn/locked/position')) ->withMethod('GET') ->withQueryParams(new Expect\ArrayEquals([ - 'orderId' => '100000001', - 'loanCoin' => 'BUSD', + 'current' => '1', + 'size' => '100', 'recvWindow' => '5000' ]), ['timestamp', 'signature']) ->andRespondWithJson($this->data, $statusCode = 200); - $response = $this->spotClient->cryptoLoansOngoingOrders([ - 'orderId' => 100000001, - 'loanCoin' => 'BUSD', + $response = $this->spotClient->simpleEarnLockedProductPosition([ + 'current' => 1, + 'size' => 100, 'recvWindow' => 5000 ]); diff --git a/tests/spot/simpleearn/SimpleEarnLockedRedemptionRecordTest.php b/tests/spot/simpleearn/SimpleEarnLockedRedemptionRecordTest.php new file mode 100644 index 0000000..c32a381 --- /dev/null +++ b/tests/spot/simpleearn/SimpleEarnLockedRedemptionRecordTest.php @@ -0,0 +1,39 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/simple-earn/locked/history/redemptionRecord')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'current' => '1', + 'size' => '100', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->simpleEarnLockedRedemptionRecord([ + 'current' => 1, + 'size' => 100, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/simpleearn/SimpleEarnLockedRewardsHistoryTest.php b/tests/spot/simpleearn/SimpleEarnLockedRewardsHistoryTest.php new file mode 100644 index 0000000..7607ae6 --- /dev/null +++ b/tests/spot/simpleearn/SimpleEarnLockedRewardsHistoryTest.php @@ -0,0 +1,37 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/simple-earn/locked/history/rewardsRecord')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'size' => '100', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->simpleEarnLockedRewardsHistory([ + 'size' => 100, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/simpleearn/SimpleEarnLockedSubscriptionPreviewTest.php b/tests/spot/simpleearn/SimpleEarnLockedSubscriptionPreviewTest.php new file mode 100644 index 0000000..b97ef60 --- /dev/null +++ b/tests/spot/simpleearn/SimpleEarnLockedSubscriptionPreviewTest.php @@ -0,0 +1,44 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->simpleEarnLockedSubscriptionPreview('', 1.01); + } + + public function testSimpleEarnLockedSubscriptionPreview() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/simple-earn/locked/subscriptionPreview')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'projectId' => '1', + 'amount' => '1.01', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->simpleEarnLockedSubscriptionPreview('1', 1.01, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/simpleearn/SimpleEarnLockedSubscriptionRecordTest.php b/tests/spot/simpleearn/SimpleEarnLockedSubscriptionRecordTest.php new file mode 100644 index 0000000..c2cbfd2 --- /dev/null +++ b/tests/spot/simpleearn/SimpleEarnLockedSubscriptionRecordTest.php @@ -0,0 +1,39 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/simple-earn/locked/history/subscriptionRecord')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'current' => '1', + 'size' => '100', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->simpleEarnLockedSubscriptionRecord([ + '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/simpleearn/SimpleEarnRateHistoryTest.php similarity index 64% rename from tests/spot/savings/SavingsProductListTest.php rename to tests/spot/simpleearn/SimpleEarnRateHistoryTest.php index 686b2c8..85c6a23 100644 --- a/tests/spot/savings/SavingsProductListTest.php +++ b/tests/spot/simpleearn/SimpleEarnRateHistoryTest.php @@ -4,36 +4,34 @@ use Aeris\GuzzleHttpMock\Expect; use Binance\Exception\MissingArgumentException; -class SavingsProductListTest extends BaseTestCase +class SimpleEarnRateHistoryTest extends BaseTestCase { public function setUp(): void { parent::setUp(); } - public function testSavingsProductListThrowsExceptionWithoutType() + public function testSimpleEarnRateHistoryThrowsExceptionWithoutProductId() { $this->expectException(MissingArgumentException::class); - $response = $this->spotClient->savingsProductList(''); + $response = $this->spotClient->simpleEarnRateHistory(''); } - public function testSavingsProductList() + public function testSimpleEarnRateHistory() { $this->httpMock ->shouldReceiveRequest() - ->withUrl(new Expect\Equals('/sapi/v1/lending/project/list')) + ->withUrl(new Expect\Equals('/sapi/v1/simple-earn/flexible/history/rateHistory')) ->withMethod('GET') ->withQueryParams(new Expect\ArrayEquals([ - 'asset' => 'BNB', - 'type' => 'ACTIVITY', + 'productId' => '1', 'current' => '1', 'size' => '100', 'recvWindow' => '5000' ]), ['timestamp', 'signature']) ->andRespondWithJson($this->data, $statusCode = 200); - $response = $this->spotClient->savingsProductList('ACTIVITY', [ - 'asset' => 'BNB', + $response = $this->spotClient->simpleEarnRateHistory('1', [ 'current' => 1, 'size' => 100, 'recvWindow' => 5000 diff --git a/tests/spot/blvt/BlvtSubscribeTest.php b/tests/spot/simpleearn/SimpleEarnRedeemFlexibleProductTest.php similarity index 61% rename from tests/spot/blvt/BlvtSubscribeTest.php rename to tests/spot/simpleearn/SimpleEarnRedeemFlexibleProductTest.php index 33e8109..1e4acd4 100644 --- a/tests/spot/blvt/BlvtSubscribeTest.php +++ b/tests/spot/simpleearn/SimpleEarnRedeemFlexibleProductTest.php @@ -4,33 +4,32 @@ use Aeris\GuzzleHttpMock\Expect; use Binance\Exception\MissingArgumentException; -class BlvtSubscribeTest extends BaseTestCase +class SimpleEarnRedeemFlexibleProductTest extends BaseTestCase { public function setUp(): void { parent::setUp(); } - public function testBlvtSubscribeThrowsExceptionWithoutTokenName() + public function testSimpleEarnRedeemFlexibleProductThrowsExceptionWithoutProductId() { $this->expectException(MissingArgumentException::class); - $response = $this->spotClient->blvtSubscribe('', 1.01); + $response = $this->spotClient->simpleEarnRedeemFlexibleProduct(''); } - public function testBlvtSubscribe() + public function testSimpleEarnRedeemFlexibleProduct() { $this->httpMock ->shouldReceiveRequest() - ->withUrl(new Expect\Equals('/sapi/v1/blvt/subscribe')) + ->withUrl(new Expect\Equals('/sapi/v1/simple-earn/flexible/redeem')) ->withMethod('POST') ->withQueryParams(new Expect\ArrayEquals([ - 'tokenName' => 'BTCDOWN', - 'cost' => '1.01', + 'productId' => '1', 'recvWindow' => '5000' ]), ['timestamp', 'signature']) ->andRespondWithJson($this->data, $statusCode = 200); - $response = $this->spotClient->blvtSubscribe('BTCDOWN', 1.01, [ + $response = $this->spotClient->simpleEarnRedeemFlexibleProduct('1', [ 'recvWindow' => 5000 ]); diff --git a/tests/spot/blvt/BlvtRedeemTest.php b/tests/spot/simpleearn/SimpleEarnRedeemLockedProductTest.php similarity index 61% rename from tests/spot/blvt/BlvtRedeemTest.php rename to tests/spot/simpleearn/SimpleEarnRedeemLockedProductTest.php index c695f48..9273514 100644 --- a/tests/spot/blvt/BlvtRedeemTest.php +++ b/tests/spot/simpleearn/SimpleEarnRedeemLockedProductTest.php @@ -4,33 +4,32 @@ use Aeris\GuzzleHttpMock\Expect; use Binance\Exception\MissingArgumentException; -class BlvtRedeemTest extends BaseTestCase +class SimpleEarnRedeemLockedProductTest extends BaseTestCase { public function setUp(): void { parent::setUp(); } - public function testBlvtRedeemThrowsExceptionWithoutTokenName() + public function testSimpleEarnRedeemLockedProductThrowsExceptionWithoutPositionId() { $this->expectException(MissingArgumentException::class); - $response = $this->spotClient->blvtRedeem('', 1.01); + $response = $this->spotClient->simpleEarnRedeemLockedProduct(''); } - public function testBlvtRedeem() + public function testSimpleEarnRedeemLockedProduct() { $this->httpMock ->shouldReceiveRequest() - ->withUrl(new Expect\Equals('/sapi/v1/blvt/redeem')) + ->withUrl(new Expect\Equals('/sapi/v1/simple-earn/locked/redeem')) ->withMethod('POST') ->withQueryParams(new Expect\ArrayEquals([ - 'tokenName' => 'BTCDOWN', - 'amount' => '1.01', + 'positionId' => '1', 'recvWindow' => '5000' ]), ['timestamp', 'signature']) ->andRespondWithJson($this->data, $statusCode = 200); - $response = $this->spotClient->blvtRedeem('BTCDOWN', 1.01, [ + $response = $this->spotClient->simpleEarnRedeemLockedProduct('1', [ 'recvWindow' => 5000 ]); diff --git a/tests/spot/simpleearn/SimpleEarnSetFlexibleAutoSubscribeTest.php b/tests/spot/simpleearn/SimpleEarnSetFlexibleAutoSubscribeTest.php new file mode 100644 index 0000000..d57da3d --- /dev/null +++ b/tests/spot/simpleearn/SimpleEarnSetFlexibleAutoSubscribeTest.php @@ -0,0 +1,44 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->simpleEarnSetFlexibleAutoSubscribe('', true); + } + + public function testSimpleEarnSetFlexibleAutoSubscribe() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/simple-earn/flexible/setAutoSubscribe')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'productId' => '1', + 'autoSubscribe' => 'true', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->simpleEarnSetFlexibleAutoSubscribe('1', true, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/simpleearn/SimpleEarnSetLockedAutoSubscribeTest.php b/tests/spot/simpleearn/SimpleEarnSetLockedAutoSubscribeTest.php new file mode 100644 index 0000000..6db247e --- /dev/null +++ b/tests/spot/simpleearn/SimpleEarnSetLockedAutoSubscribeTest.php @@ -0,0 +1,44 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->simpleEarnSetLockedAutoSubscribe('', true); + } + + public function testSimpleEarnSetLockedAutoSubscribe() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/simple-earn/locked/setAutoSubscribe')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'positionId' => '1', + 'autoSubscribe' => 'true', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->simpleEarnSetLockedAutoSubscribe('1', true, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/savings/SavingsChangeDailyPositionTest.php b/tests/spot/simpleearn/SimpleEarnSetLockedProductRedeemOptionTest.php similarity index 57% rename from tests/spot/savings/SavingsChangeDailyPositionTest.php rename to tests/spot/simpleearn/SimpleEarnSetLockedProductRedeemOptionTest.php index 7801494..94ca208 100644 --- a/tests/spot/savings/SavingsChangeDailyPositionTest.php +++ b/tests/spot/simpleearn/SimpleEarnSetLockedProductRedeemOptionTest.php @@ -4,35 +4,33 @@ use Aeris\GuzzleHttpMock\Expect; use Binance\Exception\MissingArgumentException; -class SavingsChangeDailyPositionTest extends BaseTestCase +class SimpleEarnSetLockedProductRedeemOptionTest extends BaseTestCase { public function setUp(): void { parent::setUp(); } - public function testSavingsChangeDailyPositionThrowsExceptionWithoutProjectId() + public function testSimpleEarnSetLockedProductRedeemOptionThrowsExceptionWithoutPositionId() { $this->expectException(MissingArgumentException::class); - $response = $this->spotClient->savingsChangeDailyPosition('', 1); + $response = $this->spotClient->simpleEarnSetLockedProductRedeemOption('', ''); } - public function testSavingsChangeDailyPosition() + public function testSimpleEarnSetLockedProductRedeemOption() { $this->httpMock ->shouldReceiveRequest() - ->withUrl(new Expect\Equals('/sapi/v1/lending/positionChanged')) + ->withUrl(new Expect\Equals('/sapi/v1/simple-earn/locked/setRedeemOption')) ->withMethod('POST') ->withQueryParams(new Expect\ArrayEquals([ - 'projectId' => '1234', - 'lot' => '1', - 'positionId' => '100', + 'positionId' => '1', + 'redeemTo' => 'SPOT', 'recvWindow' => '5000' ]), ['timestamp', 'signature']) ->andRespondWithJson($this->data, $statusCode = 200); - $response = $this->spotClient->savingsChangeDailyPosition('1234', 1, [ - 'positionId' => 100, + $response = $this->spotClient->simpleEarnSetLockedProductRedeemOption('1', 'SPOT', [ 'recvWindow' => 5000 ]); diff --git a/tests/spot/cryptoloans/CryptoLoansCollateralDataTest.php b/tests/spot/simpleearn/SimpleEarnSimpleAccountTest.php similarity index 67% rename from tests/spot/cryptoloans/CryptoLoansCollateralDataTest.php rename to tests/spot/simpleearn/SimpleEarnSimpleAccountTest.php index f173215..a681a5f 100644 --- a/tests/spot/cryptoloans/CryptoLoansCollateralDataTest.php +++ b/tests/spot/simpleearn/SimpleEarnSimpleAccountTest.php @@ -3,25 +3,27 @@ use Binance\Tests\BaseTestCase; use Aeris\GuzzleHttpMock\Expect; -class CryptoLoansCollateralDataTest extends BaseTestCase +class SimpleEarnSimpleAccountTest extends BaseTestCase { public function setUp(): void { parent::setUp(); } - public function testCryptoLoansCollateralData() + public function testSimpleEarnSimpleAccount() { $this->httpMock ->shouldReceiveRequest() - ->withUrl(new Expect\Equals('/sapi/v1/loan/collateral/data')) + ->withUrl(new Expect\Equals('/sapi/v1/simple-earn/account')) ->withMethod('GET') ->withQueryParams(new Expect\ArrayEquals([ 'recvWindow' => '5000' ]), ['timestamp', 'signature']) ->andRespondWithJson($this->data, $statusCode = 200); - $response = $this->spotClient->cryptoLoansCollateralData(['recvWindow' => 5000]); + $response = $this->spotClient->simpleEarnSimpleAccount([ + 'recvWindow' => 5000 + ]); $this->assertEquals($response, $this->data); } diff --git a/tests/spot/simpleearn/SimpleEarnSubscribeFlexibleProductTest.php b/tests/spot/simpleearn/SimpleEarnSubscribeFlexibleProductTest.php new file mode 100644 index 0000000..e24cbf5 --- /dev/null +++ b/tests/spot/simpleearn/SimpleEarnSubscribeFlexibleProductTest.php @@ -0,0 +1,44 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->simpleEarnSubscribeFlexibleProduct('', 1.01); + } + + public function testSimpleEarnSubscribeFlexibleProduct() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/simple-earn/flexible/subscribe')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'productId' => '1', + 'amount' => '1.01', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->simpleEarnSubscribeFlexibleProduct('1', 1.01, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/savings/SavingsPurchaseFlexibleProductTest.php b/tests/spot/simpleearn/SimpleEarnSubscribeLockedProductTest.php similarity index 61% rename from tests/spot/savings/SavingsPurchaseFlexibleProductTest.php rename to tests/spot/simpleearn/SimpleEarnSubscribeLockedProductTest.php index 5ad3f3e..5ee2bce 100644 --- a/tests/spot/savings/SavingsPurchaseFlexibleProductTest.php +++ b/tests/spot/simpleearn/SimpleEarnSubscribeLockedProductTest.php @@ -4,33 +4,33 @@ use Aeris\GuzzleHttpMock\Expect; use Binance\Exception\MissingArgumentException; -class SavingsPurchaseFlexibleProductTest extends BaseTestCase +class SimpleEarnSubscribeLockedProductTest extends BaseTestCase { public function setUp(): void { parent::setUp(); } - public function testSavingsPurchaseFlexibleProductThrowsExceptionWithoutProductId() + public function testSimpleEarnSubscribeLockedProductThrowsExceptionWithoutProjectId() { $this->expectException(MissingArgumentException::class); - $response = $this->spotClient->savingsPurchaseFlexibleProduct('', 1.01); + $response = $this->spotClient->simpleEarnSubscribeLockedProduct('', 1.01); } - public function testSavingsPurchaseFlexibleProduct() + public function testSimpleEarnSubscribeLockedProduct() { $this->httpMock ->shouldReceiveRequest() - ->withUrl(new Expect\Equals('/sapi/v1/lending/daily/purchase')) + ->withUrl(new Expect\Equals('/sapi/v1/simple-earn/locked/subscribe')) ->withMethod('POST') ->withQueryParams(new Expect\ArrayEquals([ - 'productId' => '1234', + 'projectId' => '1', 'amount' => '1.01', 'recvWindow' => '5000' ]), ['timestamp', 'signature']) ->andRespondWithJson($this->data, $statusCode = 200); - $response = $this->spotClient->savingsPurchaseFlexibleProduct('1234', 1.01, [ + $response = $this->spotClient->simpleEarnSubscribeLockedProduct('1', 1.01, [ 'recvWindow' => 5000 ]); diff --git a/tests/spot/subaccount/SubAccountApiUpdateIpRestrictionTest.php b/tests/spot/subaccount/SubAccountApiUpdateIpRestrictionTest.php new file mode 100644 index 0000000..5dc3166 --- /dev/null +++ b/tests/spot/subaccount/SubAccountApiUpdateIpRestrictionTest.php @@ -0,0 +1,57 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountApiUpdateIpRestriction('', 'apikey', '1'); + } + + public function testSubaccountApiUpdateIpRestrictionThrowsExceptionWithoutSubAccountApiKey() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountApiUpdateIpRestriction('test@test', '', '1'); + } + + public function testSubaccountApiUpdateIpRestrictionThrowsExceptionWithoutStatus() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountApiUpdateIpRestriction('test@test', 'apikey', ''); + } + + public function testSubaccountApiUpdateIpRestriction() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v2/sub-account/subAccountApi/ipRestriction')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'email' => 'test@test', + 'subAccountApiKey' => 'apikey', + 'status' => '1', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountApiUpdateIpRestriction('test@test', 'apikey', '1', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/savings/SavingsPurchaseCustomizedProjectTest.php b/tests/spot/subaccount/SubAccountEnableOptionsForSubaccountTest.php similarity index 58% rename from tests/spot/savings/SavingsPurchaseCustomizedProjectTest.php rename to tests/spot/subaccount/SubAccountEnableOptionsForSubaccountTest.php index 5213dca..1f07abb 100644 --- a/tests/spot/savings/SavingsPurchaseCustomizedProjectTest.php +++ b/tests/spot/subaccount/SubAccountEnableOptionsForSubaccountTest.php @@ -4,33 +4,32 @@ use Aeris\GuzzleHttpMock\Expect; use Binance\Exception\MissingArgumentException; -class SavingsPurchaseCustomizedProjectTest extends BaseTestCase +class SubAccountEnableOptionsForSubaccountTest extends BaseTestCase { public function setUp(): void { parent::setUp(); } - public function testSavingsPurchaseCustomizedProjectThrowsExceptionWithoutProjectId() + public function testSubAccountEnableOptionsForSubaccountThrowsExceptionWithoutEmail() { $this->expectException(MissingArgumentException::class); - $response = $this->spotClient->savingsPurchaseCustomizedProject('', 1); + $response = $this->spotClient->subAccountEnableOptionsForSubaccount(''); } - public function testSavingsPurchaseCustomizedProject() + public function testSubAccountEnableOptionsForSubaccount() { $this->httpMock ->shouldReceiveRequest() - ->withUrl(new Expect\Equals('/sapi/v1/lending/customizedFixed/purchase')) + ->withUrl(new Expect\Equals('/sapi/v1/sub-account/eoptions/enable')) ->withMethod('POST') ->withQueryParams(new Expect\ArrayEquals([ - 'projectId' => '1234', - 'lot' => '1', + 'email' => 'test@test', 'recvWindow' => '5000' ]), ['timestamp', 'signature']) ->andRespondWithJson($this->data, $statusCode = 200); - $response = $this->spotClient->savingsPurchaseCustomizedProject('1234', 1, [ + $response = $this->spotClient->subAccountEnableOptionsForSubaccount('test@test', [ 'recvWindow' => 5000 ]); diff --git a/tests/spot/subaccount/SubAccountManagedDepositAddressTest.php b/tests/spot/subaccount/SubAccountManagedDepositAddressTest.php new file mode 100644 index 0000000..9a022d1 --- /dev/null +++ b/tests/spot/subaccount/SubAccountManagedDepositAddressTest.php @@ -0,0 +1,52 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountManagedDepositAddress('', 'BNB'); + } + + public function testSubAccountManagedDepositAddressThrowsExceptionWithoutCoin() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountManagedDepositAddress('test@test', ''); + } + + public function testSubAccountManagedDepositAddress() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/managed-subaccount/deposit/address')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'email' => 'test@test', + 'coin' => 'BNB', + 'network' => 'BTC', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountManagedDepositAddress('test@test', 'BNB', [ + 'network' => 'BTC', + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubAccountManagedFuturesAssetDetailsTest.php b/tests/spot/subaccount/SubAccountManagedFuturesAssetDetailsTest.php new file mode 100644 index 0000000..385818d --- /dev/null +++ b/tests/spot/subaccount/SubAccountManagedFuturesAssetDetailsTest.php @@ -0,0 +1,36 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/managed-subaccount/fetch-future-asset')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'email' => 'test@test', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountManagedFuturesAssetDetails('test@test', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubAccountManagedListTest.php b/tests/spot/subaccount/SubAccountManagedListTest.php new file mode 100644 index 0000000..a387513 --- /dev/null +++ b/tests/spot/subaccount/SubAccountManagedListTest.php @@ -0,0 +1,40 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/managed-subaccount/info')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'page' => '1', + 'limit' => '5', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountManagedList([ + 'page' => 1, + 'limit' => 5, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/subaccount/SubAccountManagedMarginAssetDetailsTest.php b/tests/spot/subaccount/SubAccountManagedMarginAssetDetailsTest.php new file mode 100644 index 0000000..bd0dc5d --- /dev/null +++ b/tests/spot/subaccount/SubAccountManagedMarginAssetDetailsTest.php @@ -0,0 +1,43 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->subAccountManagedMarginAssetDetails(''); + } + + public function testSubAccountManagedMarginAssetDetails() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/managed-subaccount/marginAsset')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'email' => 'test@test', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountManagedMarginAssetDetails('test@test', [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/blvt/BlvtRedemptionRecordTest.php b/tests/spot/subaccount/SubAccountManagedTransferLogInvestorTest.php similarity index 53% rename from tests/spot/blvt/BlvtRedemptionRecordTest.php rename to tests/spot/subaccount/SubAccountManagedTransferLogInvestorTest.php index a0aff7c..3bcf4cd 100644 --- a/tests/spot/blvt/BlvtRedemptionRecordTest.php +++ b/tests/spot/subaccount/SubAccountManagedTransferLogInvestorTest.php @@ -3,33 +3,30 @@ use Binance\Tests\BaseTestCase; use Aeris\GuzzleHttpMock\Expect; -class BlvtRedemptionRecordTest extends BaseTestCase +class SubAccountManagedTransferLogInvestorTest extends BaseTestCase { public function setUp(): void { parent::setUp(); } - public function testBlvtRedemptionRecord() + public function testSubAccountManagedTransferLogInvestor() { $this->httpMock ->shouldReceiveRequest() - ->withUrl(new Expect\Equals('/sapi/v1/blvt/redeem/record')) + ->withUrl(new Expect\Equals('/sapi/v1/managed-subaccount/queryTransLogForInvestor')) ->withMethod('GET') ->withQueryParams(new Expect\ArrayEquals([ - 'tokenName' => 'BTCUP', - 'id' => '123', - 'startTime' => '1640995200000', - 'endTime' => '1640995200000', + 'email' => 'test@test', + 'startTime' => '1563189166000', + 'endTime' => '1563282766000', + 'page' => '1', + 'limit' => '5', 'recvWindow' => '5000' ]), ['timestamp', 'signature']) ->andRespondWithJson($this->data, $statusCode = 200); - $response = $this->spotClient->blvtRedemptionRecord([ - 'tokenName' => 'BTCUP', - 'id' => 123, - 'startTime' => 1640995200000, - 'endTime' => 1640995200000, + $response = $this->spotClient->subAccountManagedTransferLogInvestor('test@test', 1563189166000, 1563282766000, 1, 5, [ 'recvWindow' => 5000 ]); diff --git a/tests/spot/subaccount/SubAccountManagedTransferLogTradeParentTest.php b/tests/spot/subaccount/SubAccountManagedTransferLogTradeParentTest.php new file mode 100644 index 0000000..934f19e --- /dev/null +++ b/tests/spot/subaccount/SubAccountManagedTransferLogTradeParentTest.php @@ -0,0 +1,40 @@ +httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/sapi/v1/managed-subaccount/queryTransLogForTradeParent')) + ->withMethod('GET') + ->withQueryParams(new Expect\ArrayEquals([ + 'email' => 'test@test', + 'startTime' => '1563189166000', + 'endTime' => '1563282766000', + 'page' => '1', + 'limit' => '5', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->subAccountManagedTransferLogTradeParent('test@test', 1563189166000, 1563282766000, 1, 5, [ + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/savings/SavingsFlexiblePurchaseQuotaTest.php b/tests/spot/subaccount/SubAccountTransactionStatisticsTest.php similarity index 60% rename from tests/spot/savings/SavingsFlexiblePurchaseQuotaTest.php rename to tests/spot/subaccount/SubAccountTransactionStatisticsTest.php index b83ab53..19251e0 100644 --- a/tests/spot/savings/SavingsFlexiblePurchaseQuotaTest.php +++ b/tests/spot/subaccount/SubAccountTransactionStatisticsTest.php @@ -4,32 +4,32 @@ use Aeris\GuzzleHttpMock\Expect; use Binance\Exception\MissingArgumentException; -class SavingsFlexiblePurchaseQuotaTest extends BaseTestCase +class SubAccountTransactionStatisticsTest extends BaseTestCase { public function setUp(): void { parent::setUp(); } - public function testSavingsFlexiblePurchaseQuotaThrowsExceptionWithoutProductId() + public function testSubAccountTransactionStatisticsThrowsExceptionWithoutEmail() { $this->expectException(MissingArgumentException::class); - $response = $this->spotClient->savingsFlexiblePurchaseQuota(''); + $response = $this->spotClient->subAccountTransactionStatistics(''); } - public function testSavingsFlexiblePurchaseQuota() + public function testSubAccountTransactionStatistics() { $this->httpMock ->shouldReceiveRequest() - ->withUrl(new Expect\Equals('/sapi/v1/lending/daily/userLeftQuota')) + ->withUrl(new Expect\Equals('/sapi/v1/sub-account/transaction-statistics')) ->withMethod('GET') ->withQueryParams(new Expect\ArrayEquals([ - 'productId' => '1234', + 'email' => 'test@test', 'recvWindow' => '5000' ]), ['timestamp', 'signature']) ->andRespondWithJson($this->data, $statusCode = 200); - $response = $this->spotClient->savingsFlexiblePurchaseQuota('1234', [ + $response = $this->spotClient->subAccountTransactionStatistics('test@test', [ 'recvWindow' => 5000 ]); diff --git a/tests/spot/trade/NewOCOOrderTest.php b/tests/spot/trade/NewOCOOrderTest.php deleted file mode 100644 index 9a44fec..0000000 --- a/tests/spot/trade/NewOCOOrderTest.php +++ /dev/null @@ -1,57 +0,0 @@ -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/NewOrderListOcoTest.php b/tests/spot/trade/NewOrderListOcoTest.php new file mode 100644 index 0000000..14fd513 --- /dev/null +++ b/tests/spot/trade/NewOrderListOcoTest.php @@ -0,0 +1,69 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->newOrderListOco('', 'SELL', 1, 'LIMIT_MAKER', 'LIMIT_MAKER'); + } + + public function testNewOrderListOcoThrowsExceptionWithoutSide() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->newOrderListOco('BNBUSDT', '', 1, 'LIMIT_MAKER', 'LIMIT_MAKER'); + } + + public function testNewOrderListOcoThrowsExceptionWithoutAboveType() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->newOrderListOco('BNBUSDT', 'SELL', 1, '', 'LIMIT_MAKER'); + } + + public function testNewOrderListOcoThrowsExceptionWithoutBelowType() + { + $this->expectException(MissingArgumentException::class); + $response = $this->spotClient->newOrderListOco('BNBUSDT', 'SELL', 1, 'LIMIT_MAKER', ''); + } + + public function testNewOrderListOco() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/orderList/oco')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'side' => 'SELL', + 'quantity' => '1', + 'aboveType' => 'LIMIT_MAKER', + 'belowType' => 'LIMIT_MAKER', + 'abovePrice' => '600', + 'belowPrice' => '590', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->newOrderListOco('BNBUSDT', 'SELL', 1, 'LIMIT_MAKER', 'LIMIT_MAKER', [ + 'abovePrice' => 600, + 'belowPrice' => 590, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/trade/NewOrderListOtoTest.php b/tests/spot/trade/NewOrderListOtoTest.php new file mode 100644 index 0000000..e003c22 --- /dev/null +++ b/tests/spot/trade/NewOrderListOtoTest.php @@ -0,0 +1,54 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->newOrderListOto('BNBUSDT', 'LIMIT', '', 600, 1, 'LIMIT', '', 1); + } + + public function testNewOrderListOto() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/orderList/oto')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'workingType' => 'LIMIT', + 'workingSide' => 'BUY', + 'workingPrice' => '600', + 'workingQuantity' => '1', + 'pendingType' => 'LIMIT', + 'pendingSide' => 'BUY', + 'pendingQuantity' => '1', + 'workingTimeInForce' => 'GTC', + 'pendingPrice' => '595', + 'pendingTimeInForce' => 'GTC' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->newOrderListOto('BNBUSDT', 'LIMIT', 'BUY', 600, 1, 'LIMIT', 'BUY', 1, [ + 'workingTimeInForce' => 'GTC', + 'pendingPrice' => 595, + 'pendingTimeInForce' => 'GTC' + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/trade/NewOrderListOtocoTest.php b/tests/spot/trade/NewOrderListOtocoTest.php new file mode 100644 index 0000000..c3b653d --- /dev/null +++ b/tests/spot/trade/NewOrderListOtocoTest.php @@ -0,0 +1,58 @@ +expectException(MissingArgumentException::class); + $response = $this->spotClient->newOrderListOtoco('BNBUSDT', '', '', 600, 1, 'SELL', 1, 'LIMIT_MAKER'); + } + + public function testNewOrderListOtoco() + { + $this->httpMock + ->shouldReceiveRequest() + ->withUrl(new Expect\Equals('/api/v3/orderList/otoco')) + ->withMethod('POST') + ->withQueryParams(new Expect\ArrayEquals([ + 'symbol' => 'BNBUSDT', + 'workingType' => 'LIMIT', + 'workingSide' => 'BUY', + 'workingPrice' => '600', + 'workingQuantity' => '1', + 'pendingSide' => 'SELL', + 'pendingQuantity' => '1', + 'pendingAboveType' => 'LIMIT_MAKER', + 'workingTimeInForce' => 'GTC', + 'pendingAbovePrice' => '605', + 'pendingBelowType' => 'LIMIT_MAKER', + 'pendingBelowPrice' => '595', + 'recvWindow' => '5000' + ]), ['timestamp', 'signature']) + ->andRespondWithJson($this->data, $statusCode = 200); + + $response = $this->spotClient->newOrderListOtoco('BNBUSDT', 'LIMIT', 'BUY', 600, 1, 'SELL', 1, 'LIMIT_MAKER', [ + 'workingTimeInForce' => 'GTC', + 'pendingAbovePrice' => 605, + 'pendingBelowType' => 'LIMIT_MAKER', + 'pendingBelowPrice' => 595, + 'recvWindow' => 5000 + ]); + + $this->assertEquals($response, $this->data); + } + + public function tearDown(): void + { + parent::tearDown(); + } +} diff --git a/tests/spot/savings/SavingsAccountTest.php b/tests/spot/wallet/AccountInfoTest.php similarity index 74% rename from tests/spot/savings/SavingsAccountTest.php rename to tests/spot/wallet/AccountInfoTest.php index f740a86..531f081 100644 --- a/tests/spot/savings/SavingsAccountTest.php +++ b/tests/spot/wallet/AccountInfoTest.php @@ -3,25 +3,25 @@ use Binance\Tests\BaseTestCase; use Aeris\GuzzleHttpMock\Expect; -class SavingsAccountTest extends BaseTestCase +class AccountInfoTest extends BaseTestCase { public function setUp(): void { parent::setUp(); } - public function testSavingsAccount() + public function testAccountInfo() { $this->httpMock ->shouldReceiveRequest() - ->withUrl(new Expect\Equals('/sapi/v1/lending/union/account')) + ->withUrl(new Expect\Equals('/sapi/v1/account/info')) ->withMethod('GET') ->withQueryParams(new Expect\ArrayEquals([ 'recvWindow' => '5000' ]), ['timestamp', 'signature']) ->andRespondWithJson($this->data, $statusCode = 200); - $response = $this->spotClient->savingsAccount([ + $response = $this->spotClient->accountInfo([ 'recvWindow' => 5000 ]); diff --git a/tests/spot/wallet/QueryAutoConvertingStableCoinsTest.php b/tests/spot/wallet/QueryAutoConvertingStableCoinTest.php similarity index 86% rename from tests/spot/wallet/QueryAutoConvertingStableCoinsTest.php rename to tests/spot/wallet/QueryAutoConvertingStableCoinTest.php index 2f79bb3..fb856c9 100644 --- a/tests/spot/wallet/QueryAutoConvertingStableCoinsTest.php +++ b/tests/spot/wallet/QueryAutoConvertingStableCoinTest.php @@ -3,14 +3,14 @@ use Binance\Tests\BaseTestCase; use Aeris\GuzzleHttpMock\Expect; -class QueryAutoConvertingStableCoinsTest extends BaseTestCase +class QueryAutoConvertingStableCoinTest extends BaseTestCase { public function setUp(): void { parent::setUp(); } - public function testQueryAutoConvertingStableCoins() + public function testQueryAutoConvertingStableCoin() { $this->httpMock ->shouldReceiveRequest()