@coinbase/cdp-sdk 1.28.0 → 1.29.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 (120) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/_cjs/accounts/evm/toEvmServerAccount.js +1 -1
  3. package/_cjs/accounts/evm/toEvmServerAccount.js.map +1 -1
  4. package/_cjs/accounts/evm/toEvmSmartAccount.js +1 -1
  5. package/_cjs/accounts/evm/toEvmSmartAccount.js.map +1 -1
  6. package/_cjs/accounts/evm/toNetworkScopedEvmServerAccount.js.map +1 -1
  7. package/_cjs/accounts/evm/toNetworkScopedEvmSmartAccount.js +1 -1
  8. package/_cjs/accounts/evm/toNetworkScopedEvmSmartAccount.js.map +1 -1
  9. package/_cjs/accounts/solana/toSolanaAccount.js +30 -0
  10. package/_cjs/accounts/solana/toSolanaAccount.js.map +1 -1
  11. package/_cjs/actions/Quote.js +106 -0
  12. package/_cjs/actions/Quote.js.map +1 -0
  13. package/_cjs/actions/evm/fund/fund.js +5 -5
  14. package/_cjs/actions/evm/fund/fund.js.map +1 -1
  15. package/_cjs/actions/evm/fund/quoteFund.js +7 -7
  16. package/_cjs/actions/evm/fund/quoteFund.js.map +1 -1
  17. package/_cjs/actions/evm/transfer/accountTransferStrategy.js +1 -0
  18. package/_cjs/actions/evm/transfer/accountTransferStrategy.js.map +1 -1
  19. package/_cjs/actions/solana/fund/fund.js +50 -0
  20. package/_cjs/actions/solana/fund/fund.js.map +1 -0
  21. package/_cjs/actions/solana/fund/quoteFund.js +47 -0
  22. package/_cjs/actions/solana/fund/quoteFund.js.map +1 -0
  23. package/{_esm/actions/evm/fund → _cjs/actions}/types.js.map +1 -1
  24. package/_cjs/actions/{evm/fund/waitForFundOperationReceipt.js → waitForFundOperationReceipt.js} +2 -2
  25. package/_cjs/actions/waitForFundOperationReceipt.js.map +1 -0
  26. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +15 -6
  27. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  28. package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js +4 -3
  29. package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js.map +1 -1
  30. package/_cjs/version.js +1 -1
  31. package/_esm/accounts/evm/toEvmServerAccount.js +1 -1
  32. package/_esm/accounts/evm/toEvmServerAccount.js.map +1 -1
  33. package/_esm/accounts/evm/toEvmSmartAccount.js +1 -1
  34. package/_esm/accounts/evm/toEvmSmartAccount.js.map +1 -1
  35. package/_esm/accounts/evm/toNetworkScopedEvmServerAccount.js.map +1 -1
  36. package/_esm/accounts/evm/toNetworkScopedEvmSmartAccount.js +1 -1
  37. package/_esm/accounts/evm/toNetworkScopedEvmSmartAccount.js.map +1 -1
  38. package/_esm/accounts/solana/toSolanaAccount.js +30 -0
  39. package/_esm/accounts/solana/toSolanaAccount.js.map +1 -1
  40. package/_esm/actions/Quote.js +101 -0
  41. package/_esm/actions/Quote.js.map +1 -0
  42. package/_esm/actions/evm/fund/fund.js +5 -5
  43. package/_esm/actions/evm/fund/fund.js.map +1 -1
  44. package/_esm/actions/evm/fund/quoteFund.js +7 -7
  45. package/_esm/actions/evm/fund/quoteFund.js.map +1 -1
  46. package/_esm/actions/evm/transfer/accountTransferStrategy.js +1 -0
  47. package/_esm/actions/evm/transfer/accountTransferStrategy.js.map +1 -1
  48. package/_esm/actions/solana/fund/fund.js +47 -0
  49. package/_esm/actions/solana/fund/fund.js.map +1 -0
  50. package/_esm/actions/solana/fund/quoteFund.js +44 -0
  51. package/_esm/actions/solana/fund/quoteFund.js.map +1 -0
  52. package/{_cjs/actions/evm/fund → _esm/actions}/types.js.map +1 -1
  53. package/_esm/actions/{evm/fund/waitForFundOperationReceipt.js → waitForFundOperationReceipt.js} +2 -2
  54. package/_esm/actions/waitForFundOperationReceipt.js.map +1 -0
  55. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +14 -5
  56. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  57. package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js +4 -3
  58. package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js.map +1 -1
  59. package/_esm/version.js +1 -1
  60. package/_types/accounts/evm/types.d.ts +9 -9
  61. package/_types/accounts/evm/types.d.ts.map +1 -1
  62. package/_types/accounts/solana/toSolanaAccount.d.ts.map +1 -1
  63. package/_types/actions/Quote.d.ts +97 -0
  64. package/_types/actions/Quote.d.ts.map +1 -0
  65. package/_types/actions/evm/fund/fund.d.ts +3 -7
  66. package/_types/actions/evm/fund/fund.d.ts.map +1 -1
  67. package/_types/actions/evm/fund/quoteFund.d.ts +4 -7
  68. package/_types/actions/evm/fund/quoteFund.d.ts.map +1 -1
  69. package/_types/actions/evm/transfer/accountTransferStrategy.d.ts.map +1 -1
  70. package/_types/actions/evm/types.d.ts +7 -7
  71. package/_types/actions/evm/types.d.ts.map +1 -1
  72. package/_types/actions/solana/fund/fund.d.ts +19 -0
  73. package/_types/actions/solana/fund/fund.d.ts.map +1 -0
  74. package/_types/actions/solana/fund/quoteFund.d.ts +20 -0
  75. package/_types/actions/solana/fund/quoteFund.d.ts.map +1 -0
  76. package/_types/actions/solana/types.d.ts +61 -0
  77. package/_types/actions/solana/types.d.ts.map +1 -1
  78. package/_types/actions/types.d.ts +37 -0
  79. package/_types/actions/types.d.ts.map +1 -0
  80. package/_types/actions/{evm/fund/waitForFundOperationReceipt.d.ts → waitForFundOperationReceipt.d.ts} +2 -2
  81. package/_types/actions/waitForFundOperationReceipt.d.ts.map +1 -0
  82. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +26 -22
  83. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
  84. package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.d.ts.map +1 -1
  85. package/_types/version.d.ts +1 -1
  86. package/accounts/evm/toEvmServerAccount.ts +11 -11
  87. package/accounts/evm/toEvmSmartAccount.ts +11 -11
  88. package/accounts/evm/toNetworkScopedEvmServerAccount.ts +5 -5
  89. package/accounts/evm/toNetworkScopedEvmSmartAccount.ts +6 -6
  90. package/accounts/evm/types.ts +16 -12
  91. package/accounts/solana/toSolanaAccount.ts +41 -0
  92. package/actions/Quote.ts +154 -0
  93. package/actions/evm/fund/fund.ts +10 -14
  94. package/actions/evm/fund/quoteFund.ts +13 -16
  95. package/actions/evm/transfer/accountTransferStrategy.ts +2 -0
  96. package/actions/evm/types.ts +7 -7
  97. package/actions/solana/fund/fund.ts +71 -0
  98. package/actions/solana/fund/quoteFund.ts +77 -0
  99. package/actions/solana/types.ts +69 -0
  100. package/actions/types.ts +39 -0
  101. package/actions/{evm/fund/waitForFundOperationReceipt.ts → waitForFundOperationReceipt.ts} +2 -2
  102. package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +30 -30
  103. package/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.ts +4 -3
  104. package/package.json +1 -1
  105. package/version.ts +1 -1
  106. package/_cjs/actions/evm/fund/Quote.js +0 -63
  107. package/_cjs/actions/evm/fund/Quote.js.map +0 -1
  108. package/_cjs/actions/evm/fund/waitForFundOperationReceipt.js.map +0 -1
  109. package/_esm/actions/evm/fund/Quote.js +0 -59
  110. package/_esm/actions/evm/fund/Quote.js.map +0 -1
  111. package/_esm/actions/evm/fund/waitForFundOperationReceipt.js.map +0 -1
  112. package/_types/actions/evm/fund/Quote.d.ts +0 -51
  113. package/_types/actions/evm/fund/Quote.d.ts.map +0 -1
  114. package/_types/actions/evm/fund/types.d.ts +0 -16
  115. package/_types/actions/evm/fund/types.d.ts.map +0 -1
  116. package/_types/actions/evm/fund/waitForFundOperationReceipt.d.ts.map +0 -1
  117. package/actions/evm/fund/Quote.ts +0 -83
  118. package/actions/evm/fund/types.ts +0 -16
  119. /package/_cjs/actions/{evm/fund/types.js → types.js} +0 -0
  120. /package/_esm/actions/{evm/fund/types.js → types.js} +0 -0
