@coinbase-sample/advanced-trade-sdk-ts 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +134 -0
- package/dist/constants.d.ts +7 -0
- package/dist/constants.js +10 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +44 -0
- package/dist/model/Account.d.ts +80 -0
- package/dist/model/Account.js +21 -0
- package/dist/model/Address.d.ts +27 -0
- package/dist/model/Address.js +21 -0
- package/dist/model/AllocatePortfolioRequest.d.ts +37 -0
- package/dist/model/AllocatePortfolioRequest.js +21 -0
- package/dist/model/Allocation.d.ts +25 -0
- package/dist/model/Allocation.js +21 -0
- package/dist/model/AllocationLeg.d.ts +25 -0
- package/dist/model/AllocationLeg.js +21 -0
- package/dist/model/Amount.d.ts +29 -0
- package/dist/model/Amount.js +21 -0
- package/dist/model/ApplePay.d.ts +40 -0
- package/dist/model/ApplePay.js +21 -0
- package/dist/model/ApplePayBraintreeData.d.ts +23 -0
- package/dist/model/ApplePayBraintreeData.js +21 -0
- package/dist/model/Asset.d.ts +30 -0
- package/dist/model/Asset.js +21 -0
- package/dist/model/Balance.d.ts +32 -0
- package/dist/model/Balance.js +21 -0
- package/dist/model/BalancePair.d.ts +24 -0
- package/dist/model/BalancePair.js +21 -0
- package/dist/model/BankAccount.d.ts +25 -0
- package/dist/model/BankAccount.js +21 -0
- package/dist/model/BestBidAskGetProductBookConfig.d.ts +25 -0
- package/dist/model/BestBidAskGetProductBookConfig.js +21 -0
- package/dist/model/BlockchainAddress.d.ts +23 -0
- package/dist/model/BlockchainAddress.js +21 -0
- package/dist/model/BlockchainTransaction.d.ts +23 -0
- package/dist/model/BlockchainTransaction.js +21 -0
- package/dist/model/CTN.d.ts +22 -0
- package/dist/model/CTN.js +21 -0
- package/dist/model/CancelFCMSweepResponse.d.ts +22 -0
- package/dist/model/CancelFCMSweepResponse.js +21 -0
- package/dist/model/CancelOrderResponse.d.ts +34 -0
- package/dist/model/CancelOrderResponse.js +21 -0
- package/dist/model/CancelOrdersRequest.d.ts +25 -0
- package/dist/model/CancelOrdersRequest.js +21 -0
- package/dist/model/CancelOrdersResponse.d.ts +26 -0
- package/dist/model/CancelOrdersResponse.js +21 -0
- package/dist/model/Candle.d.ts +45 -0
- package/dist/model/Candle.js +21 -0
- package/dist/model/Candles.d.ts +23 -0
- package/dist/model/Candles.js +21 -0
- package/dist/model/Card.d.ts +46 -0
- package/dist/model/Card.js +21 -0
- package/dist/model/CardDob.d.ts +24 -0
- package/dist/model/CardDob.js +21 -0
- package/dist/model/Cbit.d.ts +22 -0
- package/dist/model/Cbit.js +21 -0
- package/dist/model/CheckoutPaymentLink.d.ts +22 -0
- package/dist/model/CheckoutPaymentLink.js +21 -0
- package/dist/model/ClosePositionRequest.d.ts +33 -0
- package/dist/model/ClosePositionRequest.js +21 -0
- package/dist/model/ClosePositionResponse.d.ts +34 -0
- package/dist/model/ClosePositionResponse.js +21 -0
- package/dist/model/CoinbaseAccount.d.ts +22 -0
- package/dist/model/CoinbaseAccount.js +21 -0
- package/dist/model/CommitConvertTradeRequest.d.ts +29 -0
- package/dist/model/CommitConvertTradeRequest.js +21 -0
- package/dist/model/CommitConvertTradeResponse.d.ts +23 -0
- package/dist/model/CommitConvertTradeResponse.js +21 -0
- package/dist/model/CreateConvertQuoteRequest.d.ts +38 -0
- package/dist/model/CreateConvertQuoteRequest.js +21 -0
- package/dist/model/CreateConvertQuoteResponse.d.ts +23 -0
- package/dist/model/CreateConvertQuoteResponse.js +21 -0
- package/dist/model/CreatePortfolioRequest.d.ts +25 -0
- package/dist/model/CreatePortfolioRequest.js +21 -0
- package/dist/model/CreatePortfolioResponse.d.ts +23 -0
- package/dist/model/CreatePortfolioResponse.js +21 -0
- package/dist/model/CustodialPool.d.ts +24 -0
- package/dist/model/CustodialPool.js +21 -0
- package/dist/model/DAppWalletAccount.d.ts +24 -0
- package/dist/model/DAppWalletAccount.js +21 -0
- package/dist/model/DAppWalletBlockchainAddress.d.ts +24 -0
- package/dist/model/DAppWalletBlockchainAddress.js +21 -0
- package/dist/model/DefaultAccount.d.ts +23 -0
- package/dist/model/DefaultAccount.js +21 -0
- package/dist/model/DenebIMPS.d.ts +30 -0
- package/dist/model/DenebIMPS.js +21 -0
- package/dist/model/DenebUPI.d.ts +29 -0
- package/dist/model/DenebUPI.js +21 -0
- package/dist/model/DerivativeSettlement.d.ts +25 -0
- package/dist/model/DerivativeSettlement.js +21 -0
- package/dist/model/DerivativeSettlementAccountSettlement.d.ts +33 -0
- package/dist/model/DerivativeSettlementAccountSettlement.js +21 -0
- package/dist/model/DerivativeSettlementEquityReset.d.ts +25 -0
- package/dist/model/DerivativeSettlementEquityReset.js +21 -0
- package/dist/model/DigitalWalletDetails.d.ts +23 -0
- package/dist/model/DigitalWalletDetails.js +21 -0
- package/dist/model/DirectDeposit.d.ts +22 -0
- package/dist/model/DirectDeposit.js +21 -0
- package/dist/model/Disclosure.d.ts +25 -0
- package/dist/model/Disclosure.js +21 -0
- package/dist/model/Edit.d.ts +30 -0
- package/dist/model/Edit.js +21 -0
- package/dist/model/EditOrderError.d.ts +25 -0
- package/dist/model/EditOrderError.js +21 -0
- package/dist/model/EditOrderErrorResponse.d.ts +30 -0
- package/dist/model/EditOrderErrorResponse.js +21 -0
- package/dist/model/EditOrderRequest.d.ts +33 -0
- package/dist/model/EditOrderRequest.js +21 -0
- package/dist/model/EditOrderResponse.d.ts +27 -0
- package/dist/model/EditOrderResponse.js +21 -0
- package/dist/model/EditOrderSuccessResponse.d.ts +25 -0
- package/dist/model/EditOrderSuccessResponse.js +21 -0
- package/dist/model/EditPortfolioRequest.d.ts +25 -0
- package/dist/model/EditPortfolioRequest.js +21 -0
- package/dist/model/EditPortfolioResponse.d.ts +23 -0
- package/dist/model/EditPortfolioResponse.js +21 -0
- package/dist/model/EmailAddress.d.ts +22 -0
- package/dist/model/EmailAddress.js +21 -0
- package/dist/model/Error.d.ts +30 -0
- package/dist/model/Error.js +21 -0
- package/dist/model/ExpiryDate.d.ts +23 -0
- package/dist/model/ExpiryDate.js +21 -0
- package/dist/model/ExtendedTimestamp.d.ts +33 -0
- package/dist/model/ExtendedTimestamp.js +21 -0
- package/dist/model/ExternalPaymentMethod.d.ts +22 -0
- package/dist/model/ExternalPaymentMethod.js +21 -0
- package/dist/model/FCMBalanceSummary.d.ts +73 -0
- package/dist/model/FCMBalanceSummary.js +21 -0
- package/dist/model/FCMPosition.d.ts +54 -0
- package/dist/model/FCMPosition.js +21 -0
- package/dist/model/FCMSweep.d.ts +43 -0
- package/dist/model/FCMSweep.js +21 -0
- package/dist/model/FcmMarginWindowMeasure.d.ts +51 -0
- package/dist/model/FcmMarginWindowMeasure.js +21 -0
- package/dist/model/FcmScheduledMaintenance.d.ts +26 -0
- package/dist/model/FcmScheduledMaintenance.js +21 -0
- package/dist/model/FcmTradingSessionDetails.d.ts +31 -0
- package/dist/model/FcmTradingSessionDetails.js +21 -0
- package/dist/model/Fedwire.d.ts +27 -0
- package/dist/model/Fedwire.js +21 -0
- package/dist/model/FedwireAccount.d.ts +25 -0
- package/dist/model/FedwireAccount.js +21 -0
- package/dist/model/FedwireAddress.d.ts +26 -0
- package/dist/model/FedwireAddress.js +21 -0
- package/dist/model/FedwireInstitution.d.ts +31 -0
- package/dist/model/FedwireInstitution.js +21 -0
- package/dist/model/Fee.d.ts +31 -0
- package/dist/model/Fee.js +21 -0
- package/dist/model/FeeTier.d.ts +49 -0
- package/dist/model/FeeTier.js +21 -0
- package/dist/model/Fill.d.ts +83 -0
- package/dist/model/Fill.js +21 -0
- package/dist/model/FirstDataToken.d.ts +23 -0
- package/dist/model/FirstDataToken.js +21 -0
- package/dist/model/FundMovement.d.ts +27 -0
- package/dist/model/FundMovement.js +21 -0
- package/dist/model/FutureProductDetails.d.ts +43 -0
- package/dist/model/FutureProductDetails.js +21 -0
- package/dist/model/FuturesPosition.d.ts +35 -0
- package/dist/model/FuturesPosition.js +21 -0
- package/dist/model/GetAccountResponse.d.ts +23 -0
- package/dist/model/GetAccountResponse.js +21 -0
- package/dist/model/GetAccountsResponse.d.ts +35 -0
- package/dist/model/GetAccountsResponse.js +21 -0
- package/dist/model/GetApiKeyPermissionsResponse.d.ts +42 -0
- package/dist/model/GetApiKeyPermissionsResponse.js +21 -0
- package/dist/model/GetBalanceSummaryResponse.d.ts +23 -0
- package/dist/model/GetBalanceSummaryResponse.js +21 -0
- package/dist/model/GetBestBidAskResponse.d.ts +23 -0
- package/dist/model/GetBestBidAskResponse.js +21 -0
- package/dist/model/GetCandlesResponse.d.ts +23 -0
- package/dist/model/GetCandlesResponse.js +21 -0
- package/dist/model/GetConvertTradeResponse.d.ts +23 -0
- package/dist/model/GetConvertTradeResponse.js +21 -0
- package/dist/model/GetCurrentMarginWindowResponse.d.ts +31 -0
- package/dist/model/GetCurrentMarginWindowResponse.js +21 -0
- package/dist/model/GetFCMBalanceSummaryResponse.d.ts +23 -0
- package/dist/model/GetFCMBalanceSummaryResponse.js +21 -0
- package/dist/model/GetFCMPositionResponse.d.ts +23 -0
- package/dist/model/GetFCMPositionResponse.js +21 -0
- package/dist/model/GetFCMPositionsResponse.d.ts +23 -0
- package/dist/model/GetFCMPositionsResponse.js +21 -0
- package/dist/model/GetFCMSweepsResponse.d.ts +23 -0
- package/dist/model/GetFCMSweepsResponse.js +21 -0
- package/dist/model/GetFillsResponse.d.ts +30 -0
- package/dist/model/GetFillsResponse.js +21 -0
- package/dist/model/GetHistoricalOrderResponse.d.ts +26 -0
- package/dist/model/GetHistoricalOrderResponse.js +21 -0
- package/dist/model/GetHistoricalOrdersResponse.d.ts +38 -0
- package/dist/model/GetHistoricalOrdersResponse.js +21 -0
- package/dist/model/GetIntradayMarginSettingResponse.d.ts +23 -0
- package/dist/model/GetIntradayMarginSettingResponse.js +21 -0
- package/dist/model/GetMarketTradesResponse.d.ts +31 -0
- package/dist/model/GetMarketTradesResponse.js +21 -0
- package/dist/model/GetPaymentMethodResponse.d.ts +23 -0
- package/dist/model/GetPaymentMethodResponse.js +21 -0
- package/dist/model/GetPaymentMethodsResponse.d.ts +23 -0
- package/dist/model/GetPaymentMethodsResponse.js +21 -0
- package/dist/model/GetPortfolioBreakdownResponse.d.ts +23 -0
- package/dist/model/GetPortfolioBreakdownResponse.js +21 -0
- package/dist/model/GetPortfoliosResponse.d.ts +25 -0
- package/dist/model/GetPortfoliosResponse.js +21 -0
- package/dist/model/GetPositionResponse.d.ts +23 -0
- package/dist/model/GetPositionResponse.js +21 -0
- package/dist/model/GetPositionsResponse.d.ts +25 -0
- package/dist/model/GetPositionsResponse.js +21 -0
- package/dist/model/GetProductBookResponse.d.ts +27 -0
- package/dist/model/GetProductBookResponse.js +21 -0
- package/dist/model/GetProductResponse.d.ts +23 -0
- package/dist/model/GetProductResponse.js +21 -0
- package/dist/model/GetProductsResponse.d.ts +23 -0
- package/dist/model/GetProductsResponse.js +21 -0
- package/dist/model/GetTransactionSummaryResponse.d.ts +61 -0
- package/dist/model/GetTransactionSummaryResponse.js +21 -0
- package/dist/model/GoodsAndServicesTax.d.ts +24 -0
- package/dist/model/GoodsAndServicesTax.js +21 -0
- package/dist/model/GooglePay.d.ts +40 -0
- package/dist/model/GooglePay.js +21 -0
- package/dist/model/GooglePayBraintreeData.d.ts +23 -0
- package/dist/model/GooglePayBraintreeData.js +21 -0
- package/dist/model/HistoricalMarketTrade.d.ts +50 -0
- package/dist/model/HistoricalMarketTrade.js +21 -0
- package/dist/model/Ideal.d.ts +27 -0
- package/dist/model/Ideal.js +21 -0
- package/dist/model/IdentityContractCall.d.ts +23 -0
- package/dist/model/IdentityContractCall.js +21 -0
- package/dist/model/Interac.d.ts +23 -0
- package/dist/model/Interac.js +21 -0
- package/dist/model/InteracAccount.d.ts +34 -0
- package/dist/model/InteracAccount.js +21 -0
- package/dist/model/IntraBank.d.ts +26 -0
- package/dist/model/IntraBank.js +21 -0
- package/dist/model/L2Level.d.ts +23 -0
- package/dist/model/L2Level.js +21 -0
- package/dist/model/LedgerAccount.d.ts +25 -0
- package/dist/model/LedgerAccount.js +21 -0
- package/dist/model/LedgerNamedAccount.d.ts +24 -0
- package/dist/model/LedgerNamedAccount.js +21 -0
- package/dist/model/LimitLimitFok.d.ts +29 -0
- package/dist/model/LimitLimitFok.js +21 -0
- package/dist/model/LimitLimitGtc.d.ts +33 -0
- package/dist/model/LimitLimitGtc.js +21 -0
- package/dist/model/LimitLimitGtd.d.ts +37 -0
- package/dist/model/LimitLimitGtd.js +21 -0
- package/dist/model/Link.d.ts +23 -0
- package/dist/model/Link.js +21 -0
- package/dist/model/LiquidationMarketGtc.d.ts +25 -0
- package/dist/model/LiquidationMarketGtc.js +21 -0
- package/dist/model/LiquidationMarketGtd.d.ts +29 -0
- package/dist/model/LiquidationMarketGtd.js +21 -0
- package/dist/model/LiquidityPool.d.ts +25 -0
- package/dist/model/LiquidityPool.js +21 -0
- package/dist/model/MarginWindow.d.ts +30 -0
- package/dist/model/MarginWindow.js +21 -0
- package/dist/model/MarketMarketIoc.d.ts +29 -0
- package/dist/model/MarketMarketIoc.js +21 -0
- package/dist/model/Merchant.d.ts +22 -0
- package/dist/model/Merchant.js +21 -0
- package/dist/model/Money.d.ts +26 -0
- package/dist/model/Money.js +21 -0
- package/dist/model/MovePortfolioFundsRequest.d.ts +34 -0
- package/dist/model/MovePortfolioFundsRequest.js +21 -0
- package/dist/model/MovePortfolioFundsResponse.d.ts +29 -0
- package/dist/model/MovePortfolioFundsResponse.js +21 -0
- package/dist/model/MultiAssetCollateralRequest.d.ts +29 -0
- package/dist/model/MultiAssetCollateralRequest.js +21 -0
- package/dist/model/MultiAssetCollateralResponse.d.ts +22 -0
- package/dist/model/MultiAssetCollateralResponse.js +21 -0
- package/dist/model/NewOrderErrorResponse.d.ts +43 -0
- package/dist/model/NewOrderErrorResponse.js +21 -0
- package/dist/model/NewOrderRequest.d.ts +56 -0
- package/dist/model/NewOrderRequest.js +21 -0
- package/dist/model/NewOrderResponse.d.ts +34 -0
- package/dist/model/NewOrderResponse.js +21 -0
- package/dist/model/NewOrderSuccessResponse.d.ts +38 -0
- package/dist/model/NewOrderSuccessResponse.js +21 -0
- package/dist/model/Order.d.ts +172 -0
- package/dist/model/Order.js +21 -0
- package/dist/model/OrderConfiguration.d.ts +66 -0
- package/dist/model/OrderConfiguration.js +21 -0
- package/dist/model/OrderPreviewRequest.d.ts +48 -0
- package/dist/model/OrderPreviewRequest.js +21 -0
- package/dist/model/OrderPreviewResponse.d.ts +59 -0
- package/dist/model/OrderPreviewResponse.js +21 -0
- package/dist/model/Owner.d.ts +26 -0
- package/dist/model/Owner.js +21 -0
- package/dist/model/PaymentMethod.d.ts +65 -0
- package/dist/model/PaymentMethod.js +21 -0
- package/dist/model/Paypal.d.ts +25 -0
- package/dist/model/Paypal.js +21 -0
- package/dist/model/PaypalAccount.d.ts +23 -0
- package/dist/model/PaypalAccount.js +21 -0
- package/dist/model/PaypalMerchant.d.ts +22 -0
- package/dist/model/PaypalMerchant.js +21 -0
- package/dist/model/PerpPosition.d.ts +44 -0
- package/dist/model/PerpPosition.js +21 -0
- package/dist/model/PerpetualProductDetails.d.ts +27 -0
- package/dist/model/PerpetualProductDetails.js +21 -0
- package/dist/model/PhoneNumber.d.ts +22 -0
- package/dist/model/PhoneNumber.js +21 -0
- package/dist/model/PixEbanx.d.ts +27 -0
- package/dist/model/PixEbanx.js +21 -0
- package/dist/model/PixEbanxPixDeposit.d.ts +23 -0
- package/dist/model/PixEbanxPixDeposit.js +21 -0
- package/dist/model/PixEbanxPixWithdrawal.d.ts +26 -0
- package/dist/model/PixEbanxPixWithdrawal.js +21 -0
- package/dist/model/PnlConfiguration.d.ts +23 -0
- package/dist/model/PnlConfiguration.js +21 -0
- package/dist/model/Portfolio.d.ts +80 -0
- package/dist/model/Portfolio.js +21 -0
- package/dist/model/PortfolioBalance.d.ts +25 -0
- package/dist/model/PortfolioBalance.js +21 -0
- package/dist/model/PortfolioBalances.d.ts +28 -0
- package/dist/model/PortfolioBalances.js +21 -0
- package/dist/model/PortfolioBreakdown.d.ts +31 -0
- package/dist/model/PortfolioBreakdown.js +21 -0
- package/dist/model/PortfolioPosition.d.ts +32 -0
- package/dist/model/PortfolioPosition.js +21 -0
- package/dist/model/PortfoliosSummary.d.ts +26 -0
- package/dist/model/PortfoliosSummary.js +21 -0
- package/dist/model/Position.d.ts +71 -0
- package/dist/model/Position.js +21 -0
- package/dist/model/PositionSummary.d.ts +23 -0
- package/dist/model/PositionSummary.js +21 -0
- package/dist/model/PreviewEditOrderResponse.d.ts +37 -0
- package/dist/model/PreviewEditOrderResponse.js +21 -0
- package/dist/model/PriceBook.d.ts +29 -0
- package/dist/model/PriceBook.js +21 -0
- package/dist/model/ProAccount.d.ts +26 -0
- package/dist/model/ProAccount.js +21 -0
- package/dist/model/ProInternalAccount.d.ts +23 -0
- package/dist/model/ProInternalAccount.js +21 -0
- package/dist/model/Product.d.ts +167 -0
- package/dist/model/Product.js +21 -0
- package/dist/model/Products.d.ts +30 -0
- package/dist/model/Products.js +21 -0
- package/dist/model/RatConvertTrade.d.ts +67 -0
- package/dist/model/RatConvertTrade.js +21 -0
- package/dist/model/Remitly.d.ts +23 -0
- package/dist/model/Remitly.js +21 -0
- package/dist/model/RemitlyAccount.d.ts +23 -0
- package/dist/model/RemitlyAccount.js +21 -0
- package/dist/model/Rtp.d.ts +28 -0
- package/dist/model/Rtp.js +21 -0
- package/dist/model/RtpAccount.d.ts +23 -0
- package/dist/model/RtpAccount.js +21 -0
- package/dist/model/RtpInstitution.d.ts +22 -0
- package/dist/model/RtpInstitution.js +21 -0
- package/dist/model/ScaledAmount.d.ts +24 -0
- package/dist/model/ScaledAmount.js +21 -0
- package/dist/model/ScheduleFCMSweepRequest.d.ts +25 -0
- package/dist/model/ScheduleFCMSweepRequest.js +21 -0
- package/dist/model/ScheduleFCMSweepResponse.d.ts +22 -0
- package/dist/model/ScheduleFCMSweepResponse.js +21 -0
- package/dist/model/Sepa.d.ts +29 -0
- package/dist/model/Sepa.js +21 -0
- package/dist/model/SepaAccount.d.ts +24 -0
- package/dist/model/SepaAccount.js +21 -0
- package/dist/model/SepaAccountDetail.d.ts +32 -0
- package/dist/model/SepaAccountDetail.js +21 -0
- package/dist/model/SepaInstitution.d.ts +23 -0
- package/dist/model/SepaInstitution.js +21 -0
- package/dist/model/SepaV2.d.ts +46 -0
- package/dist/model/SepaV2.js +21 -0
- package/dist/model/SetIntradayMarginSettingRequest.d.ts +26 -0
- package/dist/model/SetIntradayMarginSettingRequest.js +21 -0
- package/dist/model/SgFast.d.ts +28 -0
- package/dist/model/SgFast.js +21 -0
- package/dist/model/SgFastAccount.d.ts +23 -0
- package/dist/model/SgFastAccount.js +21 -0
- package/dist/model/SgFastInstitution.d.ts +22 -0
- package/dist/model/SgFastInstitution.js +21 -0
- package/dist/model/SgPayNow.d.ts +28 -0
- package/dist/model/SgPayNow.js +21 -0
- package/dist/model/Signet.d.ts +22 -0
- package/dist/model/Signet.js +21 -0
- package/dist/model/SingleProductGetProductBookConfig.d.ts +29 -0
- package/dist/model/SingleProductGetProductBookConfig.js +21 -0
- package/dist/model/Sofort.d.ts +27 -0
- package/dist/model/Sofort.js +21 -0
- package/dist/model/SorLimitIoc.d.ts +29 -0
- package/dist/model/SorLimitIoc.js +21 -0
- package/dist/model/StopLimitStopLimitGtc.d.ts +38 -0
- package/dist/model/StopLimitStopLimitGtc.js +21 -0
- package/dist/model/StopLimitStopLimitGtd.d.ts +42 -0
- package/dist/model/StopLimitStopLimitGtd.js +21 -0
- package/dist/model/SubscriptionInfo.d.ts +30 -0
- package/dist/model/SubscriptionInfo.js +21 -0
- package/dist/model/Swift.d.ts +26 -0
- package/dist/model/Swift.js +21 -0
- package/dist/model/SwiftAccount.d.ts +29 -0
- package/dist/model/SwiftAccount.js +21 -0
- package/dist/model/SwiftInstitution.d.ts +29 -0
- package/dist/model/SwiftInstitution.js +21 -0
- package/dist/model/TaxInfo.d.ts +24 -0
- package/dist/model/TaxInfo.js +21 -0
- package/dist/model/TradeIncentiveInfo.d.ts +28 -0
- package/dist/model/TradeIncentiveInfo.js +21 -0
- package/dist/model/TradeIncentiveMetadata.d.ts +29 -0
- package/dist/model/TradeIncentiveMetadata.js +21 -0
- package/dist/model/TriggerBracketGtc.d.ts +33 -0
- package/dist/model/TriggerBracketGtc.js +21 -0
- package/dist/model/TriggerBracketGtd.d.ts +37 -0
- package/dist/model/TriggerBracketGtd.js +21 -0
- package/dist/model/TriggerBracketPnl.d.ts +23 -0
- package/dist/model/TriggerBracketPnl.js +21 -0
- package/dist/model/TwapLimitGtd.d.ts +41 -0
- package/dist/model/TwapLimitGtd.js +21 -0
- package/dist/model/TypesDecimal.d.ts +28 -0
- package/dist/model/TypesDecimal.js +21 -0
- package/dist/model/Uk.d.ts +29 -0
- package/dist/model/Uk.js +21 -0
- package/dist/model/UkAccount.d.ts +25 -0
- package/dist/model/UkAccount.js +21 -0
- package/dist/model/UkInstitution.d.ts +22 -0
- package/dist/model/UkInstitution.js +21 -0
- package/dist/model/UnitPrice.d.ts +25 -0
- package/dist/model/UnitPrice.js +21 -0
- package/dist/model/User.d.ts +22 -0
- package/dist/model/User.js +21 -0
- package/dist/model/UserWarning.d.ts +28 -0
- package/dist/model/UserWarning.js +21 -0
- package/dist/model/UserWarningContext.d.ts +24 -0
- package/dist/model/UserWarningContext.js +21 -0
- package/dist/model/VaultToken.d.ts +23 -0
- package/dist/model/VaultToken.js +21 -0
- package/dist/model/VendorPayment.d.ts +23 -0
- package/dist/model/VendorPayment.js +21 -0
- package/dist/model/Venue.d.ts +22 -0
- package/dist/model/Venue.js +21 -0
- package/dist/model/WorldpayParams.d.ts +27 -0
- package/dist/model/WorldpayParams.js +21 -0
- package/dist/model/ZaakpayMobikwik.d.ts +25 -0
- package/dist/model/ZaakpayMobikwik.js +21 -0
- package/dist/model/Zengin.d.ts +28 -0
- package/dist/model/Zengin.js +21 -0
- package/dist/model/ZenginAccount.d.ts +24 -0
- package/dist/model/ZenginAccount.js +21 -0
- package/dist/model/ZenginInstitution.d.ts +23 -0
- package/dist/model/ZenginInstitution.js +21 -0
- package/dist/model/ZenginV2.d.ts +28 -0
- package/dist/model/ZenginV2.js +21 -0
- package/dist/model/ZenginV2Account.d.ts +24 -0
- package/dist/model/ZenginV2Account.js +21 -0
- package/dist/model/ZenginV2Institution.d.ts +23 -0
- package/dist/model/ZenginV2Institution.js +21 -0
- package/dist/model/Zepto.d.ts +26 -0
- package/dist/model/Zepto.js +21 -0
- package/dist/model/ZeptoAccount.d.ts +32 -0
- package/dist/model/ZeptoAccount.js +21 -0
- package/dist/model/enums/AccountPlatform.d.ts +25 -0
- package/dist/model/enums/AccountPlatform.js +29 -0
- package/dist/model/enums/AccountType.d.ts +26 -0
- package/dist/model/enums/AccountType.js +30 -0
- package/dist/model/enums/ApplePayResult.d.ts +24 -0
- package/dist/model/enums/ApplePayResult.js +28 -0
- package/dist/model/enums/ApplePayScheme.d.ts +24 -0
- package/dist/model/enums/ApplePayScheme.js +28 -0
- package/dist/model/enums/CancelOrderFailureReason.d.ts +31 -0
- package/dist/model/enums/CancelOrderFailureReason.js +35 -0
- package/dist/model/enums/CardScheme.d.ts +24 -0
- package/dist/model/enums/CardScheme.js +28 -0
- package/dist/model/enums/ContractExpiryType.d.ts +24 -0
- package/dist/model/enums/ContractExpiryType.js +28 -0
- package/dist/model/enums/EditOrderFailureReason.d.ts +35 -0
- package/dist/model/enums/EditOrderFailureReason.js +39 -0
- package/dist/model/enums/ErrorCodes.d.ts +44 -0
- package/dist/model/enums/ErrorCodes.js +48 -0
- package/dist/model/enums/ErrorCta.d.ts +29 -0
- package/dist/model/enums/ErrorCta.js +33 -0
- package/dist/model/enums/ExpiringContractStatus.d.ts +25 -0
- package/dist/model/enums/ExpiringContractStatus.js +29 -0
- package/dist/model/enums/FCMPositionSide.d.ts +24 -0
- package/dist/model/enums/FCMPositionSide.js +28 -0
- package/dist/model/enums/FCMSweepStatus.d.ts +24 -0
- package/dist/model/enums/FCMSweepStatus.js +28 -0
- package/dist/model/enums/FcmMarginWindowType.d.ts +26 -0
- package/dist/model/enums/FcmMarginWindowType.js +30 -0
- package/dist/model/enums/FcmTradingSessionClosedReason.d.ts +28 -0
- package/dist/model/enums/FcmTradingSessionClosedReason.js +32 -0
- package/dist/model/enums/FcmTradingSessionState.d.ts +26 -0
- package/dist/model/enums/FcmTradingSessionState.js +30 -0
- package/dist/model/enums/FedwireInstitutionType.d.ts +34 -0
- package/dist/model/enums/FedwireInstitutionType.js +38 -0
- package/dist/model/enums/FuturesPositionSide.d.ts +24 -0
- package/dist/model/enums/FuturesPositionSide.js +28 -0
- package/dist/model/enums/GetFillsRequestFillsSortBy.d.ts +24 -0
- package/dist/model/enums/GetFillsRequestFillsSortBy.js +28 -0
- package/dist/model/enums/GetHistoricalOrdersRequestHistoricalOrdersSortBy.d.ts +24 -0
- package/dist/model/enums/GetHistoricalOrdersRequestHistoricalOrdersSortBy.js +28 -0
- package/dist/model/enums/GooglePayResult.d.ts +24 -0
- package/dist/model/enums/GooglePayResult.js +28 -0
- package/dist/model/enums/GooglePayScheme.d.ts +24 -0
- package/dist/model/enums/GooglePayScheme.js +28 -0
- package/dist/model/enums/Granularity.d.ts +30 -0
- package/dist/model/enums/Granularity.js +34 -0
- package/dist/model/enums/GstType.d.ts +23 -0
- package/dist/model/enums/GstType.js +27 -0
- package/dist/model/enums/IntradayMarginSetting.d.ts +24 -0
- package/dist/model/enums/IntradayMarginSetting.js +28 -0
- package/dist/model/enums/LiquidityIndicator.d.ts +24 -0
- package/dist/model/enums/LiquidityIndicator.js +28 -0
- package/dist/model/enums/MarginLevelType.d.ts +26 -0
- package/dist/model/enums/MarginLevelType.js +30 -0
- package/dist/model/enums/MarginProfileType.d.ts +24 -0
- package/dist/model/enums/MarginProfileType.js +28 -0
- package/dist/model/enums/MarginType.d.ts +26 -0
- package/dist/model/enums/MarginType.js +30 -0
- package/dist/model/enums/MarginWindowType.d.ts +26 -0
- package/dist/model/enums/MarginWindowType.js +30 -0
- package/dist/model/enums/NewOrderFailureReason.d.ts +66 -0
- package/dist/model/enums/NewOrderFailureReason.js +70 -0
- package/dist/model/enums/OrderExecutionStatus.d.ts +30 -0
- package/dist/model/enums/OrderExecutionStatus.js +34 -0
- package/dist/model/enums/OrderPlacementSource.d.ts +24 -0
- package/dist/model/enums/OrderPlacementSource.js +28 -0
- package/dist/model/enums/OrderSide.d.ts +23 -0
- package/dist/model/enums/OrderSide.js +27 -0
- package/dist/model/enums/OrderType.d.ts +30 -0
- package/dist/model/enums/OrderType.js +34 -0
- package/dist/model/enums/OwnerType.d.ts +26 -0
- package/dist/model/enums/OwnerType.js +30 -0
- package/dist/model/enums/PaymentMethodType.d.ts +75 -0
- package/dist/model/enums/PaymentMethodType.js +79 -0
- package/dist/model/enums/PortfolioLiquidationStatus.d.ts +28 -0
- package/dist/model/enums/PortfolioLiquidationStatus.js +32 -0
- package/dist/model/enums/PortfolioMarginFlags.d.ts +23 -0
- package/dist/model/enums/PortfolioMarginFlags.js +27 -0
- package/dist/model/enums/PortfolioMarginType.d.ts +24 -0
- package/dist/model/enums/PortfolioMarginType.js +28 -0
- package/dist/model/enums/PortfolioType.d.ts +25 -0
- package/dist/model/enums/PortfolioType.js +29 -0
- package/dist/model/enums/PositionSide.d.ts +24 -0
- package/dist/model/enums/PositionSide.js +28 -0
- package/dist/model/enums/PreviewFailureReason.d.ts +95 -0
- package/dist/model/enums/PreviewFailureReason.js +99 -0
- package/dist/model/enums/PreviewWarningMsg.d.ts +24 -0
- package/dist/model/enums/PreviewWarningMsg.js +28 -0
- package/dist/model/enums/ProductType.d.ts +24 -0
- package/dist/model/enums/ProductType.js +28 -0
- package/dist/model/enums/ProductVenue.d.ts +25 -0
- package/dist/model/enums/ProductVenue.js +29 -0
- package/dist/model/enums/RejectReason.d.ts +26 -0
- package/dist/model/enums/RejectReason.js +30 -0
- package/dist/model/enums/RiskManagementType.d.ts +24 -0
- package/dist/model/enums/RiskManagementType.js +28 -0
- package/dist/model/enums/SgPayNowIdentifierType.d.ts +24 -0
- package/dist/model/enums/SgPayNowIdentifierType.js +28 -0
- package/dist/model/enums/StopPriceDirection.d.ts +23 -0
- package/dist/model/enums/StopPriceDirection.js +27 -0
- package/dist/model/enums/StopTriggerStatus.d.ts +25 -0
- package/dist/model/enums/StopTriggerStatus.js +29 -0
- package/dist/model/enums/TimeInForceType.d.ts +26 -0
- package/dist/model/enums/TimeInForceType.js +30 -0
- package/dist/model/enums/TradeStatus.d.ts +26 -0
- package/dist/model/enums/TradeStatus.js +30 -0
- package/dist/rest/accounts/index.d.ts +14 -0
- package/dist/rest/accounts/index.js +37 -0
- package/dist/rest/accounts/types.d.ts +11 -0
- package/dist/rest/accounts/types.js +2 -0
- package/dist/rest/client.d.ts +20 -0
- package/dist/rest/client.js +31 -0
- package/dist/rest/convert/index.d.ts +16 -0
- package/dist/rest/convert/index.js +55 -0
- package/dist/rest/convert/types.d.ts +25 -0
- package/dist/rest/convert/types.js +2 -0
- package/dist/rest/credentials/index.d.ts +6 -0
- package/dist/rest/credentials/index.js +80 -0
- package/dist/rest/data/index.d.ts +12 -0
- package/dist/rest/data/index.js +27 -0
- package/dist/rest/data/types.d.ts +3 -0
- package/dist/rest/data/types.js +2 -0
- package/dist/rest/errors/index.d.ts +22 -0
- package/dist/rest/errors/index.js +31 -0
- package/dist/rest/fees/index.d.ts +12 -0
- package/dist/rest/fees/index.js +28 -0
- package/dist/rest/fees/types.d.ts +10 -0
- package/dist/rest/fees/types.js +2 -0
- package/dist/rest/futures/index.d.ts +28 -0
- package/dist/rest/futures/index.js +106 -0
- package/dist/rest/futures/types.d.ts +35 -0
- package/dist/rest/futures/types.js +2 -0
- package/dist/rest/orders/index.d.ts +28 -0
- package/dist/rest/orders/index.js +114 -0
- package/dist/rest/orders/types.d.ts +71 -0
- package/dist/rest/orders/types.js +2 -0
- package/dist/rest/paymentMethods/index.d.ts +14 -0
- package/dist/rest/paymentMethods/index.js +36 -0
- package/dist/rest/paymentMethods/types.d.ts +9 -0
- package/dist/rest/paymentMethods/types.js +2 -0
- package/dist/rest/perpetuals/index.d.ts +22 -0
- package/dist/rest/perpetuals/index.js +77 -0
- package/dist/rest/perpetuals/types.d.ts +28 -0
- package/dist/rest/perpetuals/types.js +2 -0
- package/dist/rest/portfolios/index.d.ts +22 -0
- package/dist/rest/portfolios/index.js +81 -0
- package/dist/rest/portfolios/types.d.ts +27 -0
- package/dist/rest/portfolios/types.js +2 -0
- package/dist/rest/products/index.d.ts +22 -0
- package/dist/rest/products/index.js +96 -0
- package/dist/rest/products/types.d.ts +52 -0
- package/dist/rest/products/types.js +2 -0
- package/dist/rest/public/index.d.ts +22 -0
- package/dist/rest/public/index.js +76 -0
- package/dist/rest/public/types.d.ts +46 -0
- package/dist/rest/public/types.js +2 -0
- package/dist/rest/shared/toCamelCase.d.ts +1 -0
- package/dist/rest/shared/toCamelCase.js +23 -0
- package/package.json +36 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PortfoliosService = void 0;
|
|
13
|
+
const core_ts_1 = require("@coinbase-sample/core-ts");
|
|
14
|
+
class PortfoliosService {
|
|
15
|
+
constructor(client) {
|
|
16
|
+
this.client = client;
|
|
17
|
+
}
|
|
18
|
+
getPortfolio(request, options) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
const response = yield this.client.request({
|
|
21
|
+
url: `portfolios/${request.portfolioUuid}`,
|
|
22
|
+
callOptions: options,
|
|
23
|
+
});
|
|
24
|
+
return response.data;
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
listPortfolios(request, options) {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
const response = yield this.client.request({
|
|
30
|
+
url: `portfolios`,
|
|
31
|
+
queryParams: request,
|
|
32
|
+
callOptions: options,
|
|
33
|
+
});
|
|
34
|
+
return response.data;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
createPortfolio(request, options) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
const response = yield this.client.request({
|
|
40
|
+
url: `portfolios`,
|
|
41
|
+
bodyParams: request,
|
|
42
|
+
method: core_ts_1.Method.POST,
|
|
43
|
+
callOptions: options,
|
|
44
|
+
});
|
|
45
|
+
return response.data;
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
deletePortfolio(request, options) {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
const response = yield this.client.request({
|
|
51
|
+
url: `portfolios/${request.portfolioUuid}`,
|
|
52
|
+
method: core_ts_1.Method.DELETE,
|
|
53
|
+
callOptions: options,
|
|
54
|
+
});
|
|
55
|
+
return response.data;
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
editPortfolio(request, options) {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
const response = yield this.client.request({
|
|
61
|
+
url: `portfolios/${request.portfolioUuid}`,
|
|
62
|
+
method: core_ts_1.Method.PUT,
|
|
63
|
+
bodyParams: Object.assign(Object.assign({}, request), { portfolioUuid: undefined }),
|
|
64
|
+
callOptions: options,
|
|
65
|
+
});
|
|
66
|
+
return response.data;
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
movePortfolioFunds(request, options) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
const response = yield this.client.request({
|
|
72
|
+
url: `portfolios/move_funds`,
|
|
73
|
+
method: core_ts_1.Method.POST,
|
|
74
|
+
bodyParams: request,
|
|
75
|
+
callOptions: options,
|
|
76
|
+
});
|
|
77
|
+
return response.data;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.PortfoliosService = PortfoliosService;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { PortfolioBreakdown } from '../../model/PortfolioBreakdown';
|
|
2
|
+
import { Portfolio } from '../../model/Portfolio';
|
|
3
|
+
import { CreatePortfolioRequest as createRequestInt } from '../../model/CreatePortfolioRequest';
|
|
4
|
+
import { CreatePortfolioResponse as createResponseInt } from '../../model/CreatePortfolioResponse';
|
|
5
|
+
import { MovePortfolioFundsRequest as moveRequestInt } from '../../model/MovePortfolioFundsRequest';
|
|
6
|
+
import { MovePortfolioFundsResponse as moveResponseInt } from '../../model/MovePortfolioFundsResponse';
|
|
7
|
+
export type GetPortfolioRequest = {
|
|
8
|
+
portfolioUuid: string;
|
|
9
|
+
};
|
|
10
|
+
export type GetPortfolioResponse = PortfolioBreakdown;
|
|
11
|
+
export type ListPortfoliosRequest = Portfolio;
|
|
12
|
+
export type ListPortfoliosResponse = {
|
|
13
|
+
portfolios: Portfolio[];
|
|
14
|
+
};
|
|
15
|
+
export type CreatePortfolioRequest = createRequestInt;
|
|
16
|
+
export type CreatePortfolioResponse = createResponseInt;
|
|
17
|
+
export type DeletePortfolioRequest = {
|
|
18
|
+
portfolioUuid: string;
|
|
19
|
+
};
|
|
20
|
+
export type DeletePortfolioResponse = Record<string, never>;
|
|
21
|
+
export type EditPortfolioRequest = {
|
|
22
|
+
portfolioUuid: string;
|
|
23
|
+
name: string;
|
|
24
|
+
};
|
|
25
|
+
export type EditPortfolioResponse = createResponseInt;
|
|
26
|
+
export type MovePortfolioFundsRequest = moveRequestInt;
|
|
27
|
+
export type MovePortfolioFundsResponse = moveResponseInt;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CoinbaseCallOptions } from '@coinbase-sample/core-ts';
|
|
2
|
+
import { GetBestBidAskRequest, GetBestBidAskResponse, GetProductBookRequest, GetProductBookResponse, GetProductRequest, GetProductResponse, GetProductCandlesRequest, GetProductCandlesResponse, ListProductsRequest, ListProductsResponse, GetProductMarketTradesRequest, GetProductMarketTradesResponse } from './types';
|
|
3
|
+
import { CoinbaseAdvTradeClient } from '../client';
|
|
4
|
+
import { CoinbaseAdvTradeClientException, CoinbaseAdvTradeException } from '../errors';
|
|
5
|
+
export interface IProductsService {
|
|
6
|
+
getBestBidAsk(request: GetBestBidAskRequest, options?: CoinbaseCallOptions): Promise<GetBestBidAskResponse | CoinbaseAdvTradeClientException | CoinbaseAdvTradeException>;
|
|
7
|
+
getProduct(request: GetProductRequest, options?: CoinbaseCallOptions): Promise<GetProductResponse | CoinbaseAdvTradeClientException | CoinbaseAdvTradeException>;
|
|
8
|
+
getProductBook(request: GetProductBookRequest, options?: CoinbaseCallOptions): Promise<GetProductBookResponse | CoinbaseAdvTradeClientException | CoinbaseAdvTradeException>;
|
|
9
|
+
getProductCandles(request: GetProductCandlesRequest, options?: CoinbaseCallOptions): Promise<GetProductCandlesResponse | CoinbaseAdvTradeClientException | CoinbaseAdvTradeException>;
|
|
10
|
+
getProductMarketTrades(request: GetProductMarketTradesRequest, options?: CoinbaseCallOptions): Promise<GetProductMarketTradesResponse | CoinbaseAdvTradeClientException | CoinbaseAdvTradeException>;
|
|
11
|
+
listProducts(request: ListProductsRequest, options?: CoinbaseCallOptions): Promise<ListProductsResponse | CoinbaseAdvTradeClientException | CoinbaseAdvTradeException>;
|
|
12
|
+
}
|
|
13
|
+
export declare class ProductsService implements IProductsService {
|
|
14
|
+
private client;
|
|
15
|
+
constructor(client: CoinbaseAdvTradeClient);
|
|
16
|
+
getBestBidAsk(request: GetBestBidAskRequest, options?: CoinbaseCallOptions): Promise<GetBestBidAskResponse | CoinbaseAdvTradeClientException | CoinbaseAdvTradeException>;
|
|
17
|
+
getProduct(request: GetProductRequest, options?: CoinbaseCallOptions): Promise<GetProductResponse | CoinbaseAdvTradeClientException | CoinbaseAdvTradeException>;
|
|
18
|
+
getProductBook(request: GetProductBookRequest, options?: CoinbaseCallOptions): Promise<GetProductBookResponse | CoinbaseAdvTradeClientException | CoinbaseAdvTradeException>;
|
|
19
|
+
getProductCandles(request: GetProductCandlesRequest, options?: CoinbaseCallOptions): Promise<GetProductCandlesResponse | CoinbaseAdvTradeClientException | CoinbaseAdvTradeException>;
|
|
20
|
+
getProductMarketTrades(request: GetProductMarketTradesRequest, options?: CoinbaseCallOptions): Promise<GetProductMarketTradesResponse | CoinbaseAdvTradeClientException | CoinbaseAdvTradeException>;
|
|
21
|
+
listProducts(request: ListProductsRequest, options?: CoinbaseCallOptions): Promise<ListProductsResponse | CoinbaseAdvTradeClientException | CoinbaseAdvTradeException>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ProductsService = void 0;
|
|
13
|
+
class ProductsService {
|
|
14
|
+
constructor(client) {
|
|
15
|
+
this.client = client;
|
|
16
|
+
}
|
|
17
|
+
getBestBidAsk(request, options) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
let queryParams = {};
|
|
20
|
+
if (request.productIds) {
|
|
21
|
+
queryParams = {
|
|
22
|
+
productIds: request.productIds.join(','),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const response = yield this.client.request({
|
|
26
|
+
url: `best_bid_ask`,
|
|
27
|
+
queryParams,
|
|
28
|
+
callOptions: options,
|
|
29
|
+
});
|
|
30
|
+
return response.data;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
getProduct(request, options) {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
let queryParams = {};
|
|
36
|
+
if (request.getTradabilityStatus) {
|
|
37
|
+
queryParams = {
|
|
38
|
+
getTradabilityStatus: request.getTradabilityStatus,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const response = yield this.client.request({
|
|
42
|
+
url: `products/${request.productId}`,
|
|
43
|
+
queryParams,
|
|
44
|
+
callOptions: options,
|
|
45
|
+
});
|
|
46
|
+
return response.data;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
getProductBook(request, options) {
|
|
50
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
+
const response = yield this.client.request({
|
|
52
|
+
url: `product_book`,
|
|
53
|
+
queryParams: request,
|
|
54
|
+
callOptions: options,
|
|
55
|
+
});
|
|
56
|
+
return response.data;
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
getProductCandles(request, options) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
const queryParams = {
|
|
62
|
+
start: request.start,
|
|
63
|
+
end: request.end,
|
|
64
|
+
granularity: request.granularity,
|
|
65
|
+
limit: request.limit || 350,
|
|
66
|
+
};
|
|
67
|
+
const response = yield this.client.request({
|
|
68
|
+
url: `products/${request.productId}/candles`,
|
|
69
|
+
queryParams,
|
|
70
|
+
callOptions: options,
|
|
71
|
+
});
|
|
72
|
+
return response.data;
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
getProductMarketTrades(request, options) {
|
|
76
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
const response = yield this.client.request({
|
|
78
|
+
url: `products/${request.productId}/ticker`,
|
|
79
|
+
queryParams: request,
|
|
80
|
+
callOptions: options,
|
|
81
|
+
});
|
|
82
|
+
return response.data;
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
listProducts(request, options) {
|
|
86
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
87
|
+
const response = yield this.client.request({
|
|
88
|
+
url: `products`,
|
|
89
|
+
queryParams: request,
|
|
90
|
+
callOptions: options,
|
|
91
|
+
});
|
|
92
|
+
return response.data;
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
exports.ProductsService = ProductsService;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { GetBestBidAskResponse as GetBestResp } from '../../model/GetBestBidAskResponse';
|
|
2
|
+
import { GetProductBookResponse as GetPBResp } from '../../model/GetProductBookResponse';
|
|
3
|
+
import { GetProductResponse as GetProdResp } from '../../model/GetProductResponse';
|
|
4
|
+
import { Candles } from '../../model/Candles';
|
|
5
|
+
import { ProductType } from '../../model/enums/ProductType';
|
|
6
|
+
import { ContractExpiryType } from '../../model/enums/ContractExpiryType';
|
|
7
|
+
import { ExpiringContractStatus } from '../../model/enums/ExpiringContractStatus';
|
|
8
|
+
import { Product } from '../../model/Product';
|
|
9
|
+
import { GetMarketTradesResponse } from '../../model/GetMarketTradesResponse';
|
|
10
|
+
export type GetBestBidAskRequest = {
|
|
11
|
+
productIds?: string[];
|
|
12
|
+
};
|
|
13
|
+
export type GetBestBidAskResponse = GetBestResp;
|
|
14
|
+
export type GetProductBookRequest = {
|
|
15
|
+
productId: string;
|
|
16
|
+
limit?: number;
|
|
17
|
+
aggregationPriceIncrement?: string;
|
|
18
|
+
};
|
|
19
|
+
export type GetProductBookResponse = GetPBResp;
|
|
20
|
+
export type GetProductRequest = {
|
|
21
|
+
productId: string;
|
|
22
|
+
getTradabilityStatus?: boolean;
|
|
23
|
+
};
|
|
24
|
+
export type GetProductResponse = GetProdResp;
|
|
25
|
+
export type GetProductCandlesRequest = {
|
|
26
|
+
productId: string;
|
|
27
|
+
start: string;
|
|
28
|
+
end: string;
|
|
29
|
+
granularity: string;
|
|
30
|
+
limit?: number;
|
|
31
|
+
};
|
|
32
|
+
export type GetProductCandlesResponse = Candles;
|
|
33
|
+
export type ListProductsRequest = {
|
|
34
|
+
limit?: number;
|
|
35
|
+
offset?: number;
|
|
36
|
+
productType?: ProductType;
|
|
37
|
+
productIds?: string[];
|
|
38
|
+
contractExpiryType?: ContractExpiryType;
|
|
39
|
+
expiringContractStatus?: ExpiringContractStatus;
|
|
40
|
+
getTradabilityStatus?: boolean;
|
|
41
|
+
getAllProducts?: boolean;
|
|
42
|
+
};
|
|
43
|
+
export type ListProductsResponse = {
|
|
44
|
+
products: Product[];
|
|
45
|
+
};
|
|
46
|
+
export type GetProductMarketTradesRequest = {
|
|
47
|
+
productId: string;
|
|
48
|
+
limit: number;
|
|
49
|
+
start?: string;
|
|
50
|
+
end?: string;
|
|
51
|
+
};
|
|
52
|
+
export type GetProductMarketTradesResponse = GetMarketTradesResponse;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CoinbaseCallOptions } from '@coinbase-sample/core-ts';
|
|
2
|
+
import { GetServerTimeRequest, GetServerTimeResponse, ListPublicProductsRequest, ListPublicProductsResponse, GetPublicProductRequest, GetPublicProductResponse, GetPublicProductBookRequest, GetPublicProductBookResponse, GetPublicProductCandlesRequest, GetPublicProductCandlesResponse, GetPublicProductMarketTradesRequest, GetPublicProductMarketTradesResponse } from './types';
|
|
3
|
+
import { CoinbaseAdvTradeClient } from '../client';
|
|
4
|
+
import { CoinbaseAdvTradeClientException, CoinbaseAdvTradeException } from '../errors';
|
|
5
|
+
export interface IPublicService {
|
|
6
|
+
getServerTime(request: GetServerTimeRequest, options?: CoinbaseCallOptions): Promise<GetServerTimeResponse | CoinbaseAdvTradeClientException | CoinbaseAdvTradeException>;
|
|
7
|
+
listProducts(request: ListPublicProductsRequest, options?: CoinbaseCallOptions): Promise<ListPublicProductsResponse | CoinbaseAdvTradeClientException | CoinbaseAdvTradeException>;
|
|
8
|
+
getProduct(request: GetPublicProductRequest, options?: CoinbaseCallOptions): Promise<GetPublicProductResponse | CoinbaseAdvTradeClientException | CoinbaseAdvTradeException>;
|
|
9
|
+
getProductBook(request: GetPublicProductBookRequest, options?: CoinbaseCallOptions): Promise<GetPublicProductBookResponse | CoinbaseAdvTradeClientException | CoinbaseAdvTradeException>;
|
|
10
|
+
getProductCandles(request: GetPublicProductCandlesRequest, options?: CoinbaseCallOptions): Promise<GetPublicProductCandlesResponse | CoinbaseAdvTradeClientException | CoinbaseAdvTradeException>;
|
|
11
|
+
getProductMarketTrades(request: GetPublicProductMarketTradesRequest, options?: CoinbaseCallOptions): Promise<GetPublicProductMarketTradesResponse | CoinbaseAdvTradeClientException | CoinbaseAdvTradeException>;
|
|
12
|
+
}
|
|
13
|
+
export declare class PublicService implements IPublicService {
|
|
14
|
+
private client;
|
|
15
|
+
constructor(client: CoinbaseAdvTradeClient);
|
|
16
|
+
getServerTime(request: GetServerTimeRequest, options?: CoinbaseCallOptions): Promise<GetServerTimeResponse | CoinbaseAdvTradeClientException | CoinbaseAdvTradeException>;
|
|
17
|
+
listProducts(request: ListPublicProductsRequest, options?: CoinbaseCallOptions): Promise<ListPublicProductsResponse | CoinbaseAdvTradeClientException | CoinbaseAdvTradeException>;
|
|
18
|
+
getProduct(request: GetPublicProductRequest, options?: CoinbaseCallOptions): Promise<GetPublicProductResponse | CoinbaseAdvTradeClientException | CoinbaseAdvTradeException>;
|
|
19
|
+
getProductBook(request: GetPublicProductBookRequest, options?: CoinbaseCallOptions): Promise<GetPublicProductBookResponse | CoinbaseAdvTradeClientException | CoinbaseAdvTradeException>;
|
|
20
|
+
getProductCandles(request: GetPublicProductCandlesRequest, options?: CoinbaseCallOptions): Promise<GetPublicProductCandlesResponse | CoinbaseAdvTradeClientException | CoinbaseAdvTradeException>;
|
|
21
|
+
getProductMarketTrades(request: GetPublicProductMarketTradesRequest, options?: CoinbaseCallOptions): Promise<GetPublicProductMarketTradesResponse | CoinbaseAdvTradeClientException | CoinbaseAdvTradeException>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PublicService = void 0;
|
|
13
|
+
class PublicService {
|
|
14
|
+
constructor(client) {
|
|
15
|
+
this.client = client;
|
|
16
|
+
}
|
|
17
|
+
getServerTime(request, options) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const response = yield this.client.request({
|
|
20
|
+
url: `time`,
|
|
21
|
+
callOptions: options,
|
|
22
|
+
});
|
|
23
|
+
return response.data;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
listProducts(request, options) {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
const response = yield this.client.request({
|
|
29
|
+
url: `market/products`,
|
|
30
|
+
queryParams: request,
|
|
31
|
+
callOptions: options,
|
|
32
|
+
});
|
|
33
|
+
return response.data;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
getProduct(request, options) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
const response = yield this.client.request({
|
|
39
|
+
url: `market/products/${request.productId}`,
|
|
40
|
+
callOptions: options,
|
|
41
|
+
});
|
|
42
|
+
return response.data;
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
getProductBook(request, options) {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
const response = yield this.client.request({
|
|
48
|
+
url: `market/product_book`,
|
|
49
|
+
queryParams: request,
|
|
50
|
+
callOptions: options,
|
|
51
|
+
});
|
|
52
|
+
return response.data;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
getProductCandles(request, options) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
const response = yield this.client.request({
|
|
58
|
+
url: `market/products/${request.productId}/candles`,
|
|
59
|
+
queryParams: request,
|
|
60
|
+
callOptions: options,
|
|
61
|
+
});
|
|
62
|
+
return response.data;
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
getProductMarketTrades(request, options) {
|
|
66
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
const response = yield this.client.request({
|
|
68
|
+
url: `market/products/${request.productId}/ticker`,
|
|
69
|
+
queryParams: request,
|
|
70
|
+
callOptions: options,
|
|
71
|
+
});
|
|
72
|
+
return response.data;
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.PublicService = PublicService;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ContractExpiryType } from '../../model/enums/ContractExpiryType';
|
|
2
|
+
import { ExpiringContractStatus } from '../../model/enums/ExpiringContractStatus';
|
|
3
|
+
import { ProductType } from '../../model/enums/ProductType';
|
|
4
|
+
import { ExtendedTimestamp } from '../../model/ExtendedTimestamp';
|
|
5
|
+
import { Products } from '../../model/Products';
|
|
6
|
+
import { Product } from '../../model/Product';
|
|
7
|
+
import { Candles } from '../../model/Candles';
|
|
8
|
+
import { GetProductBookResponse as GetPBResp } from '../../model/GetProductBookResponse';
|
|
9
|
+
import { GetMarketTradesResponse } from '../../model/GetMarketTradesResponse';
|
|
10
|
+
export type GetServerTimeRequest = Record<string, never>;
|
|
11
|
+
export type GetServerTimeResponse = ExtendedTimestamp;
|
|
12
|
+
export type ListPublicProductsRequest = {
|
|
13
|
+
limit?: number;
|
|
14
|
+
offset?: number;
|
|
15
|
+
productType?: ProductType;
|
|
16
|
+
productIds?: string[];
|
|
17
|
+
contractExpiryType?: ContractExpiryType;
|
|
18
|
+
expiringContractStatus?: ExpiringContractStatus;
|
|
19
|
+
getAllProducts?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type ListPublicProductsResponse = Products;
|
|
22
|
+
export type GetPublicProductRequest = {
|
|
23
|
+
productId: string;
|
|
24
|
+
};
|
|
25
|
+
export type GetPublicProductResponse = Product;
|
|
26
|
+
export type GetPublicProductCandlesRequest = {
|
|
27
|
+
productId: string;
|
|
28
|
+
start: string;
|
|
29
|
+
end: string;
|
|
30
|
+
granularity: string;
|
|
31
|
+
limit?: number;
|
|
32
|
+
};
|
|
33
|
+
export type GetPublicProductCandlesResponse = Candles;
|
|
34
|
+
export type GetPublicProductBookRequest = {
|
|
35
|
+
productId: string;
|
|
36
|
+
limit?: number;
|
|
37
|
+
aggregationPriceIncrement?: string;
|
|
38
|
+
};
|
|
39
|
+
export type GetPublicProductBookResponse = GetPBResp;
|
|
40
|
+
export type GetPublicProductMarketTradesRequest = {
|
|
41
|
+
productId: string;
|
|
42
|
+
limit: number;
|
|
43
|
+
start?: string;
|
|
44
|
+
end?: string;
|
|
45
|
+
};
|
|
46
|
+
export type GetPublicProductMarketTradesResponse = GetMarketTradesResponse;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function toCamelCase<T>(obj: T, seen?: WeakSet<object>): T;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toCamelCase = toCamelCase;
|
|
4
|
+
function toCamelCase(obj, seen = new WeakSet()) {
|
|
5
|
+
if (obj === null || typeof obj !== 'object')
|
|
6
|
+
return obj; // Handle non-object values
|
|
7
|
+
// Prevent circular references
|
|
8
|
+
if (seen.has(obj)) {
|
|
9
|
+
throw new Error('Circular reference detected');
|
|
10
|
+
}
|
|
11
|
+
seen.add(obj);
|
|
12
|
+
if (Array.isArray(obj)) {
|
|
13
|
+
// Recursively handle arrays
|
|
14
|
+
return obj.map((item) => toCamelCase(item, seen));
|
|
15
|
+
}
|
|
16
|
+
return Object.entries(obj).reduce((acc, [key, value]) => {
|
|
17
|
+
// Convert snake_case key to camelCase
|
|
18
|
+
const camelCaseKey = key.replace(/_([a-z0-9])/g, (_, letter) => letter.toUpperCase());
|
|
19
|
+
// Recursively process values if they are objects or arrays
|
|
20
|
+
acc[camelCaseKey] = toCamelCase(value, seen);
|
|
21
|
+
return acc;
|
|
22
|
+
}, {});
|
|
23
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@coinbase-sample/advanced-trade-sdk-ts",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
6
|
+
"build": "rm -rf dist && tsc",
|
|
7
|
+
"lint": "eslint . --ext .js,.ts",
|
|
8
|
+
"format": "prettier --write \"**/*.{js,ts,tsx,json,css,md}\"",
|
|
9
|
+
"gen-types": "openapi-generator-cli generate -i apiSpec/retail-public-api-spec.json -g typescript-node --global-property models -o apiSpec/types --additional-properties=supportsES6=true --additional-properties=snapshot=true && cd apiSpec && node generateTypes.js",
|
|
10
|
+
"replace-model": "rm -r src/model && cp -r apiSpec/types/processed src/model"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist/"
|
|
14
|
+
],
|
|
15
|
+
"keywords": [],
|
|
16
|
+
"author": "",
|
|
17
|
+
"license": "ISC",
|
|
18
|
+
"description": "",
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@coinbase-sample/core-ts": "^0.1.0",
|
|
21
|
+
"@types/node-fetch": "^2.6.11",
|
|
22
|
+
"@typescript-eslint/eslint-plugin": "^5.59.0",
|
|
23
|
+
"@typescript-eslint/parser": "^5.59.0",
|
|
24
|
+
"dotenv": "^16.4.5",
|
|
25
|
+
"eslint": "^8.35.0",
|
|
26
|
+
"eslint-config-prettier": "^8.5.0",
|
|
27
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
28
|
+
"prettier": "^2.8.8",
|
|
29
|
+
"typescript": "^5.5.4"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@types/jsonwebtoken": "^9.0.6",
|
|
33
|
+
"jsonwebtoken": "^9.0.2",
|
|
34
|
+
"node-fetch": "^2.6.1"
|
|
35
|
+
}
|
|
36
|
+
}
|