@coinbase-sample/prime-sdk-ts 0.1.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/LICENSE +0 -0
- package/README.md +98 -0
- package/dist/activities/index.d.ts +33 -0
- package/dist/activities/index.js +73 -0
- package/dist/activities/service.d.ts +18 -0
- package/dist/activities/service.js +54 -0
- package/dist/activities/types.d.ts +47 -0
- package/dist/activities/types.js +2 -0
- package/dist/addressBooks/index.d.ts +29 -0
- package/dist/addressBooks/index.js +57 -0
- package/dist/addressBooks/service.d.ts +11 -0
- package/dist/addressBooks/service.js +38 -0
- package/dist/addressBooks/types.d.ts +29 -0
- package/dist/addressBooks/types.js +2 -0
- package/dist/allocations/index.d.ts +35 -0
- package/dist/allocations/index.js +83 -0
- package/dist/allocations/service.d.ts +14 -0
- package/dist/allocations/service.js +65 -0
- package/dist/allocations/types.d.ts +46 -0
- package/dist/allocations/types.js +2 -0
- package/dist/assets/index.d.ts +27 -0
- package/dist/assets/index.js +27 -0
- package/dist/assets/service.d.ts +10 -0
- package/dist/assets/service.js +27 -0
- package/dist/assets/types.d.ts +20 -0
- package/dist/assets/types.js +2 -0
- package/dist/balances/index.d.ts +31 -0
- package/dist/balances/index.js +49 -0
- package/dist/balances/types.d.ts +39 -0
- package/dist/balances/types.js +2 -0
- package/dist/client.d.ts +20 -0
- package/dist/client.js +31 -0
- package/dist/commission/index.d.ts +27 -0
- package/dist/commission/index.js +27 -0
- package/dist/commission/types.d.ts +20 -0
- package/dist/commission/types.js +2 -0
- package/dist/constants.d.ts +22 -0
- package/dist/constants.js +25 -0
- package/dist/credentials/index.d.ts +7 -0
- package/dist/credentials/index.js +81 -0
- package/dist/errors/index.d.ts +22 -0
- package/dist/errors/index.js +31 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +50 -0
- package/dist/invoices/index.d.ts +27 -0
- package/dist/invoices/index.js +27 -0
- package/dist/invoices/service.d.ts +10 -0
- package/dist/invoices/service.js +27 -0
- package/dist/invoices/types.d.ts +20 -0
- package/dist/invoices/types.js +2 -0
- package/dist/model/Activity.d.ts +73 -0
- package/dist/model/Activity.js +21 -0
- package/dist/model/ActivityMetadataAccount.d.ts +23 -0
- package/dist/model/ActivityMetadataAccount.js +21 -0
- package/dist/model/ActivityMetadataConsensus.d.ts +29 -0
- package/dist/model/ActivityMetadataConsensus.js +21 -0
- package/dist/model/ActivityMetadataTransactions.d.ts +23 -0
- package/dist/model/ActivityMetadataTransactions.js +21 -0
- package/dist/model/AddressBookEntry.d.ts +69 -0
- package/dist/model/AddressBookEntry.js +21 -0
- package/dist/model/AggregatedFiatBalance.d.ts +23 -0
- package/dist/model/AggregatedFiatBalance.js +21 -0
- package/dist/model/Allocation.d.ts +78 -0
- package/dist/model/Allocation.js +21 -0
- package/dist/model/AllocationLeg.d.ts +33 -0
- package/dist/model/AllocationLeg.js +21 -0
- package/dist/model/AmountDue.d.ts +33 -0
- package/dist/model/AmountDue.js +21 -0
- package/dist/model/Asset.d.ts +41 -0
- package/dist/model/Asset.js +21 -0
- package/dist/model/AssetChange.d.ts +35 -0
- package/dist/model/AssetChange.js +21 -0
- package/dist/model/Balance.d.ts +69 -0
- package/dist/model/Balance.js +21 -0
- package/dist/model/BlockchainAddress.d.ts +23 -0
- package/dist/model/BlockchainAddress.js +21 -0
- package/dist/model/CancelOrderResponse.d.ts +25 -0
- package/dist/model/CancelOrderResponse.js +21 -0
- package/dist/model/Commission.d.ts +33 -0
- package/dist/model/Commission.js +21 -0
- package/dist/model/CreateAllocationRequest.d.ts +52 -0
- package/dist/model/CreateAllocationRequest.js +21 -0
- package/dist/model/CreateAllocationResponse.d.ts +23 -0
- package/dist/model/CreateAllocationResponse.js +21 -0
- package/dist/model/CreateAllocationResponseBody.d.ts +33 -0
- package/dist/model/CreateAllocationResponseBody.js +21 -0
- package/dist/model/CreateConversionRequest.d.ts +41 -0
- package/dist/model/CreateConversionRequest.js +21 -0
- package/dist/model/CreateConversionResponse.d.ts +49 -0
- package/dist/model/CreateConversionResponse.js +21 -0
- package/dist/model/CreateNetAllocationResponse.d.ts +23 -0
- package/dist/model/CreateNetAllocationResponse.js +21 -0
- package/dist/model/CreateNetAllocationResponseBody.d.ts +41 -0
- package/dist/model/CreateNetAllocationResponseBody.js +21 -0
- package/dist/model/CreateOrderRequest.d.ts +40 -0
- package/dist/model/CreateOrderRequest.js +21 -0
- package/dist/model/CreateOrderResponse.d.ts +25 -0
- package/dist/model/CreateOrderResponse.js +21 -0
- package/dist/model/CreatePortfolioAddressBookEntryRequest.d.ts +37 -0
- package/dist/model/CreatePortfolioAddressBookEntryRequest.js +21 -0
- package/dist/model/CreatePortfolioAddressBookEntryResponse.d.ts +25 -0
- package/dist/model/CreatePortfolioAddressBookEntryResponse.js +21 -0
- package/dist/model/CreateWalletRequest.d.ts +26 -0
- package/dist/model/CreateWalletRequest.js +21 -0
- package/dist/model/CreateWalletResponse.d.ts +26 -0
- package/dist/model/CreateWalletResponse.js +21 -0
- package/dist/model/CreateWalletTransferResponse.d.ts +61 -0
- package/dist/model/CreateWalletTransferResponse.js +21 -0
- package/dist/model/CreateWalletWithdrawalRequest.d.ts +39 -0
- package/dist/model/CreateWalletWithdrawalRequest.js +21 -0
- package/dist/model/CreateWalletWithdrawalResponse.d.ts +56 -0
- package/dist/model/CreateWalletWithdrawalResponse.js +21 -0
- package/dist/model/DefiBalance.d.ts +24 -0
- package/dist/model/DefiBalance.js +21 -0
- package/dist/model/DestinationAlloc.d.ts +41 -0
- package/dist/model/DestinationAlloc.js +21 -0
- package/dist/model/DisplayUser.d.ts +33 -0
- package/dist/model/DisplayUser.js +21 -0
- package/dist/model/EntityUser.d.ts +39 -0
- package/dist/model/EntityUser.js +21 -0
- package/dist/model/EstimatedNetworkFees.d.ts +29 -0
- package/dist/model/EstimatedNetworkFees.js +21 -0
- package/dist/model/Fill.d.ts +59 -0
- package/dist/model/Fill.js +21 -0
- package/dist/model/GetActivityResponse.d.ts +23 -0
- package/dist/model/GetActivityResponse.js +21 -0
- package/dist/model/GetAllocationResponse.d.ts +23 -0
- package/dist/model/GetAllocationResponse.js +21 -0
- package/dist/model/GetAllocationsByClientNettingIdResponse.d.ts +23 -0
- package/dist/model/GetAllocationsByClientNettingIdResponse.js +21 -0
- package/dist/model/GetEntityActivitiesResponse.d.ts +25 -0
- package/dist/model/GetEntityActivitiesResponse.js +21 -0
- package/dist/model/GetEntityAssetsResponse.d.ts +23 -0
- package/dist/model/GetEntityAssetsResponse.js +21 -0
- package/dist/model/GetEntityPaymentMethodDetailsResponse.d.ts +23 -0
- package/dist/model/GetEntityPaymentMethodDetailsResponse.js +21 -0
- package/dist/model/GetEntityPaymentMethodsResponse.d.ts +23 -0
- package/dist/model/GetEntityPaymentMethodsResponse.js +21 -0
- package/dist/model/GetEntityUsersResponse.d.ts +28 -0
- package/dist/model/GetEntityUsersResponse.js +21 -0
- package/dist/model/GetInvoicesResponse.d.ts +23 -0
- package/dist/model/GetInvoicesResponse.js +21 -0
- package/dist/model/GetOpenOrdersResponse.d.ts +25 -0
- package/dist/model/GetOpenOrdersResponse.js +21 -0
- package/dist/model/GetOrderFillsResponse.d.ts +25 -0
- package/dist/model/GetOrderFillsResponse.js +21 -0
- package/dist/model/GetOrderResponse.d.ts +23 -0
- package/dist/model/GetOrderResponse.js +21 -0
- package/dist/model/GetOrdersResponse.d.ts +25 -0
- package/dist/model/GetOrdersResponse.js +21 -0
- package/dist/model/GetPortfolioActivitiesResponse.d.ts +25 -0
- package/dist/model/GetPortfolioActivitiesResponse.js +21 -0
- package/dist/model/GetPortfolioActivityResponse.d.ts +23 -0
- package/dist/model/GetPortfolioActivityResponse.js +21 -0
- package/dist/model/GetPortfolioAddressBookResponse.d.ts +28 -0
- package/dist/model/GetPortfolioAddressBookResponse.js +21 -0
- package/dist/model/GetPortfolioAllocationsResponse.d.ts +28 -0
- package/dist/model/GetPortfolioAllocationsResponse.js +21 -0
- package/dist/model/GetPortfolioBalancesResponse.d.ts +31 -0
- package/dist/model/GetPortfolioBalancesResponse.js +21 -0
- package/dist/model/GetPortfolioCommissionResponse.d.ts +23 -0
- package/dist/model/GetPortfolioCommissionResponse.js +21 -0
- package/dist/model/GetPortfolioFillsResponse.d.ts +25 -0
- package/dist/model/GetPortfolioFillsResponse.js +21 -0
- package/dist/model/GetPortfolioProductsResponse.d.ts +25 -0
- package/dist/model/GetPortfolioProductsResponse.js +21 -0
- package/dist/model/GetPortfolioResponse.d.ts +23 -0
- package/dist/model/GetPortfolioResponse.js +21 -0
- package/dist/model/GetPortfolioTransactionsResponse.d.ts +25 -0
- package/dist/model/GetPortfolioTransactionsResponse.js +21 -0
- package/dist/model/GetPortfolioUsersResponse.d.ts +28 -0
- package/dist/model/GetPortfolioUsersResponse.js +21 -0
- package/dist/model/GetPortfoliosResponse.d.ts +26 -0
- package/dist/model/GetPortfoliosResponse.js +21 -0
- package/dist/model/GetPostTradeCreditResponse.d.ts +23 -0
- package/dist/model/GetPostTradeCreditResponse.js +21 -0
- package/dist/model/GetTransactionResponse.d.ts +23 -0
- package/dist/model/GetTransactionResponse.js +21 -0
- package/dist/model/GetWalletBalanceResponse.d.ts +23 -0
- package/dist/model/GetWalletBalanceResponse.js +21 -0
- package/dist/model/GetWalletDepositInstructionsResponse.d.ts +25 -0
- package/dist/model/GetWalletDepositInstructionsResponse.js +21 -0
- package/dist/model/GetWalletResponse.d.ts +23 -0
- package/dist/model/GetWalletResponse.js +21 -0
- package/dist/model/GetWalletTransactionsResponse.d.ts +25 -0
- package/dist/model/GetWalletTransactionsResponse.js +21 -0
- package/dist/model/GetWalletsResponse.d.ts +25 -0
- package/dist/model/GetWalletsResponse.js +21 -0
- package/dist/model/Invoice.d.ts +32 -0
- package/dist/model/Invoice.js +21 -0
- package/dist/model/InvoiceItem.d.ts +30 -0
- package/dist/model/InvoiceItem.js +21 -0
- package/dist/model/ListWeb3WalletBalancesResponse.d.ts +30 -0
- package/dist/model/ListWeb3WalletBalancesResponse.js +21 -0
- package/dist/model/MatchMetadata.d.ts +29 -0
- package/dist/model/MatchMetadata.js +21 -0
- package/dist/model/NFTCollection.d.ts +25 -0
- package/dist/model/NFTCollection.js +21 -0
- package/dist/model/NFTItem.d.ts +25 -0
- package/dist/model/NFTItem.js +21 -0
- package/dist/model/Order.d.ts +105 -0
- package/dist/model/Order.js +21 -0
- package/dist/model/OrderPreviewRequest.d.ts +36 -0
- package/dist/model/OrderPreviewRequest.js +21 -0
- package/dist/model/PaginatedResponse.d.ts +31 -0
- package/dist/model/PaginatedResponse.js +21 -0
- package/dist/model/PaymentMethodDestination.d.ts +22 -0
- package/dist/model/PaymentMethodDestination.js +21 -0
- package/dist/model/PaymentMethodDetails.d.ts +28 -0
- package/dist/model/PaymentMethodDetails.js +21 -0
- package/dist/model/PaymentMethodSummary.d.ts +28 -0
- package/dist/model/PaymentMethodSummary.js +21 -0
- package/dist/model/PortfolioUser.d.ts +43 -0
- package/dist/model/PortfolioUser.js +21 -0
- package/dist/model/PostOrderPreviewResponse.d.ts +83 -0
- package/dist/model/PostOrderPreviewResponse.js +21 -0
- package/dist/model/PostTradeCreditInformation.d.ts +63 -0
- package/dist/model/PostTradeCreditInformation.js +21 -0
- package/dist/model/Product.d.ts +58 -0
- package/dist/model/Product.js +21 -0
- package/dist/model/Transaction.d.ts +97 -0
- package/dist/model/Transaction.js +21 -0
- package/dist/model/TransactionMetadata.d.ts +23 -0
- package/dist/model/TransactionMetadata.js +21 -0
- package/dist/model/TransferLocation.d.ts +27 -0
- package/dist/model/TransferLocation.js +21 -0
- package/dist/model/UserAction.d.ts +31 -0
- package/dist/model/UserAction.js +21 -0
- package/dist/model/Wallet.d.ts +28 -0
- package/dist/model/Wallet.js +21 -0
- package/dist/model/WalletCryptoDepositInstructions.d.ts +43 -0
- package/dist/model/WalletCryptoDepositInstructions.js +21 -0
- package/dist/model/WalletFiatDepositInstructions.d.ts +28 -0
- package/dist/model/WalletFiatDepositInstructions.js +21 -0
- package/dist/model/Web3Asset.d.ts +38 -0
- package/dist/model/Web3Asset.js +21 -0
- package/dist/model/Web3Balance.d.ts +29 -0
- package/dist/model/Web3Balance.js +21 -0
- package/dist/model/assets.d.ts +13 -0
- package/dist/model/assets.js +2 -0
- package/dist/model/createATransferBetweenTwoWallets.d.ts +37 -0
- package/dist/model/createATransferBetweenTwoWallets.js +21 -0
- package/dist/model/enums/Action.d.ts +26 -0
- package/dist/model/enums/Action.js +30 -0
- package/dist/model/enums/ActivityCategory.d.ts +28 -0
- package/dist/model/enums/ActivityCategory.js +32 -0
- package/dist/model/enums/ActivityLevel.d.ts +24 -0
- package/dist/model/enums/ActivityLevel.js +28 -0
- package/dist/model/enums/ActivitySecondaryType.d.ts +28 -0
- package/dist/model/enums/ActivitySecondaryType.js +32 -0
- package/dist/model/enums/ActivityStatus.d.ts +28 -0
- package/dist/model/enums/ActivityStatus.js +32 -0
- package/dist/model/enums/ActivityType.d.ts +63 -0
- package/dist/model/enums/ActivityType.js +67 -0
- package/dist/model/enums/AddressBookType.d.ts +24 -0
- package/dist/model/enums/AddressBookType.js +28 -0
- package/dist/model/enums/AllocationSizeType.d.ts +25 -0
- package/dist/model/enums/AllocationSizeType.js +29 -0
- package/dist/model/enums/AllocationStatus.d.ts +26 -0
- package/dist/model/enums/AllocationStatus.js +30 -0
- package/dist/model/enums/AssetChangeType.d.ts +27 -0
- package/dist/model/enums/AssetChangeType.js +31 -0
- package/dist/model/enums/DestinationType.d.ts +25 -0
- package/dist/model/enums/DestinationType.js +29 -0
- package/dist/model/enums/HierarchyType.d.ts +24 -0
- package/dist/model/enums/HierarchyType.js +28 -0
- package/dist/model/enums/InvoiceState.d.ts +26 -0
- package/dist/model/enums/InvoiceState.js +30 -0
- package/dist/model/enums/InvoiceType.d.ts +27 -0
- package/dist/model/enums/InvoiceType.js +31 -0
- package/dist/model/enums/OrderSide.d.ts +27 -0
- package/dist/model/enums/OrderSide.js +31 -0
- package/dist/model/enums/OrderStatus.d.ts +31 -0
- package/dist/model/enums/OrderStatus.js +35 -0
- package/dist/model/enums/OrderType.d.ts +31 -0
- package/dist/model/enums/OrderType.js +35 -0
- package/dist/model/enums/PaymentMethodType.d.ts +28 -0
- package/dist/model/enums/PaymentMethodType.js +32 -0
- package/dist/model/enums/PortfolioBalanceType.d.ts +25 -0
- package/dist/model/enums/PortfolioBalanceType.js +29 -0
- package/dist/model/enums/ProductPermissions.d.ts +25 -0
- package/dist/model/enums/ProductPermissions.js +29 -0
- package/dist/model/enums/SortDirection.d.ts +23 -0
- package/dist/model/enums/SortDirection.js +27 -0
- package/dist/model/enums/TimeInForceType.d.ts +29 -0
- package/dist/model/enums/TimeInForceType.js +33 -0
- package/dist/model/enums/TransactionStatus.d.ts +46 -0
- package/dist/model/enums/TransactionStatus.js +50 -0
- package/dist/model/enums/TransactionType.d.ts +57 -0
- package/dist/model/enums/TransactionType.js +61 -0
- package/dist/model/enums/TransferLocationType.d.ts +28 -0
- package/dist/model/enums/TransferLocationType.js +32 -0
- package/dist/model/enums/UserRole.d.ts +34 -0
- package/dist/model/enums/UserRole.js +38 -0
- package/dist/model/enums/VisibilityStatus.d.ts +25 -0
- package/dist/model/enums/VisibilityStatus.js +29 -0
- package/dist/model/enums/WalletDepositInstructionType.d.ts +29 -0
- package/dist/model/enums/WalletDepositInstructionType.js +33 -0
- package/dist/model/enums/WalletType.d.ts +30 -0
- package/dist/model/enums/WalletType.js +34 -0
- package/dist/model/portfolio.d.ts +41 -0
- package/dist/model/portfolio.js +21 -0
- package/dist/model/services/activitityService.d.ts +33 -0
- package/dist/model/services/activitityService.js +2 -0
- package/dist/model/services/addressBookService.d.ts +14 -0
- package/dist/model/services/addressBookService.js +2 -0
- package/dist/model/services/allocationService.d.ts +24 -0
- package/dist/model/services/allocationService.js +2 -0
- package/dist/model/services/assetService.d.ts +5 -0
- package/dist/model/services/assetService.js +2 -0
- package/dist/model/services/balanceService.d.ts +24 -0
- package/dist/model/services/balanceService.js +2 -0
- package/dist/model/services/commissionService.d.ts +5 -0
- package/dist/model/services/commissionService.js +2 -0
- package/dist/model/services/invoiceService.d.ts +5 -0
- package/dist/model/services/invoiceService.js +2 -0
- package/dist/model/services/orderService.d.ts +62 -0
- package/dist/model/services/orderService.js +2 -0
- package/dist/model/services/pagination.d.ts +9 -0
- package/dist/model/services/pagination.js +2 -0
- package/dist/model/services/paymentMethodsService.d.ts +10 -0
- package/dist/model/services/paymentMethodsService.js +2 -0
- package/dist/model/services/portfolioService.d.ts +15 -0
- package/dist/model/services/portfolioService.js +2 -0
- package/dist/model/services/productService.d.ts +6 -0
- package/dist/model/services/productService.js +2 -0
- package/dist/model/services/shared.d.ts +6 -0
- package/dist/model/services/shared.js +2 -0
- package/dist/model/services/transactionService.d.ts +47 -0
- package/dist/model/services/transactionService.js +2 -0
- package/dist/model/services/usersService.d.ts +9 -0
- package/dist/model/services/usersService.js +2 -0
- package/dist/model/services/walletService.d.ts +27 -0
- package/dist/model/services/walletService.js +2 -0
- package/dist/orders/index.d.ts +41 -0
- package/dist/orders/index.js +119 -0
- package/dist/orders/types.d.ts +77 -0
- package/dist/orders/types.js +2 -0
- package/dist/paymentMethods/index.d.ts +29 -0
- package/dist/paymentMethods/index.js +36 -0
- package/dist/paymentMethods/service.d.ts +11 -0
- package/dist/paymentMethods/service.js +36 -0
- package/dist/paymentMethods/types.d.ts +25 -0
- package/dist/paymentMethods/types.js +2 -0
- package/dist/portfolio/service.d.ts +12 -0
- package/dist/portfolio/service.js +42 -0
- package/dist/portfolios/index.d.ts +31 -0
- package/dist/portfolios/index.js +45 -0
- package/dist/portfolios/types.d.ts +30 -0
- package/dist/portfolios/types.js +2 -0
- package/dist/products/index.d.ts +27 -0
- package/dist/products/index.js +27 -0
- package/dist/products/types.d.ts +21 -0
- package/dist/products/types.js +2 -0
- package/dist/shared/pagination.d.ts +24 -0
- package/dist/shared/pagination.js +2 -0
- package/dist/shared/toCamelCase.d.ts +1 -0
- package/dist/shared/toCamelCase.js +23 -0
- package/dist/transactions/index.d.ts +37 -0
- package/dist/transactions/index.js +101 -0
- package/dist/transactions/types.d.ts +62 -0
- package/dist/transactions/types.js +2 -0
- package/dist/users/index.d.ts +29 -0
- package/dist/users/index.js +36 -0
- package/dist/users/service.d.ts +11 -0
- package/dist/users/service.js +36 -0
- package/dist/users/types.d.ts +24 -0
- package/dist/users/types.js +2 -0
- package/dist/wallets/index.d.ts +33 -0
- package/dist/wallets/index.js +73 -0
- package/dist/wallets/types.d.ts +42 -0
- package/dist/wallets/types.js +2 -0
- package/package.json +38 -0
|
@@ -0,0 +1,36 @@
|
|
|
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.PaymentMethodsService = void 0;
|
|
13
|
+
class PaymentMethodsService {
|
|
14
|
+
constructor(client) {
|
|
15
|
+
this.client = client;
|
|
16
|
+
}
|
|
17
|
+
listEntityPaymentMethods(request, options) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const response = yield this.client.request({
|
|
20
|
+
url: `entities/${request.entityId}/payment-methods`,
|
|
21
|
+
callOptions: options,
|
|
22
|
+
});
|
|
23
|
+
return response.data;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
getPaymentMethod(request, options) {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
const response = yield this.client.request({
|
|
29
|
+
url: `entities/${request.entityId}/payment-methods`,
|
|
30
|
+
callOptions: options,
|
|
31
|
+
});
|
|
32
|
+
return response.data;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.PaymentMethodsService = PaymentMethodsService;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CoinbasePrimeClient } from '../client';
|
|
2
|
+
import { CoinbasePrimeClientException, CoinbasePrimeException } from '../errors';
|
|
3
|
+
import { ListEntityPaymentMethodsRequest, ListEntityPaymentMethodsResponse, GetPaymentMethodRequest, GetPaymentMethodResponse } from '../model/services/paymentMethodsService';
|
|
4
|
+
export interface PaymentMethodService {
|
|
5
|
+
listEntityPaymentMethods(request: ListEntityPaymentMethodsRequest): Promise<ListEntityPaymentMethodsResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
6
|
+
getPaymentMethod(request: GetPaymentMethodRequest): Promise<GetPaymentMethodResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
7
|
+
}
|
|
8
|
+
export declare class PaymentMethodService implements PaymentMethodService {
|
|
9
|
+
private client;
|
|
10
|
+
constructor(client: CoinbasePrimeClient);
|
|
11
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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.PaymentMethodService = void 0;
|
|
13
|
+
class PaymentMethodService {
|
|
14
|
+
constructor(client) {
|
|
15
|
+
this.client = client;
|
|
16
|
+
}
|
|
17
|
+
listEntityPaymentMethods(request, options) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const response = yield this.client.request({
|
|
20
|
+
url: `entities/${request.entityId}/payment-methods`,
|
|
21
|
+
callOptions: options,
|
|
22
|
+
});
|
|
23
|
+
return response.data;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
getPaymentMethod(request, options) {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
const response = yield this.client.request({
|
|
29
|
+
url: `entities/${request.entityId}/payment-methods`,
|
|
30
|
+
callOptions: options,
|
|
31
|
+
});
|
|
32
|
+
return response.data;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.PaymentMethodService = PaymentMethodService;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2024-present Coinbase Global, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { GetEntityPaymentMethodsResponse } from '../model/GetEntityPaymentMethodsResponse';
|
|
17
|
+
import { GetEntityPaymentMethodDetailsResponse } from '../model/GetEntityPaymentMethodDetailsResponse';
|
|
18
|
+
export type ListEntityPaymentMethodsRequest = {
|
|
19
|
+
entityId: string;
|
|
20
|
+
};
|
|
21
|
+
export type ListEntityPaymentMethodsResponse = GetEntityPaymentMethodsResponse;
|
|
22
|
+
export type GetPaymentMethodRequest = {
|
|
23
|
+
entityId: string;
|
|
24
|
+
};
|
|
25
|
+
export type GetPaymentMethodResponse = GetEntityPaymentMethodDetailsResponse;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CoinbasePrimeClient } from '../client';
|
|
2
|
+
import { CoinbasePrimeClientException, CoinbasePrimeException } from '../errors';
|
|
3
|
+
import { GetPortfolioRequest, GetPortfolioResponse, GetPortfolioCreditRequest, GetPortfolioCreditResponse, ListPortfoliosResponse } from '../model/services/portfolioService';
|
|
4
|
+
export interface PortfolioService {
|
|
5
|
+
getPortfolio(request: GetPortfolioRequest): Promise<GetPortfolioResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
6
|
+
getPortfolioCredit(request: GetPortfolioCreditRequest): Promise<GetPortfolioCreditResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
7
|
+
listPortfolios(): Promise<ListPortfoliosResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
8
|
+
}
|
|
9
|
+
export declare class PortfolioService implements PortfolioService {
|
|
10
|
+
private client;
|
|
11
|
+
constructor(client: CoinbasePrimeClient);
|
|
12
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
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.PortfolioService = void 0;
|
|
13
|
+
class PortfolioService {
|
|
14
|
+
constructor(client) {
|
|
15
|
+
this.client = client;
|
|
16
|
+
}
|
|
17
|
+
getPortfolio(request) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const response = yield this.client.request({
|
|
20
|
+
url: `portfolios/${request.portfolioId}`,
|
|
21
|
+
});
|
|
22
|
+
return response.data;
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
getPortfolioCredit(request) {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
const response = yield this.client.request({
|
|
28
|
+
url: `portfolios/${request.portfolioId}/credit`,
|
|
29
|
+
});
|
|
30
|
+
return response.data;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
listPortfolios() {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
const response = yield this.client.request({
|
|
36
|
+
url: `portfolios`,
|
|
37
|
+
});
|
|
38
|
+
return response.data;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.PortfolioService = PortfolioService;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2024-present Coinbase Global, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { CoinbaseCallOptions } from '@coinbase-sample/core-ts';
|
|
17
|
+
import { CoinbasePrimeClient } from '../client';
|
|
18
|
+
import { CoinbasePrimeClientException, CoinbasePrimeException } from '../errors';
|
|
19
|
+
import { GetPortfolioRequest, GetPortfolioResponse, GetPortfolioCreditRequest, GetPortfolioCreditResponse, ListPortfoliosResponse } from './types';
|
|
20
|
+
export interface IPortfoliosService {
|
|
21
|
+
getPortfolio(request: GetPortfolioRequest, options?: CoinbaseCallOptions): Promise<GetPortfolioResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
22
|
+
getPortfolioCredit(request: GetPortfolioCreditRequest, options?: CoinbaseCallOptions): Promise<GetPortfolioCreditResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
23
|
+
listPortfolios(options?: CoinbaseCallOptions): Promise<ListPortfoliosResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
24
|
+
}
|
|
25
|
+
export declare class PortfoliosService implements IPortfoliosService {
|
|
26
|
+
private client;
|
|
27
|
+
constructor(client: CoinbasePrimeClient);
|
|
28
|
+
getPortfolio(request: GetPortfolioRequest, options?: CoinbaseCallOptions): Promise<GetPortfolioResponse>;
|
|
29
|
+
getPortfolioCredit(request: GetPortfolioCreditRequest, options?: CoinbaseCallOptions): Promise<GetPortfolioCreditResponse>;
|
|
30
|
+
listPortfolios(options?: CoinbaseCallOptions): Promise<ListPortfoliosResponse>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
class PortfoliosService {
|
|
14
|
+
constructor(client) {
|
|
15
|
+
this.client = client;
|
|
16
|
+
}
|
|
17
|
+
getPortfolio(request, options) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const response = yield this.client.request({
|
|
20
|
+
url: `portfolios/${request.portfolioId}`,
|
|
21
|
+
callOptions: options,
|
|
22
|
+
});
|
|
23
|
+
return response.data;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
getPortfolioCredit(request, options) {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
const response = yield this.client.request({
|
|
29
|
+
url: `portfolios/${request.portfolioId}/credit`,
|
|
30
|
+
callOptions: options,
|
|
31
|
+
});
|
|
32
|
+
return response.data;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
listPortfolios(options) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
const response = yield this.client.request({
|
|
38
|
+
url: `portfolios`,
|
|
39
|
+
callOptions: options,
|
|
40
|
+
});
|
|
41
|
+
return response.data;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.PortfoliosService = PortfoliosService;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2024-present Coinbase Global, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { GetPortfolioResponse as internalGet } from '../model/GetPortfolioResponse';
|
|
17
|
+
import { GetPortfoliosResponse } from '../model/GetPortfoliosResponse';
|
|
18
|
+
import { GetPostTradeCreditResponse } from '../model/GetPostTradeCreditResponse';
|
|
19
|
+
export type GetPortfolioRequest = {
|
|
20
|
+
/**
|
|
21
|
+
* The portfolio ID.
|
|
22
|
+
*/
|
|
23
|
+
portfolioId: string;
|
|
24
|
+
};
|
|
25
|
+
export type GetPortfolioResponse = internalGet;
|
|
26
|
+
export type ListPortfoliosResponse = GetPortfoliosResponse;
|
|
27
|
+
export type GetPortfolioCreditRequest = {
|
|
28
|
+
portfolioId: string;
|
|
29
|
+
};
|
|
30
|
+
export type GetPortfolioCreditResponse = GetPostTradeCreditResponse;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2024-present Coinbase Global, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { CoinbaseCallOptions } from '@coinbase-sample/core-ts';
|
|
17
|
+
import { CoinbasePrimeClient } from '../client';
|
|
18
|
+
import { CoinbasePrimeClientException, CoinbasePrimeException } from '../errors';
|
|
19
|
+
import { ListProductsRequest, ListProductsResponse } from './types';
|
|
20
|
+
export interface IProductsService {
|
|
21
|
+
listProducts(request: ListProductsRequest, options?: CoinbaseCallOptions): Promise<ListProductsResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
22
|
+
}
|
|
23
|
+
export declare class ProductsService implements IProductsService {
|
|
24
|
+
private client;
|
|
25
|
+
constructor(client: CoinbasePrimeClient);
|
|
26
|
+
listProducts(request: ListProductsRequest, options?: CoinbaseCallOptions): Promise<ListProductsResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
listProducts(request, options) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const response = yield this.client.request({
|
|
20
|
+
url: `portfolios/${request.portfolioId}/products`,
|
|
21
|
+
callOptions: options,
|
|
22
|
+
});
|
|
23
|
+
return response.data;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.ProductsService = ProductsService;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2024-present Coinbase Global, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { GetPortfolioProductsResponse } from '../model/GetPortfolioProductsResponse';
|
|
17
|
+
import { Pagination } from '../shared/pagination';
|
|
18
|
+
export type ListProductsRequest = Pagination & {
|
|
19
|
+
portfolioId: string;
|
|
20
|
+
};
|
|
21
|
+
export type ListProductsResponse = GetPortfolioProductsResponse;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2024-present Coinbase Global, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { SortDirection } from '../model/enums/SortDirection';
|
|
17
|
+
export type Pagination = {
|
|
18
|
+
/**
|
|
19
|
+
* Cursor to navigate to next page
|
|
20
|
+
*/
|
|
21
|
+
cursor?: string;
|
|
22
|
+
sortDirection?: SortDirection;
|
|
23
|
+
limit?: number;
|
|
24
|
+
};
|
|
@@ -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-z])/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
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2024-present Coinbase Global, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { CoinbaseCallOptions } from '@coinbase-sample/core-ts';
|
|
17
|
+
import { CoinbasePrimeClient } from '../client';
|
|
18
|
+
import { CoinbasePrimeClientException, CoinbasePrimeException } from '../errors';
|
|
19
|
+
import { CreateConversionRequest, CreateConversionResponse, CreateTransferRequest, CreateTransferResponse, CreateWithdrawalRequest, CreateWithdrawalResponse, GetTransactionRequest, GetTransactionResponse, ListPortfolioTransactionsRequest, ListPortfolioTransactionsResponse, ListWalletTransactionsRequest, ListWalletTransactionsResponse } from './types';
|
|
20
|
+
export interface ITransactionsService {
|
|
21
|
+
getTransaction(request: GetTransactionRequest, options?: CoinbaseCallOptions): Promise<GetTransactionResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
22
|
+
listPortfolioTransactions(request: ListPortfolioTransactionsRequest, options?: CoinbaseCallOptions): Promise<ListPortfolioTransactionsResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
23
|
+
listWalletTransactions(request: ListWalletTransactionsRequest, options?: CoinbaseCallOptions): Promise<ListWalletTransactionsResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
24
|
+
createConversion(request: CreateConversionRequest, options?: CoinbaseCallOptions): Promise<CreateConversionResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
25
|
+
createTransfer(request: CreateTransferRequest, options?: CoinbaseCallOptions): Promise<CreateTransferResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
26
|
+
createWithdrawal(request: CreateWithdrawalRequest, options?: CoinbaseCallOptions): Promise<CreateWithdrawalResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
27
|
+
}
|
|
28
|
+
export declare class TransactionsService implements ITransactionsService {
|
|
29
|
+
private client;
|
|
30
|
+
constructor(client: CoinbasePrimeClient);
|
|
31
|
+
getTransaction(request: GetTransactionRequest, options?: CoinbaseCallOptions): Promise<GetTransactionResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
32
|
+
listPortfolioTransactions(request: ListPortfolioTransactionsRequest, options?: CoinbaseCallOptions): Promise<ListPortfolioTransactionsResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
33
|
+
listWalletTransactions(request: ListWalletTransactionsRequest, options?: CoinbaseCallOptions): Promise<ListWalletTransactionsResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
34
|
+
createConversion(request: CreateConversionRequest, options?: CoinbaseCallOptions): Promise<CreateConversionResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
35
|
+
createTransfer(request: CreateTransferRequest, options?: CoinbaseCallOptions): Promise<CreateTransferResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
36
|
+
createWithdrawal(request: CreateWithdrawalRequest, options?: CoinbaseCallOptions): Promise<CreateWithdrawalResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
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.TransactionsService = void 0;
|
|
13
|
+
/**
|
|
14
|
+
* Copyright 2024-present Coinbase Global, Inc.
|
|
15
|
+
*
|
|
16
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
17
|
+
* you may not use this file except in compliance with the License.
|
|
18
|
+
* You may obtain a copy of the License at
|
|
19
|
+
*
|
|
20
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
21
|
+
*
|
|
22
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
23
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
24
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
25
|
+
* See the License for the specific language governing permissions and
|
|
26
|
+
* limitations under the License.
|
|
27
|
+
*/
|
|
28
|
+
const core_ts_1 = require("@coinbase-sample/core-ts");
|
|
29
|
+
class TransactionsService {
|
|
30
|
+
constructor(client) {
|
|
31
|
+
this.client = client;
|
|
32
|
+
}
|
|
33
|
+
getTransaction(request, options) {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
const response = yield this.client.request({
|
|
36
|
+
url: `portfolios/${request.portfolioId}/transactions/${request.transactionId}`,
|
|
37
|
+
callOptions: options,
|
|
38
|
+
});
|
|
39
|
+
return response.data;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
listPortfolioTransactions(request, options) {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
const queryParams = Object.assign(Object.assign({}, request), { portfolioId: undefined });
|
|
45
|
+
const response = yield this.client.request({
|
|
46
|
+
url: `portfolios/${request.portfolioId}/transactions`,
|
|
47
|
+
queryParams,
|
|
48
|
+
callOptions: options,
|
|
49
|
+
});
|
|
50
|
+
return response.data;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
listWalletTransactions(request, options) {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
const queryParams = Object.assign(Object.assign({}, request), { portfolioId: undefined, walletId: undefined });
|
|
56
|
+
const response = yield this.client.request({
|
|
57
|
+
url: `portfolios/${request.portfolioId}/wallets/${request.walletId}/transactions`,
|
|
58
|
+
queryParams,
|
|
59
|
+
callOptions: options,
|
|
60
|
+
});
|
|
61
|
+
return response.data;
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
createConversion(request, options) {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
const bodyParams = Object.assign(Object.assign({}, request), { portfolioId: undefined, walletId: undefined });
|
|
67
|
+
const response = yield this.client.request({
|
|
68
|
+
url: `portfolios/${request.portfolioId}/wallets/${request.walletId}/conversions`,
|
|
69
|
+
bodyParams,
|
|
70
|
+
method: core_ts_1.Method.POST,
|
|
71
|
+
callOptions: options,
|
|
72
|
+
});
|
|
73
|
+
return response.data;
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
createTransfer(request, options) {
|
|
77
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
78
|
+
const bodyParams = Object.assign(Object.assign({}, request), { portfolioId: undefined, walletId: undefined });
|
|
79
|
+
const response = yield this.client.request({
|
|
80
|
+
url: `portfolios/${request.portfolioId}/wallets/${request.walletId}/transfers`,
|
|
81
|
+
bodyParams,
|
|
82
|
+
method: core_ts_1.Method.POST,
|
|
83
|
+
callOptions: options,
|
|
84
|
+
});
|
|
85
|
+
return response.data;
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
createWithdrawal(request, options) {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
const bodyParams = Object.assign(Object.assign({}, request), { portfolioId: undefined, walletId: undefined });
|
|
91
|
+
const response = yield this.client.request({
|
|
92
|
+
url: `portfolios/${request.portfolioId}/wallets/${request.walletId}/withdrawals`,
|
|
93
|
+
bodyParams,
|
|
94
|
+
method: core_ts_1.Method.POST,
|
|
95
|
+
callOptions: options,
|
|
96
|
+
});
|
|
97
|
+
return response.data;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
exports.TransactionsService = TransactionsService;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2024-present Coinbase Global, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { TransactionType } from '../model/enums/TransactionType';
|
|
17
|
+
import { GetPortfolioTransactionsResponse } from '../model/GetPortfolioTransactionsResponse';
|
|
18
|
+
import { GetWalletTransactionsResponse } from '../model/GetWalletTransactionsResponse';
|
|
19
|
+
import { GetTransactionResponse as internalGet } from '../model/GetTransactionResponse';
|
|
20
|
+
import { CreateConversionRequest as internalCreateConversion } from '../model/CreateConversionRequest';
|
|
21
|
+
import { CreateConversionResponse as internalCreateConversionResp } from '../model/CreateConversionResponse';
|
|
22
|
+
import { CreateATransferBetweenTwoWallets } from '../model/createATransferBetweenTwoWallets';
|
|
23
|
+
import { CreateWalletWithdrawalRequest } from '../model/CreateWalletWithdrawalRequest';
|
|
24
|
+
import { CreateWalletWithdrawalResponse } from '../model/CreateWalletWithdrawalResponse';
|
|
25
|
+
import { Pagination } from '../shared/pagination';
|
|
26
|
+
import { CreateWalletTransferResponse } from '../model/CreateWalletTransferResponse';
|
|
27
|
+
export type ListPortfolioTransactionsRequest = Pagination & {
|
|
28
|
+
portfolioId: string;
|
|
29
|
+
symbols?: string[];
|
|
30
|
+
types?: TransactionType[];
|
|
31
|
+
startTime?: string;
|
|
32
|
+
endTime?: string;
|
|
33
|
+
};
|
|
34
|
+
export type ListPortfolioTransactionsResponse = GetPortfolioTransactionsResponse;
|
|
35
|
+
export type ListWalletTransactionsRequest = Pagination & {
|
|
36
|
+
portfolioId: string;
|
|
37
|
+
walletId: string;
|
|
38
|
+
types?: TransactionType[];
|
|
39
|
+
startTime?: string;
|
|
40
|
+
endTime?: string;
|
|
41
|
+
};
|
|
42
|
+
export type ListWalletTransactionsResponse = GetWalletTransactionsResponse;
|
|
43
|
+
export type GetTransactionRequest = {
|
|
44
|
+
portfolioId: string;
|
|
45
|
+
transactionId: string;
|
|
46
|
+
};
|
|
47
|
+
export type GetTransactionResponse = internalGet;
|
|
48
|
+
export type CreateConversionRequest = internalCreateConversion & {
|
|
49
|
+
portfolioId: string;
|
|
50
|
+
walletId: string;
|
|
51
|
+
};
|
|
52
|
+
export type CreateConversionResponse = internalCreateConversionResp;
|
|
53
|
+
export type CreateTransferRequest = CreateATransferBetweenTwoWallets & {
|
|
54
|
+
portfolioId: string;
|
|
55
|
+
walletId: string;
|
|
56
|
+
};
|
|
57
|
+
export type CreateTransferResponse = CreateWalletTransferResponse;
|
|
58
|
+
export type CreateWithdrawalRequest = CreateWalletWithdrawalRequest & {
|
|
59
|
+
portfolioId: string;
|
|
60
|
+
walletId: string;
|
|
61
|
+
};
|
|
62
|
+
export type CreateWithdrawalResponse = CreateWalletWithdrawalResponse;
|