@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.
Files changed (373) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +98 -0
  3. package/dist/activities/index.d.ts +33 -0
  4. package/dist/activities/index.js +73 -0
  5. package/dist/activities/service.d.ts +18 -0
  6. package/dist/activities/service.js +54 -0
  7. package/dist/activities/types.d.ts +47 -0
  8. package/dist/activities/types.js +2 -0
  9. package/dist/addressBooks/index.d.ts +29 -0
  10. package/dist/addressBooks/index.js +57 -0
  11. package/dist/addressBooks/service.d.ts +11 -0
  12. package/dist/addressBooks/service.js +38 -0
  13. package/dist/addressBooks/types.d.ts +29 -0
  14. package/dist/addressBooks/types.js +2 -0
  15. package/dist/allocations/index.d.ts +35 -0
  16. package/dist/allocations/index.js +83 -0
  17. package/dist/allocations/service.d.ts +14 -0
  18. package/dist/allocations/service.js +65 -0
  19. package/dist/allocations/types.d.ts +46 -0
  20. package/dist/allocations/types.js +2 -0
  21. package/dist/assets/index.d.ts +27 -0
  22. package/dist/assets/index.js +27 -0
  23. package/dist/assets/service.d.ts +10 -0
  24. package/dist/assets/service.js +27 -0
  25. package/dist/assets/types.d.ts +20 -0
  26. package/dist/assets/types.js +2 -0
  27. package/dist/balances/index.d.ts +31 -0
  28. package/dist/balances/index.js +49 -0
  29. package/dist/balances/types.d.ts +39 -0
  30. package/dist/balances/types.js +2 -0
  31. package/dist/client.d.ts +20 -0
  32. package/dist/client.js +31 -0
  33. package/dist/commission/index.d.ts +27 -0
  34. package/dist/commission/index.js +27 -0
  35. package/dist/commission/types.d.ts +20 -0
  36. package/dist/commission/types.js +2 -0
  37. package/dist/constants.d.ts +22 -0
  38. package/dist/constants.js +25 -0
  39. package/dist/credentials/index.d.ts +7 -0
  40. package/dist/credentials/index.js +81 -0
  41. package/dist/errors/index.d.ts +22 -0
  42. package/dist/errors/index.js +31 -0
  43. package/dist/index.d.ts +31 -0
  44. package/dist/index.js +50 -0
  45. package/dist/invoices/index.d.ts +27 -0
  46. package/dist/invoices/index.js +27 -0
  47. package/dist/invoices/service.d.ts +10 -0
  48. package/dist/invoices/service.js +27 -0
  49. package/dist/invoices/types.d.ts +20 -0
  50. package/dist/invoices/types.js +2 -0
  51. package/dist/model/Activity.d.ts +73 -0
  52. package/dist/model/Activity.js +21 -0
  53. package/dist/model/ActivityMetadataAccount.d.ts +23 -0
  54. package/dist/model/ActivityMetadataAccount.js +21 -0
  55. package/dist/model/ActivityMetadataConsensus.d.ts +29 -0
  56. package/dist/model/ActivityMetadataConsensus.js +21 -0
  57. package/dist/model/ActivityMetadataTransactions.d.ts +23 -0
  58. package/dist/model/ActivityMetadataTransactions.js +21 -0
  59. package/dist/model/AddressBookEntry.d.ts +69 -0
  60. package/dist/model/AddressBookEntry.js +21 -0
  61. package/dist/model/AggregatedFiatBalance.d.ts +23 -0
  62. package/dist/model/AggregatedFiatBalance.js +21 -0
  63. package/dist/model/Allocation.d.ts +78 -0
  64. package/dist/model/Allocation.js +21 -0
  65. package/dist/model/AllocationLeg.d.ts +33 -0
  66. package/dist/model/AllocationLeg.js +21 -0
  67. package/dist/model/AmountDue.d.ts +33 -0
  68. package/dist/model/AmountDue.js +21 -0
  69. package/dist/model/Asset.d.ts +41 -0
  70. package/dist/model/Asset.js +21 -0
  71. package/dist/model/AssetChange.d.ts +35 -0
  72. package/dist/model/AssetChange.js +21 -0
  73. package/dist/model/Balance.d.ts +69 -0
  74. package/dist/model/Balance.js +21 -0
  75. package/dist/model/BlockchainAddress.d.ts +23 -0
  76. package/dist/model/BlockchainAddress.js +21 -0
  77. package/dist/model/CancelOrderResponse.d.ts +25 -0
  78. package/dist/model/CancelOrderResponse.js +21 -0
  79. package/dist/model/Commission.d.ts +33 -0
  80. package/dist/model/Commission.js +21 -0
  81. package/dist/model/CreateAllocationRequest.d.ts +52 -0
  82. package/dist/model/CreateAllocationRequest.js +21 -0
  83. package/dist/model/CreateAllocationResponse.d.ts +23 -0
  84. package/dist/model/CreateAllocationResponse.js +21 -0
  85. package/dist/model/CreateAllocationResponseBody.d.ts +33 -0
  86. package/dist/model/CreateAllocationResponseBody.js +21 -0
  87. package/dist/model/CreateConversionRequest.d.ts +41 -0
  88. package/dist/model/CreateConversionRequest.js +21 -0
  89. package/dist/model/CreateConversionResponse.d.ts +49 -0
  90. package/dist/model/CreateConversionResponse.js +21 -0
  91. package/dist/model/CreateNetAllocationResponse.d.ts +23 -0
  92. package/dist/model/CreateNetAllocationResponse.js +21 -0
  93. package/dist/model/CreateNetAllocationResponseBody.d.ts +41 -0
  94. package/dist/model/CreateNetAllocationResponseBody.js +21 -0
  95. package/dist/model/CreateOrderRequest.d.ts +40 -0
  96. package/dist/model/CreateOrderRequest.js +21 -0
  97. package/dist/model/CreateOrderResponse.d.ts +25 -0
  98. package/dist/model/CreateOrderResponse.js +21 -0
  99. package/dist/model/CreatePortfolioAddressBookEntryRequest.d.ts +37 -0
  100. package/dist/model/CreatePortfolioAddressBookEntryRequest.js +21 -0
  101. package/dist/model/CreatePortfolioAddressBookEntryResponse.d.ts +25 -0
  102. package/dist/model/CreatePortfolioAddressBookEntryResponse.js +21 -0
  103. package/dist/model/CreateWalletRequest.d.ts +26 -0
  104. package/dist/model/CreateWalletRequest.js +21 -0
  105. package/dist/model/CreateWalletResponse.d.ts +26 -0
  106. package/dist/model/CreateWalletResponse.js +21 -0
  107. package/dist/model/CreateWalletTransferResponse.d.ts +61 -0
  108. package/dist/model/CreateWalletTransferResponse.js +21 -0
  109. package/dist/model/CreateWalletWithdrawalRequest.d.ts +39 -0
  110. package/dist/model/CreateWalletWithdrawalRequest.js +21 -0
  111. package/dist/model/CreateWalletWithdrawalResponse.d.ts +56 -0
  112. package/dist/model/CreateWalletWithdrawalResponse.js +21 -0
  113. package/dist/model/DefiBalance.d.ts +24 -0
  114. package/dist/model/DefiBalance.js +21 -0
  115. package/dist/model/DestinationAlloc.d.ts +41 -0
  116. package/dist/model/DestinationAlloc.js +21 -0
  117. package/dist/model/DisplayUser.d.ts +33 -0
  118. package/dist/model/DisplayUser.js +21 -0
  119. package/dist/model/EntityUser.d.ts +39 -0
  120. package/dist/model/EntityUser.js +21 -0
  121. package/dist/model/EstimatedNetworkFees.d.ts +29 -0
  122. package/dist/model/EstimatedNetworkFees.js +21 -0
  123. package/dist/model/Fill.d.ts +59 -0
  124. package/dist/model/Fill.js +21 -0
  125. package/dist/model/GetActivityResponse.d.ts +23 -0
  126. package/dist/model/GetActivityResponse.js +21 -0
  127. package/dist/model/GetAllocationResponse.d.ts +23 -0
  128. package/dist/model/GetAllocationResponse.js +21 -0
  129. package/dist/model/GetAllocationsByClientNettingIdResponse.d.ts +23 -0
  130. package/dist/model/GetAllocationsByClientNettingIdResponse.js +21 -0
  131. package/dist/model/GetEntityActivitiesResponse.d.ts +25 -0
  132. package/dist/model/GetEntityActivitiesResponse.js +21 -0
  133. package/dist/model/GetEntityAssetsResponse.d.ts +23 -0
  134. package/dist/model/GetEntityAssetsResponse.js +21 -0
  135. package/dist/model/GetEntityPaymentMethodDetailsResponse.d.ts +23 -0
  136. package/dist/model/GetEntityPaymentMethodDetailsResponse.js +21 -0
  137. package/dist/model/GetEntityPaymentMethodsResponse.d.ts +23 -0
  138. package/dist/model/GetEntityPaymentMethodsResponse.js +21 -0
  139. package/dist/model/GetEntityUsersResponse.d.ts +28 -0
  140. package/dist/model/GetEntityUsersResponse.js +21 -0
  141. package/dist/model/GetInvoicesResponse.d.ts +23 -0
  142. package/dist/model/GetInvoicesResponse.js +21 -0
  143. package/dist/model/GetOpenOrdersResponse.d.ts +25 -0
  144. package/dist/model/GetOpenOrdersResponse.js +21 -0
  145. package/dist/model/GetOrderFillsResponse.d.ts +25 -0
  146. package/dist/model/GetOrderFillsResponse.js +21 -0
  147. package/dist/model/GetOrderResponse.d.ts +23 -0
  148. package/dist/model/GetOrderResponse.js +21 -0
  149. package/dist/model/GetOrdersResponse.d.ts +25 -0
  150. package/dist/model/GetOrdersResponse.js +21 -0
  151. package/dist/model/GetPortfolioActivitiesResponse.d.ts +25 -0
  152. package/dist/model/GetPortfolioActivitiesResponse.js +21 -0
  153. package/dist/model/GetPortfolioActivityResponse.d.ts +23 -0
  154. package/dist/model/GetPortfolioActivityResponse.js +21 -0
  155. package/dist/model/GetPortfolioAddressBookResponse.d.ts +28 -0
  156. package/dist/model/GetPortfolioAddressBookResponse.js +21 -0
  157. package/dist/model/GetPortfolioAllocationsResponse.d.ts +28 -0
  158. package/dist/model/GetPortfolioAllocationsResponse.js +21 -0
  159. package/dist/model/GetPortfolioBalancesResponse.d.ts +31 -0
  160. package/dist/model/GetPortfolioBalancesResponse.js +21 -0
  161. package/dist/model/GetPortfolioCommissionResponse.d.ts +23 -0
  162. package/dist/model/GetPortfolioCommissionResponse.js +21 -0
  163. package/dist/model/GetPortfolioFillsResponse.d.ts +25 -0
  164. package/dist/model/GetPortfolioFillsResponse.js +21 -0
  165. package/dist/model/GetPortfolioProductsResponse.d.ts +25 -0
  166. package/dist/model/GetPortfolioProductsResponse.js +21 -0
  167. package/dist/model/GetPortfolioResponse.d.ts +23 -0
  168. package/dist/model/GetPortfolioResponse.js +21 -0
  169. package/dist/model/GetPortfolioTransactionsResponse.d.ts +25 -0
  170. package/dist/model/GetPortfolioTransactionsResponse.js +21 -0
  171. package/dist/model/GetPortfolioUsersResponse.d.ts +28 -0
  172. package/dist/model/GetPortfolioUsersResponse.js +21 -0
  173. package/dist/model/GetPortfoliosResponse.d.ts +26 -0
  174. package/dist/model/GetPortfoliosResponse.js +21 -0
  175. package/dist/model/GetPostTradeCreditResponse.d.ts +23 -0
  176. package/dist/model/GetPostTradeCreditResponse.js +21 -0
  177. package/dist/model/GetTransactionResponse.d.ts +23 -0
  178. package/dist/model/GetTransactionResponse.js +21 -0
  179. package/dist/model/GetWalletBalanceResponse.d.ts +23 -0
  180. package/dist/model/GetWalletBalanceResponse.js +21 -0
  181. package/dist/model/GetWalletDepositInstructionsResponse.d.ts +25 -0
  182. package/dist/model/GetWalletDepositInstructionsResponse.js +21 -0
  183. package/dist/model/GetWalletResponse.d.ts +23 -0
  184. package/dist/model/GetWalletResponse.js +21 -0
  185. package/dist/model/GetWalletTransactionsResponse.d.ts +25 -0
  186. package/dist/model/GetWalletTransactionsResponse.js +21 -0
  187. package/dist/model/GetWalletsResponse.d.ts +25 -0
  188. package/dist/model/GetWalletsResponse.js +21 -0
  189. package/dist/model/Invoice.d.ts +32 -0
  190. package/dist/model/Invoice.js +21 -0
  191. package/dist/model/InvoiceItem.d.ts +30 -0
  192. package/dist/model/InvoiceItem.js +21 -0
  193. package/dist/model/ListWeb3WalletBalancesResponse.d.ts +30 -0
  194. package/dist/model/ListWeb3WalletBalancesResponse.js +21 -0
  195. package/dist/model/MatchMetadata.d.ts +29 -0
  196. package/dist/model/MatchMetadata.js +21 -0
  197. package/dist/model/NFTCollection.d.ts +25 -0
  198. package/dist/model/NFTCollection.js +21 -0
  199. package/dist/model/NFTItem.d.ts +25 -0
  200. package/dist/model/NFTItem.js +21 -0
  201. package/dist/model/Order.d.ts +105 -0
  202. package/dist/model/Order.js +21 -0
  203. package/dist/model/OrderPreviewRequest.d.ts +36 -0
  204. package/dist/model/OrderPreviewRequest.js +21 -0
  205. package/dist/model/PaginatedResponse.d.ts +31 -0
  206. package/dist/model/PaginatedResponse.js +21 -0
  207. package/dist/model/PaymentMethodDestination.d.ts +22 -0
  208. package/dist/model/PaymentMethodDestination.js +21 -0
  209. package/dist/model/PaymentMethodDetails.d.ts +28 -0
  210. package/dist/model/PaymentMethodDetails.js +21 -0
  211. package/dist/model/PaymentMethodSummary.d.ts +28 -0
  212. package/dist/model/PaymentMethodSummary.js +21 -0
  213. package/dist/model/PortfolioUser.d.ts +43 -0
  214. package/dist/model/PortfolioUser.js +21 -0
  215. package/dist/model/PostOrderPreviewResponse.d.ts +83 -0
  216. package/dist/model/PostOrderPreviewResponse.js +21 -0
  217. package/dist/model/PostTradeCreditInformation.d.ts +63 -0
  218. package/dist/model/PostTradeCreditInformation.js +21 -0
  219. package/dist/model/Product.d.ts +58 -0
  220. package/dist/model/Product.js +21 -0
  221. package/dist/model/Transaction.d.ts +97 -0
  222. package/dist/model/Transaction.js +21 -0
  223. package/dist/model/TransactionMetadata.d.ts +23 -0
  224. package/dist/model/TransactionMetadata.js +21 -0
  225. package/dist/model/TransferLocation.d.ts +27 -0
  226. package/dist/model/TransferLocation.js +21 -0
  227. package/dist/model/UserAction.d.ts +31 -0
  228. package/dist/model/UserAction.js +21 -0
  229. package/dist/model/Wallet.d.ts +28 -0
  230. package/dist/model/Wallet.js +21 -0
  231. package/dist/model/WalletCryptoDepositInstructions.d.ts +43 -0
  232. package/dist/model/WalletCryptoDepositInstructions.js +21 -0
  233. package/dist/model/WalletFiatDepositInstructions.d.ts +28 -0
  234. package/dist/model/WalletFiatDepositInstructions.js +21 -0
  235. package/dist/model/Web3Asset.d.ts +38 -0
  236. package/dist/model/Web3Asset.js +21 -0
  237. package/dist/model/Web3Balance.d.ts +29 -0
  238. package/dist/model/Web3Balance.js +21 -0
  239. package/dist/model/assets.d.ts +13 -0
  240. package/dist/model/assets.js +2 -0
  241. package/dist/model/createATransferBetweenTwoWallets.d.ts +37 -0
  242. package/dist/model/createATransferBetweenTwoWallets.js +21 -0
  243. package/dist/model/enums/Action.d.ts +26 -0
  244. package/dist/model/enums/Action.js +30 -0
  245. package/dist/model/enums/ActivityCategory.d.ts +28 -0
  246. package/dist/model/enums/ActivityCategory.js +32 -0
  247. package/dist/model/enums/ActivityLevel.d.ts +24 -0
  248. package/dist/model/enums/ActivityLevel.js +28 -0
  249. package/dist/model/enums/ActivitySecondaryType.d.ts +28 -0
  250. package/dist/model/enums/ActivitySecondaryType.js +32 -0
  251. package/dist/model/enums/ActivityStatus.d.ts +28 -0
  252. package/dist/model/enums/ActivityStatus.js +32 -0
  253. package/dist/model/enums/ActivityType.d.ts +63 -0
  254. package/dist/model/enums/ActivityType.js +67 -0
  255. package/dist/model/enums/AddressBookType.d.ts +24 -0
  256. package/dist/model/enums/AddressBookType.js +28 -0
  257. package/dist/model/enums/AllocationSizeType.d.ts +25 -0
  258. package/dist/model/enums/AllocationSizeType.js +29 -0
  259. package/dist/model/enums/AllocationStatus.d.ts +26 -0
  260. package/dist/model/enums/AllocationStatus.js +30 -0
  261. package/dist/model/enums/AssetChangeType.d.ts +27 -0
  262. package/dist/model/enums/AssetChangeType.js +31 -0
  263. package/dist/model/enums/DestinationType.d.ts +25 -0
  264. package/dist/model/enums/DestinationType.js +29 -0
  265. package/dist/model/enums/HierarchyType.d.ts +24 -0
  266. package/dist/model/enums/HierarchyType.js +28 -0
  267. package/dist/model/enums/InvoiceState.d.ts +26 -0
  268. package/dist/model/enums/InvoiceState.js +30 -0
  269. package/dist/model/enums/InvoiceType.d.ts +27 -0
  270. package/dist/model/enums/InvoiceType.js +31 -0
  271. package/dist/model/enums/OrderSide.d.ts +27 -0
  272. package/dist/model/enums/OrderSide.js +31 -0
  273. package/dist/model/enums/OrderStatus.d.ts +31 -0
  274. package/dist/model/enums/OrderStatus.js +35 -0
  275. package/dist/model/enums/OrderType.d.ts +31 -0
  276. package/dist/model/enums/OrderType.js +35 -0
  277. package/dist/model/enums/PaymentMethodType.d.ts +28 -0
  278. package/dist/model/enums/PaymentMethodType.js +32 -0
  279. package/dist/model/enums/PortfolioBalanceType.d.ts +25 -0
  280. package/dist/model/enums/PortfolioBalanceType.js +29 -0
  281. package/dist/model/enums/ProductPermissions.d.ts +25 -0
  282. package/dist/model/enums/ProductPermissions.js +29 -0
  283. package/dist/model/enums/SortDirection.d.ts +23 -0
  284. package/dist/model/enums/SortDirection.js +27 -0
  285. package/dist/model/enums/TimeInForceType.d.ts +29 -0
  286. package/dist/model/enums/TimeInForceType.js +33 -0
  287. package/dist/model/enums/TransactionStatus.d.ts +46 -0
  288. package/dist/model/enums/TransactionStatus.js +50 -0
  289. package/dist/model/enums/TransactionType.d.ts +57 -0
  290. package/dist/model/enums/TransactionType.js +61 -0
  291. package/dist/model/enums/TransferLocationType.d.ts +28 -0
  292. package/dist/model/enums/TransferLocationType.js +32 -0
  293. package/dist/model/enums/UserRole.d.ts +34 -0
  294. package/dist/model/enums/UserRole.js +38 -0
  295. package/dist/model/enums/VisibilityStatus.d.ts +25 -0
  296. package/dist/model/enums/VisibilityStatus.js +29 -0
  297. package/dist/model/enums/WalletDepositInstructionType.d.ts +29 -0
  298. package/dist/model/enums/WalletDepositInstructionType.js +33 -0
  299. package/dist/model/enums/WalletType.d.ts +30 -0
  300. package/dist/model/enums/WalletType.js +34 -0
  301. package/dist/model/portfolio.d.ts +41 -0
  302. package/dist/model/portfolio.js +21 -0
  303. package/dist/model/services/activitityService.d.ts +33 -0
  304. package/dist/model/services/activitityService.js +2 -0
  305. package/dist/model/services/addressBookService.d.ts +14 -0
  306. package/dist/model/services/addressBookService.js +2 -0
  307. package/dist/model/services/allocationService.d.ts +24 -0
  308. package/dist/model/services/allocationService.js +2 -0
  309. package/dist/model/services/assetService.d.ts +5 -0
  310. package/dist/model/services/assetService.js +2 -0
  311. package/dist/model/services/balanceService.d.ts +24 -0
  312. package/dist/model/services/balanceService.js +2 -0
  313. package/dist/model/services/commissionService.d.ts +5 -0
  314. package/dist/model/services/commissionService.js +2 -0
  315. package/dist/model/services/invoiceService.d.ts +5 -0
  316. package/dist/model/services/invoiceService.js +2 -0
  317. package/dist/model/services/orderService.d.ts +62 -0
  318. package/dist/model/services/orderService.js +2 -0
  319. package/dist/model/services/pagination.d.ts +9 -0
  320. package/dist/model/services/pagination.js +2 -0
  321. package/dist/model/services/paymentMethodsService.d.ts +10 -0
  322. package/dist/model/services/paymentMethodsService.js +2 -0
  323. package/dist/model/services/portfolioService.d.ts +15 -0
  324. package/dist/model/services/portfolioService.js +2 -0
  325. package/dist/model/services/productService.d.ts +6 -0
  326. package/dist/model/services/productService.js +2 -0
  327. package/dist/model/services/shared.d.ts +6 -0
  328. package/dist/model/services/shared.js +2 -0
  329. package/dist/model/services/transactionService.d.ts +47 -0
  330. package/dist/model/services/transactionService.js +2 -0
  331. package/dist/model/services/usersService.d.ts +9 -0
  332. package/dist/model/services/usersService.js +2 -0
  333. package/dist/model/services/walletService.d.ts +27 -0
  334. package/dist/model/services/walletService.js +2 -0
  335. package/dist/orders/index.d.ts +41 -0
  336. package/dist/orders/index.js +119 -0
  337. package/dist/orders/types.d.ts +77 -0
  338. package/dist/orders/types.js +2 -0
  339. package/dist/paymentMethods/index.d.ts +29 -0
  340. package/dist/paymentMethods/index.js +36 -0
  341. package/dist/paymentMethods/service.d.ts +11 -0
  342. package/dist/paymentMethods/service.js +36 -0
  343. package/dist/paymentMethods/types.d.ts +25 -0
  344. package/dist/paymentMethods/types.js +2 -0
  345. package/dist/portfolio/service.d.ts +12 -0
  346. package/dist/portfolio/service.js +42 -0
  347. package/dist/portfolios/index.d.ts +31 -0
  348. package/dist/portfolios/index.js +45 -0
  349. package/dist/portfolios/types.d.ts +30 -0
  350. package/dist/portfolios/types.js +2 -0
  351. package/dist/products/index.d.ts +27 -0
  352. package/dist/products/index.js +27 -0
  353. package/dist/products/types.d.ts +21 -0
  354. package/dist/products/types.js +2 -0
  355. package/dist/shared/pagination.d.ts +24 -0
  356. package/dist/shared/pagination.js +2 -0
  357. package/dist/shared/toCamelCase.d.ts +1 -0
  358. package/dist/shared/toCamelCase.js +23 -0
  359. package/dist/transactions/index.d.ts +37 -0
  360. package/dist/transactions/index.js +101 -0
  361. package/dist/transactions/types.d.ts +62 -0
  362. package/dist/transactions/types.js +2 -0
  363. package/dist/users/index.d.ts +29 -0
  364. package/dist/users/index.js +36 -0
  365. package/dist/users/service.d.ts +11 -0
  366. package/dist/users/service.js +36 -0
  367. package/dist/users/types.d.ts +24 -0
  368. package/dist/users/types.js +2 -0
  369. package/dist/wallets/index.d.ts +33 -0
  370. package/dist/wallets/index.js +73 -0
  371. package/dist/wallets/types.d.ts +42 -0
  372. package/dist/wallets/types.js +2 -0
  373. package/package.json +38 -0