@@ -1,83 +0,0 @@
1
- import { FundOperationResult } from "./types.js";
2
- import { CdpOpenApiClientType } from "../../../openapi-client/index.js";
3
-
4
- /**
5
- * A class representing a funding quote that can be executed.
6
- */
7
- export class Quote {
8
- /** Quote for the transfer. */
9
- public quoteId: string;
10
- /** Network to transfer the funds to. */
11
- public network: "base" | "ethereum";
12
- /** The amount in fiat currency. */
13
- public fiatAmount: string;
14
- /** The fiat currency. */
15
- public fiatCurrency: string;
16
- /** The amount in the token to transfer. */
17
- public tokenAmount: string;
18
- /** The token to transfer. */
19
- public token: string;
20
- /** Fees in the token to transfer. */
21
- public fees: {
22
- /** The type of fee. */
23
- type: "exchange_fee" | "network_fee";
24
- amount: string;
25
- currency: string;
26
- }[];
27
-
28
- private apiClient: CdpOpenApiClientType;
29
-
30
- /**
31
- * Creates a new Quote instance.
32
- *
33
- * @param apiClient - The API client.
34
- * @param quoteId - The quote ID.
35
- * @param network - The network to transfer funds to.
36
- * @param fiatAmount - The amount in fiat currency.
37
- * @param fiatCurrency - The fiat currency.
38
- * @param tokenAmount - The amount in the token to transfer.
39
- * @param token - The token to transfer.
40
- * @param fees - Fees for the transfer.
41
- */
42
- constructor(
43
- apiClient: CdpOpenApiClientType,
44
- quoteId: string,
45
- network: "base" | "ethereum",
46
- fiatAmount: string,
47
- fiatCurrency: string,
48
- tokenAmount: string,
49
- token: string,
50
- fees: {
51
- type: "exchange_fee" | "network_fee";
52
- amount: string;
53
- currency: string;
54
- }[],
55
- ) {
56
- this.apiClient = apiClient;
57
- this.quoteId = quoteId;
58
- this.network = network;
59
- this.fiatAmount = fiatAmount;
60
- this.fiatCurrency = fiatCurrency;
61
- this.tokenAmount = tokenAmount;
62
- this.token = token;
63
- this.fees = fees;
64
- }
65
-
66
- /**
67
- * Executes the quote to perform the actual fund transfer.
68
- *
69
- * @returns A promise that resolves to the result of the executed quote.
70
- */
71
- async execute(): Promise<FundOperationResult> {
72
- const transfer = await this.apiClient.executePaymentTransferQuote(this.quoteId);
73
-
74
- return {
75
- id: transfer.id,
76
- network: transfer.target.network,
77
- targetAmount: transfer.targetAmount,
78
- targetCurrency: transfer.targetCurrency,
79
- status: transfer.status,
80
- transactionHash: transfer.transactionHash,
81
- };
82
- }
83
- }
@@ -1,16 +0,0 @@
1
- import { TransferStatus } from "../../../openapi-client/index.js";
2
-
3
- export type FundOperationResult = {
4
- /** The transfer that was created to fund the account. */
5
- id: string;
6
- /** The network that the transfer was created on. */
7
- network: string;
8
- /** The target amount that will be received. */
9
- targetAmount: string;
10
- /** The currency that will be received. */
11
- targetCurrency: string;
12
- /** The status of the fund operation. */
13
- status: TransferStatus;
14
- /** The transaction hash of the transfer. */
15
- transactionHash?: string;
16
- };
File without changes
File without changes