@@ -0,0 +1,65 @@
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.AssetService = void 0;
13
+ class AssetService {
14
+ constructor(client) {
15
+ this.client = client;
16
+ }
17
+ createAllocation(request, options) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ const response = yield this.client.request({
20
+ url: `allocations`,
21
+ bodyParams: request,
22
+ callOptions: options,
23
+ });
24
+ return response.data;
25
+ });
26
+ }
27
+ createNetAllocation(request, options) {
28
+ return __awaiter(this, void 0, void 0, function* () {
29
+ const response = yield this.client.request({
30
+ url: `allocations/net`,
31
+ bodyParams: request,
32
+ callOptions: options,
33
+ });
34
+ return response.data;
35
+ });
36
+ }
37
+ listPortfolioAllocations(request, options) {
38
+ return __awaiter(this, void 0, void 0, function* () {
39
+ const response = yield this.client.request({
40
+ url: `portfolios/${request.portfolioId}/allocations`,
41
+ callOptions: options,
42
+ });
43
+ return response.data;
44
+ });
45
+ }
46
+ listNetAllocations(request, options) {
47
+ return __awaiter(this, void 0, void 0, function* () {
48
+ const response = yield this.client.request({
49
+ url: `portfolios/${request.portfolioId}/allocations/net/${request.nettingId}`,
50
+ callOptions: options,
51
+ });
52
+ return response.data;
53
+ });
54
+ }
55
+ getAllocation(request, options) {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ const response = yield this.client.request({
58
+ url: `portfolios/${request.portfolioId}/allocations/${request.allocationId}`,
59
+ callOptions: options,
60
+ });
61
+ return response.data;
62
+ });
63
+ }
64
+ }
65
+ exports.AssetService = AssetService;
@@ -0,0 +1,46 @@
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 { CreateAllocationRequest as internalCreate } from '../model/CreateAllocationRequest';
17
+ import { CreateAllocationResponse as internalResponse } from '../model/CreateAllocationResponse';
18
+ import { CreateNetAllocationResponse as internalNetCreate } from '../model/CreateNetAllocationResponse';
19
+ import { GetPortfolioAllocationsResponse } from '../model/GetPortfolioAllocationsResponse';
20
+ import { GetAllocationResponse as internalGet } from '../model/GetAllocationResponse';
21
+ import { GetAllocationsByClientNettingIdResponse } from '../model/GetAllocationsByClientNettingIdResponse';
22
+ import { OrderSide } from '../model/enums/OrderSide';
23
+ import { Pagination } from '../shared/pagination';
24
+ export type CreateAllocationRequest = internalCreate;
25
+ export type CreateAllocationResponse = internalResponse;
26
+ export type CreateNetAllocationRequest = internalCreate;
27
+ export type CreateNetAllocationResponse = internalNetCreate;
28
+ export type ListPortfolioAllocationsRequest = Pagination & {
29
+ portfolioId: string;
30
+ productIds?: string[];
31
+ orderSide?: OrderSide;
32
+ startDate?: string;
33
+ endDate?: string;
34
+ };
35
+ export type ListPortfolioAllocationsResponse = GetPortfolioAllocationsResponse;
36
+ export type ListNetAllocationsRequest = {
37
+ portfolioId: string;
38
+ nettingId: string;
39
+ allocationId?: string;
40
+ };
41
+ export type ListNetAllocationsResponse = GetAllocationsByClientNettingIdResponse;
42
+ export type GetAllocationRequest = {
43
+ portfolioId: string;
44
+ allocationId: string;
45
+ };
46
+ export type GetAllocationResponse = internalGet;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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 { ListAssetsRequest, ListAssetsResponse } from './types';
20
+ export interface IAssetsService {
21
+ listAssets(request: ListAssetsRequest, options?: CoinbaseCallOptions): Promise<ListAssetsResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
22
+ }
23
+ export declare class AssetsService implements IAssetsService {
24
+ private client;
25
+ constructor(client: CoinbasePrimeClient);
26
+ listAssets(request: ListAssetsRequest, options?: CoinbaseCallOptions): Promise<ListAssetsResponse | 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.AssetsService = void 0;
13
+ class AssetsService {
14
+ constructor(client) {
15
+ this.client = client;
16
+ }
17
+ listAssets(request, options) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ const response = yield this.client.request({
20
+ url: `entities/${request.entityId}/assets`,
21
+ callOptions: options,
22
+ });
23
+ return response.data;
24
+ });
25
+ }
26
+ }
27
+ exports.AssetsService = AssetsService;
@@ -0,0 +1,10 @@
1
+ import { CoinbasePrimeClient } from '../client';
2
+ import { CoinbasePrimeClientException, CoinbasePrimeException } from '../errors';
3
+ import { ListAssetsRequest, ListAssetsResponse } from '../model/services/assetService';
4
+ export interface AssetService {
5
+ listAssets(request: ListAssetsRequest): Promise<ListAssetsResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
6
+ }
7
+ export declare class AssetService implements AssetService {
8
+ private client;
9
+ constructor(client: CoinbasePrimeClient);
10
+ }
@@ -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.AssetService = void 0;
13
+ class AssetService {
14
+ constructor(client) {
15
+ this.client = client;
16
+ }
17
+ listAssets(request, options) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ const response = yield this.client.request({
20
+ url: `entities/${request.entityId}/assets`,
21
+ callOptions: options,
22
+ });
23
+ return response.data;
24
+ });
25
+ }
26
+ }
27
+ exports.AssetService = AssetService;
@@ -0,0 +1,20 @@
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 { GetEntityAssetsResponse } from '../model/GetEntityAssetsResponse';
17
+ export type ListAssetsRequest = {
18
+ entityId: string;
19
+ };
20
+ export type ListAssetsResponse = GetEntityAssetsResponse;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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 { GetWalletBalanceRequest, GetWalletBalanceResponse, ListOnchainWalletBalancesRequest, ListOnchainWalletBalancesResponse, ListPortfolioBalancesRequest, ListPortfolioBalancesResponse } from './types';
20
+ export interface IBalancesService {
21
+ listPortfolioBalances(request: ListPortfolioBalancesRequest, options?: CoinbaseCallOptions): Promise<ListPortfolioBalancesResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
22
+ getWalletBalance(request: GetWalletBalanceRequest, options?: CoinbaseCallOptions): Promise<GetWalletBalanceResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
23
+ listOnchainWalletBalances(request: ListOnchainWalletBalancesRequest, options?: CoinbaseCallOptions): Promise<ListOnchainWalletBalancesResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
24
+ }
25
+ export declare class BalancesService implements IBalancesService {
26
+ private client;
27
+ constructor(client: CoinbasePrimeClient);
28
+ listPortfolioBalances(request: ListPortfolioBalancesRequest, options?: CoinbaseCallOptions): Promise<ListPortfolioBalancesResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
29
+ getWalletBalance(request: GetWalletBalanceRequest, options?: CoinbaseCallOptions): Promise<GetWalletBalanceResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
30
+ listOnchainWalletBalances(request: ListOnchainWalletBalancesRequest, options?: CoinbaseCallOptions): Promise<ListOnchainWalletBalancesResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
31
+ }
@@ -0,0 +1,49 @@
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.BalancesService = void 0;
13
+ class BalancesService {
14
+ constructor(client) {
15
+ this.client = client;
16
+ }
17
+ listPortfolioBalances(request, options) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ const queryParams = Object.assign(Object.assign({}, request), { portfolioId: undefined });
20
+ const response = yield this.client.request({
21
+ url: `portfolios/${request.portfolioId}/balances`,
22
+ queryParams,
23
+ callOptions: options,
24
+ });
25
+ return response.data;
26
+ });
27
+ }
28
+ getWalletBalance(request, options) {
29
+ return __awaiter(this, void 0, void 0, function* () {
30
+ const response = yield this.client.request({
31
+ url: `portfolios/${request.portfolioId}/wallets/${request.walletId}balances`,
32
+ callOptions: options,
33
+ });
34
+ return response.data;
35
+ });
36
+ }
37
+ listOnchainWalletBalances(request, options) {
38
+ return __awaiter(this, void 0, void 0, function* () {
39
+ const queryParams = Object.assign(Object.assign({}, request), { portfolioId: undefined, walletId: undefined });
40
+ const response = yield this.client.request({
41
+ url: `portfolios/${request.portfolioId}wallets/${request.walletId}/web3_balances`,
42
+ queryParams,
43
+ callOptions: options,
44
+ });
45
+ return response.data;
46
+ });
47
+ }
48
+ }
49
+ exports.BalancesService = BalancesService;
@@ -0,0 +1,39 @@
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 { PortfolioBalanceType } from '../model/enums/PortfolioBalanceType';
17
+ import { VisibilityStatus } from '../model/enums/VisibilityStatus';
18
+ import { GetPortfolioBalancesResponse } from '../model/GetPortfolioBalancesResponse';
19
+ import { GetWalletBalanceResponse as internalGetResp } from '../model/GetWalletBalanceResponse';
20
+ import { ListWeb3WalletBalancesResponse } from '../model/ListWeb3WalletBalancesResponse';
21
+ export type ListPortfolioBalancesRequest = {
22
+ portfolioId: string;
23
+ symbol: string;
24
+ balanceType?: PortfolioBalanceType;
25
+ };
26
+ export type ListPortfolioBalancesResponse = GetPortfolioBalancesResponse;
27
+ export type GetWalletBalanceRequest = {
28
+ portfolioId: string;
29
+ walletId: string;
30
+ };
31
+ export type GetWalletBalanceResponse = internalGetResp;
32
+ export type ListOnchainWalletBalancesRequest = {
33
+ portfolioId: string;
34
+ walletId: string;
35
+ visibilityStatuses?: VisibilityStatus[];
36
+ cursor?: string;
37
+ limit?: number;
38
+ };
39
+ export type ListOnchainWalletBalancesResponse = ListWeb3WalletBalancesResponse;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,20 @@
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 { CoinbaseClient } from '../../core-ts/dist';
17
+ import { CoinbasePrimeCredentials } from './credentials';
18
+ export declare class CoinbasePrimeClient extends CoinbaseClient {
19
+ constructor(credentials?: CoinbasePrimeCredentials, apiBasePath?: string);
20
+ }
package/dist/client.js ADDED
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CoinbasePrimeClient = void 0;
4
+ /**
5
+ * Copyright 2024-present Coinbase Global, Inc.
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ const dist_1 = require("../../core-ts/dist");
20
+ const constants_1 = require("./constants");
21
+ const toCamelCase_1 = require("./shared/toCamelCase");
22
+ class CoinbasePrimeClient extends dist_1.CoinbaseClient {
23
+ constructor(credentials, apiBasePath) {
24
+ super(apiBasePath !== null && apiBasePath !== void 0 ? apiBasePath : constants_1.API_BASE_PATH, credentials, constants_1.USER_AGENT);
25
+ // transform the response data to camelCase
26
+ this.addTransformResponse((response) => {
27
+ return Object.assign(Object.assign({}, response), { data: (0, toCamelCase_1.toCamelCase)(response.data) });
28
+ });
29
+ }
30
+ }
31
+ exports.CoinbasePrimeClient = CoinbasePrimeClient;
@@ -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 { GetPortfolioCommissionRequest, GetPortfolioCommissionResponse } from './types';
20
+ export interface ICommissionService {
21
+ getPortfolioCommission(request: GetPortfolioCommissionRequest, options?: CoinbaseCallOptions): Promise<GetPortfolioCommissionResponse | CoinbasePrimeClientException | CoinbasePrimeException>;
22
+ }
23
+ export declare class CommissionService implements ICommissionService {
24
+ private client;
25
+ constructor(client: CoinbasePrimeClient);
26
+ getPortfolioCommission(request: GetPortfolioCommissionRequest, options?: CoinbaseCallOptions): Promise<GetPortfolioCommissionResponse | 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.CommissionService = void 0;
13
+ class CommissionService {
14
+ constructor(client) {
15
+ this.client = client;
16
+ }
17
+ getPortfolioCommission(request, options) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ const response = yield this.client.request({
20
+ url: `portfolios/${request.portfolioId}/commission`,
21
+ callOptions: options,
22
+ });
23
+ return response.data;
24
+ });
25
+ }
26
+ }
27
+ exports.CommissionService = CommissionService;
@@ -0,0 +1,20 @@
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 { GetPortfolioCommissionResponse as internalGet } from '../model/GetPortfolioCommissionResponse';
17
+ export type GetPortfolioCommissionRequest = {
18
+ portfolioId: string;
19
+ };
20
+ export type GetPortfolioCommissionResponse = internalGet;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,22 @@
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
+ export declare const VERSION = "0.1.0";
17
+ export declare const API_BASE_PATH = "https://api.prime.coinbase.com/v1/";
18
+ export declare const USER_AGENT: string;
19
+ export declare const CB_ACCESS_KEY_HEADER = "X-CB-ACCESS-KEY";
20
+ export declare const CB_ACCESS_PHRASE_HEADER = "X-CB-ACCESS-PASSPHRASE";
21
+ export declare const CB_ACCESS_SIGNATURE_HEADER = "X-CB-ACCESS-SIGNATURE";
22
+ export declare const CB_ACCESS_TIMESTAMP_HEADER = "X-CB-ACCESS-TIMESTAMP";
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CB_ACCESS_TIMESTAMP_HEADER = exports.CB_ACCESS_SIGNATURE_HEADER = exports.CB_ACCESS_PHRASE_HEADER = exports.CB_ACCESS_KEY_HEADER = exports.USER_AGENT = exports.API_BASE_PATH = exports.VERSION = void 0;
4
+ /**
5
+ * Copyright 2024-present Coinbase Global, Inc.
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ exports.VERSION = '0.1.0';
20
+ exports.API_BASE_PATH = 'https://api.prime.coinbase.com/v1/';
21
+ exports.USER_AGENT = 'coinbase-prime-ts/' + exports.VERSION;
22
+ exports.CB_ACCESS_KEY_HEADER = 'X-CB-ACCESS-KEY';
23
+ exports.CB_ACCESS_PHRASE_HEADER = 'X-CB-ACCESS-PASSPHRASE';
24
+ exports.CB_ACCESS_SIGNATURE_HEADER = 'X-CB-ACCESS-SIGNATURE';
25
+ exports.CB_ACCESS_TIMESTAMP_HEADER = 'X-CB-ACCESS-TIMESTAMP';
@@ -0,0 +1,7 @@
1
+ export declare class CoinbasePrimeCredentials {
2
+ private accessKey;
3
+ private secretKey;
4
+ private passphrase;
5
+ constructor(key?: string, secret?: string, passphrase?: string);
6
+ generateAuthHeaders(requestMethod: string, uri: string, body: string): Record<string, string>;
7
+ }
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.CoinbasePrimeCredentials = void 0;
37
+ /**
38
+ * Copyright 2024-present Coinbase Global, Inc.
39
+ *
40
+ * Licensed under the Apache License, Version 2.0 (the "License");
41
+ * you may not use this file except in compliance with the License.
42
+ * You may obtain a copy of the License at
43
+ *
44
+ * http://www.apache.org/licenses/LICENSE-2.0
45
+ *
46
+ * Unless required by applicable law or agreed to in writing, software
47
+ * distributed under the License is distributed on an "AS IS" BASIS,
48
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
49
+ * See the License for the specific language governing permissions and
50
+ * limitations under the License.
51
+ */
52
+ const constants_1 = require("../constants");
53
+ const crypto = __importStar(require("crypto"));
54
+ class CoinbasePrimeCredentials {
55
+ constructor(key, secret, passphrase) {
56
+ if (!key || !secret || !passphrase) {
57
+ console.log('Could not authenticate. Only public endpoints accessible.');
58
+ }
59
+ this.accessKey = key;
60
+ this.secretKey = secret;
61
+ this.passphrase = passphrase;
62
+ }
63
+ generateAuthHeaders(requestMethod, uri, body) {
64
+ if (!this.secretKey || !this.accessKey || !this.passphrase) {
65
+ return {};
66
+ }
67
+ const timestamp = Math.floor(Date.now() / 1000);
68
+ const message = timestamp + requestMethod + new URL(uri).pathname + (body || '');
69
+ const signature = crypto
70
+ .createHmac('sha256', this.secretKey)
71
+ .update(message)
72
+ .digest('base64');
73
+ return {
74
+ [constants_1.CB_ACCESS_TIMESTAMP_HEADER]: timestamp.toString(),
75
+ [constants_1.CB_ACCESS_SIGNATURE_HEADER]: signature,
76
+ [constants_1.CB_ACCESS_KEY_HEADER]: this.accessKey,
77
+ [constants_1.CB_ACCESS_PHRASE_HEADER]: this.passphrase,
78
+ };
79
+ }
80
+ }
81
+ exports.CoinbasePrimeCredentials = CoinbasePrimeCredentials;