@coinbase/cdp-sdk 1.10.0 → 1.12.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 (159) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +137 -0
  3. package/_cjs/accounts/evm/toEvmServerAccount.js +32 -0
  4. package/_cjs/accounts/evm/toEvmServerAccount.js.map +1 -1
  5. package/_cjs/accounts/evm/toEvmSmartAccount.js +18 -0
  6. package/_cjs/accounts/evm/toEvmSmartAccount.js.map +1 -1
  7. package/_cjs/actions/evm/fund/Quote.js +63 -0
  8. package/_cjs/actions/evm/fund/Quote.js.map +1 -0
  9. package/_cjs/actions/evm/fund/fund.js +49 -0
  10. package/_cjs/actions/evm/fund/fund.js.map +1 -0
  11. package/_cjs/actions/evm/fund/quoteFund.js +46 -0
  12. package/_cjs/actions/evm/fund/quoteFund.js.map +1 -0
  13. package/_cjs/actions/evm/fund/types.js +3 -0
  14. package/_cjs/actions/evm/fund/types.js.map +1 -0
  15. package/_cjs/actions/evm/fund/waitForFundOperationReceipt.js +64 -0
  16. package/_cjs/actions/evm/fund/waitForFundOperationReceipt.js.map +1 -0
  17. package/_cjs/actions/evm/swap/createSwapQuote.js +126 -0
  18. package/_cjs/actions/evm/swap/createSwapQuote.js.map +1 -0
  19. package/_cjs/actions/evm/swap/getSwapPrice.js +86 -0
  20. package/_cjs/actions/evm/swap/getSwapPrice.js.map +1 -0
  21. package/_cjs/actions/evm/swap/sendSwapTransaction.js +141 -0
  22. package/_cjs/actions/evm/swap/sendSwapTransaction.js.map +1 -0
  23. package/_cjs/actions/evm/swap/types.js +3 -0
  24. package/_cjs/actions/evm/swap/types.js.map +1 -0
  25. package/_cjs/client/evm/evm.js +47 -1
  26. package/_cjs/client/evm/evm.js.map +1 -1
  27. package/_cjs/client/solana/solana.js +4 -1
  28. package/_cjs/client/solana/solana.js.map +1 -1
  29. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +45 -1
  30. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  31. package/_cjs/openapi-client/generated/evm-swaps/evm-swaps.js +26 -0
  32. package/_cjs/openapi-client/generated/evm-swaps/evm-swaps.js.map +1 -0
  33. package/_cjs/openapi-client/generated/evm-swaps/evm-swaps.msw.js +179 -0
  34. package/_cjs/openapi-client/generated/evm-swaps/evm-swaps.msw.js.map +1 -0
  35. package/_cjs/openapi-client/generated/index.msw.js +5 -3
  36. package/_cjs/openapi-client/generated/index.msw.js.map +1 -1
  37. package/_cjs/openapi-client/generated/payments-alpha/payments-alpha.js +50 -0
  38. package/_cjs/openapi-client/generated/payments-alpha/payments-alpha.js.map +1 -0
  39. package/_cjs/openapi-client/generated/payments-alpha/payments-alpha.msw.js +270 -0
  40. package/_cjs/openapi-client/generated/payments-alpha/payments-alpha.msw.js.map +1 -0
  41. package/_cjs/openapi-client/index.js +7 -0
  42. package/_cjs/openapi-client/index.js.map +1 -1
  43. package/_cjs/version.js +1 -1
  44. package/_esm/accounts/evm/toEvmServerAccount.js +32 -0
  45. package/_esm/accounts/evm/toEvmServerAccount.js.map +1 -1
  46. package/_esm/accounts/evm/toEvmSmartAccount.js +18 -0
  47. package/_esm/accounts/evm/toEvmSmartAccount.js.map +1 -1
  48. package/_esm/actions/evm/fund/Quote.js +59 -0
  49. package/_esm/actions/evm/fund/Quote.js.map +1 -0
  50. package/_esm/actions/evm/fund/fund.js +46 -0
  51. package/_esm/actions/evm/fund/fund.js.map +1 -0
  52. package/_esm/actions/evm/fund/quoteFund.js +43 -0
  53. package/_esm/actions/evm/fund/quoteFund.js.map +1 -0
  54. package/_esm/actions/evm/fund/types.js +2 -0
  55. package/_esm/actions/evm/fund/types.js.map +1 -0
  56. package/_esm/actions/evm/fund/waitForFundOperationReceipt.js +61 -0
  57. package/_esm/actions/evm/fund/waitForFundOperationReceipt.js.map +1 -0
  58. package/_esm/actions/evm/swap/createSwapQuote.js +123 -0
  59. package/_esm/actions/evm/swap/createSwapQuote.js.map +1 -0
  60. package/_esm/actions/evm/swap/getSwapPrice.js +83 -0
  61. package/_esm/actions/evm/swap/getSwapPrice.js.map +1 -0
  62. package/_esm/actions/evm/swap/sendSwapTransaction.js +138 -0
  63. package/_esm/actions/evm/swap/sendSwapTransaction.js.map +1 -0
  64. package/_esm/actions/evm/swap/types.js +2 -0
  65. package/_esm/actions/evm/swap/types.js.map +1 -0
  66. package/_esm/client/evm/evm.js +47 -1
  67. package/_esm/client/evm/evm.js.map +1 -1
  68. package/_esm/client/solana/solana.js +4 -1
  69. package/_esm/client/solana/solana.js.map +1 -1
  70. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +44 -0
  71. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  72. package/_esm/openapi-client/generated/evm-swaps/evm-swaps.js +21 -0
  73. package/_esm/openapi-client/generated/evm-swaps/evm-swaps.js.map +1 -0
  74. package/_esm/openapi-client/generated/evm-swaps/evm-swaps.msw.js +167 -0
  75. package/_esm/openapi-client/generated/evm-swaps/evm-swaps.msw.js.map +1 -0
  76. package/_esm/openapi-client/generated/index.msw.js +5 -3
  77. package/_esm/openapi-client/generated/index.msw.js.map +1 -1
  78. package/_esm/openapi-client/generated/payments-alpha/payments-alpha.js +42 -0
  79. package/_esm/openapi-client/generated/payments-alpha/payments-alpha.js.map +1 -0
  80. package/_esm/openapi-client/generated/payments-alpha/payments-alpha.msw.js +250 -0
  81. package/_esm/openapi-client/generated/payments-alpha/payments-alpha.msw.js.map +1 -0
  82. package/_esm/openapi-client/index.js +7 -0
  83. package/_esm/openapi-client/index.js.map +1 -1
  84. package/_esm/version.js +1 -1
  85. package/_types/accounts/evm/toEvmServerAccount.d.ts.map +1 -1
  86. package/_types/accounts/evm/toEvmSmartAccount.d.ts.map +1 -1
  87. package/_types/accounts/evm/types.d.ts +1 -2
  88. package/_types/accounts/evm/types.d.ts.map +1 -1
  89. package/_types/actions/evm/fund/Quote.d.ts +51 -0
  90. package/_types/actions/evm/fund/Quote.d.ts.map +1 -0
  91. package/_types/actions/evm/fund/fund.d.ts +25 -0
  92. package/_types/actions/evm/fund/fund.d.ts.map +1 -0
  93. package/_types/actions/evm/fund/quoteFund.d.ts +25 -0
  94. package/_types/actions/evm/fund/quoteFund.d.ts.map +1 -0
  95. package/_types/actions/evm/fund/types.d.ts +16 -0
  96. package/_types/actions/evm/fund/types.d.ts.map +1 -0
  97. package/_types/actions/evm/fund/waitForFundOperationReceipt.d.ts +68 -0
  98. package/_types/actions/evm/fund/waitForFundOperationReceipt.d.ts.map +1 -0
  99. package/_types/actions/evm/swap/createSwapQuote.d.ts +23 -0
  100. package/_types/actions/evm/swap/createSwapQuote.d.ts.map +1 -0
  101. package/_types/actions/evm/swap/getSwapPrice.d.ts +23 -0
  102. package/_types/actions/evm/swap/getSwapPrice.d.ts.map +1 -0
  103. package/_types/actions/evm/swap/sendSwapTransaction.d.ts +64 -0
  104. package/_types/actions/evm/swap/sendSwapTransaction.d.ts.map +1 -0
  105. package/_types/actions/evm/swap/types.d.ts +80 -0
  106. package/_types/actions/evm/swap/types.d.ts.map +1 -0
  107. package/_types/actions/evm/types.d.ts +151 -0
  108. package/_types/actions/evm/types.d.ts.map +1 -1
  109. package/_types/client/evm/evm.d.ts +39 -1
  110. package/_types/client/evm/evm.d.ts.map +1 -1
  111. package/_types/client/evm/evm.types.d.ts +209 -3
  112. package/_types/client/evm/evm.types.d.ts.map +1 -1
  113. package/_types/client/solana/solana.d.ts.map +1 -1
  114. package/_types/client/solana/solana.types.d.ts +2 -0
  115. package/_types/client/solana/solana.types.d.ts.map +1 -1
  116. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +547 -3
  117. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
  118. package/_types/openapi-client/generated/evm-swaps/evm-swaps.d.ts +24 -0
  119. package/_types/openapi-client/generated/evm-swaps/evm-swaps.d.ts.map +1 -0
  120. package/_types/openapi-client/generated/evm-swaps/evm-swaps.msw.d.ts +12 -0
  121. package/_types/openapi-client/generated/evm-swaps/evm-swaps.msw.d.ts.map +1 -0
  122. package/_types/openapi-client/generated/index.msw.d.ts +5 -3
  123. package/_types/openapi-client/generated/index.msw.d.ts.map +1 -1
  124. package/_types/openapi-client/generated/payments-alpha/payments-alpha.d.ts +42 -0
  125. package/_types/openapi-client/generated/payments-alpha/payments-alpha.d.ts.map +1 -0
  126. package/_types/openapi-client/generated/payments-alpha/payments-alpha.msw.d.ts +20 -0
  127. package/_types/openapi-client/generated/payments-alpha/payments-alpha.msw.d.ts.map +1 -0
  128. package/_types/openapi-client/index.d.ts +11 -0
  129. package/_types/openapi-client/index.d.ts.map +1 -1
  130. package/_types/types/misc.d.ts +2 -2
  131. package/_types/types/misc.d.ts.map +1 -1
  132. package/_types/version.d.ts +1 -1
  133. package/accounts/evm/toEvmServerAccount.ts +47 -0
  134. package/accounts/evm/toEvmSmartAccount.ts +26 -0
  135. package/accounts/evm/types.ts +1 -2
  136. package/actions/evm/fund/Quote.ts +83 -0
  137. package/actions/evm/fund/fund.ts +76 -0
  138. package/actions/evm/fund/quoteFund.ts +81 -0
  139. package/actions/evm/fund/types.ts +16 -0
  140. package/actions/evm/fund/waitForFundOperationReceipt.ts +118 -0
  141. package/actions/evm/swap/createSwapQuote.ts +148 -0
  142. package/actions/evm/swap/getSwapPrice.ts +95 -0
  143. package/actions/evm/swap/sendSwapTransaction.ts +173 -0
  144. package/actions/evm/swap/types.ts +94 -0
  145. package/actions/evm/types.ts +161 -0
  146. package/client/evm/evm.ts +59 -1
  147. package/client/evm/evm.types.ts +227 -1
  148. package/client/solana/solana.ts +4 -1
  149. package/client/solana/solana.types.ts +2 -0
  150. package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +617 -3
  151. package/openapi-client/generated/evm-swaps/evm-swaps.msw.ts +217 -0
  152. package/openapi-client/generated/evm-swaps/evm-swaps.ts +51 -0
  153. package/openapi-client/generated/index.msw.ts +5 -3
  154. package/openapi-client/generated/payments-alpha/payments-alpha.msw.ts +369 -0
  155. package/openapi-client/generated/payments-alpha/payments-alpha.ts +96 -0
  156. package/openapi-client/index.ts +7 -0
  157. package/package.json +1 -1
  158. package/types/misc.ts +2 -2
  159. package/version.ts +1 -1
@@ -192,6 +192,281 @@ export interface EvmUserOperation {
192
192
  transactionHash?: string;
193
193
  }
194
194
 
195
+ /**
196
+ * The network on which to perform the swap.
197
+ */
198
+ export type EvmSwapsNetwork = (typeof EvmSwapsNetwork)[keyof typeof EvmSwapsNetwork];
199
+
200
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
201
+ export const EvmSwapsNetwork = {
202
+ base: "base",
203
+ ethereum: "ethereum",
204
+ } as const;
205
+
206
+ /**
207
+ * The 0x-prefixed contract address of the token to receive.
208
+ * @pattern ^0x[a-fA-F0-9]{40}$
209
+ */
210
+ export type ToToken = string;
211
+
212
+ /**
213
+ * The 0x-prefixed contract address of the token to send.
214
+ * @pattern ^0x[a-fA-F0-9]{40}$
215
+ */
216
+ export type FromToken = string;
217
+
218
+ /**
219
+ * The amount of the `fromToken` to send in atomic units of the token. For example, `1000000000000000000` when sending ETH equates to 1 ETH, `1000000` when sending USDC equates to 1 USDC, etc.
220
+ * @pattern ^\d+$
221
+ */
222
+ export type FromAmount = string;
223
+
224
+ /**
225
+ * The 0x-prefixed address that holds the `fromToken` balance and has the `Permit2` allowance set for the swap.
226
+ * @pattern ^0x[a-fA-F0-9]{40}$
227
+ */
228
+ export type Taker = string;
229
+
230
+ /**
231
+ * The 0x-prefixed Externally Owned Account (EOA) address that will sign the `Permit2` EIP-712 permit message. This is only needed if `taker` is a smart contract.
232
+ * @pattern ^0x[a-fA-F0-9]{40}$
233
+ */
234
+ export type SignerAddress = string;
235
+
236
+ /**
237
+ * The target gas price for the swap transaction, in Wei. For EIP-1559 transactions, this value should be seen as the `maxFeePerGas` value. If not provided, the API will use an estimate based on the current network conditions.
238
+ * @pattern ^\d+$
239
+ */
240
+ export type GasPrice = string;
241
+
242
+ /**
243
+ * The maximum acceptable slippage of the `toToken` in basis points. If this parameter is set to 0, no slippage will be tolerated. If not provided, the default slippage tolerance is 100 bps (i.e., 1%).
244
+ * @minimum 0
245
+ * @maximum 10000
246
+ */
247
+ export type SlippageBps = number;
248
+
249
+ export interface TokenFee {
250
+ /**
251
+ * The estimated amount of the fee in atomic units of the `token`. For example, `1000000000000000` if the fee is in ETH equates to 0.001 ETH, `10000` if the fee is in USDC equates to 0.01 USDC, etc.
252
+ * @pattern ^\d+$
253
+ */
254
+ amount: string;
255
+ /**
256
+ * The contract address of the token that the fee is paid in. The address `0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE` is used for the native token of the network (e.g. ETH).
257
+ * @pattern ^0x[a-fA-F0-9]{40}$
258
+ */
259
+ token: string;
260
+ }
261
+
262
+ /**
263
+ * The estimated gas fee for the swap.
264
+ * @nullable
265
+ */
266
+ export type CommonSwapResponseFeesGasFee = TokenFee | null;
267
+
268
+ /**
269
+ * The estimated protocol fee for the swap.
270
+ * @nullable
271
+ */
272
+ export type CommonSwapResponseFeesProtocolFee = TokenFee | null;
273
+
274
+ /**
275
+ * The estimated fees for the swap.
276
+ */
277
+ export type CommonSwapResponseFees = {
278
+ /**
279
+ * The estimated gas fee for the swap.
280
+ * @nullable
281
+ */
282
+ gasFee: CommonSwapResponseFeesGasFee;
283
+ /**
284
+ * The estimated protocol fee for the swap.
285
+ * @nullable
286
+ */
287
+ protocolFee: CommonSwapResponseFeesProtocolFee;
288
+ };
289
+
290
+ /**
291
+ * Details of the allowances that the taker must set in order to execute the swap successfully. Null if no allowance is required.
292
+ * @nullable
293
+ */
294
+ export type CommonSwapResponseIssuesAllowance = {
295
+ /**
296
+ * The current allowance of the `fromToken` by the `taker`.
297
+ * @pattern ^\d+$
298
+ */
299
+ currentAllowance: string;
300
+ /**
301
+ * The 0x-prefixed address of to set the allowance on.
302
+ * @pattern ^0x[a-fA-F0-9]{40}$
303
+ */
304
+ spender: string;
305
+ } | null;
306
+
307
+ /**
308
+ * Details of the balance of the `fromToken` that the `taker` must hold. Null if the `taker` has a sufficient balance.
309
+ * @nullable
310
+ */
311
+ export type CommonSwapResponseIssuesBalance = {
312
+ /**
313
+ * The 0x-prefixed contract address of the token.
314
+ * @pattern ^0x[a-fA-F0-9]{40}$
315
+ */
316
+ token: string;
317
+ /**
318
+ * The current balance of the `fromToken` by the `taker`.
319
+ * @pattern ^\d+$
320
+ */
321
+ currentBalance: string;
322
+ /**
323
+ * The amount of the token that the `taker` must hold.
324
+ * @pattern ^\d+$
325
+ */
326
+ requiredBalance: string;
327
+ } | null;
328
+
329
+ /**
330
+ * An object containing potential issues discovered during validation that could prevent the swap from being executed successfully.
331
+ */
332
+ export type CommonSwapResponseIssues = {
333
+ /**
334
+ * Details of the allowances that the taker must set in order to execute the swap successfully. Null if no allowance is required.
335
+ * @nullable
336
+ */
337
+ allowance: CommonSwapResponseIssuesAllowance;
338
+ /**
339
+ * Details of the balance of the `fromToken` that the `taker` must hold. Null if the `taker` has a sufficient balance.
340
+ * @nullable
341
+ */
342
+ balance: CommonSwapResponseIssuesBalance;
343
+ /** This is set to true when the transaction cannot be validated. This can happen when the taker has an insufficient balance of the `fromToken`. Note that this does not necessarily mean that the trade will revert. */
344
+ simulationIncomplete: boolean;
345
+ };
346
+
347
+ export interface CommonSwapResponse {
348
+ /**
349
+ * The block number at which the liquidity conditions were examined.
350
+ * @pattern ^[1-9]\d*$
351
+ */
352
+ blockNumber: string;
353
+ /**
354
+ * The amount of the `toToken` that will be received in atomic units of the `toToken`. For example, `1000000000000000000` when receiving ETH equates to 1 ETH, `1000000` when receiving USDC equates to 1 USDC, etc.
355
+ * @pattern ^(0|[1-9]\d*)$
356
+ */
357
+ toAmount: string;
358
+ /**
359
+ * The 0x-prefixed contract address of the token that will be received.
360
+ * @pattern ^0x[a-fA-F0-9]{40}$
361
+ */
362
+ toToken: string;
363
+ /** The estimated fees for the swap. */
364
+ fees: CommonSwapResponseFees;
365
+ /** An object containing potential issues discovered during validation that could prevent the swap from being executed successfully. */
366
+ issues: CommonSwapResponseIssues;
367
+ /** Whether sufficient liquidity is available to settle the swap. All other fields in the response will be empty if this is false. */
368
+ liquidityAvailable: boolean;
369
+ /**
370
+ * The minimum amount of the `toToken` that must be received for the swap to succeed, in atomic units of the `toToken`. For example, `1000000000000000000` when receiving ETH equates to 1 ETH, `1000000` when receiving USDC equates to 1 USDC, etc. This value is influenced by the `slippageBps` parameter.
371
+ * @pattern ^(0|[1-9]\d*)$
372
+ */
373
+ minToAmount: string;
374
+ /**
375
+ * The amount of the `fromToken` that will be sent in this swap, in atomic units of the `fromToken`. For example, `1000000000000000000` when sending ETH equates to 1 ETH, `1000000` when sending USDC equates to 1 USDC, etc.
376
+ * @pattern ^(0|[1-9]\d*)$
377
+ */
378
+ fromAmount: string;
379
+ /**
380
+ * The 0x-prefixed contract address of the token that will be sent.
381
+ * @pattern ^0x[a-fA-F0-9]{40}$
382
+ */
383
+ fromToken: string;
384
+ }
385
+
386
+ export type GetSwapPriceResponseAllOf = {
387
+ /**
388
+ * The estimated gas limit that should be used to send the transaction to guarantee settlement.
389
+ * @nullable
390
+ * @pattern ^\d+$
391
+ */
392
+ gas: string | null;
393
+ /**
394
+ * The gas price, in Wei, that should be used to send the transaction. For EIP-1559 transactions, this value should be seen as the `maxFeePerGas` value. The transaction should be sent with this gas price to guarantee settlement.
395
+ * @pattern ^\d+$
396
+ */
397
+ gasPrice: string;
398
+ };
399
+
400
+ export type GetSwapPriceResponse = CommonSwapResponse & GetSwapPriceResponseAllOf;
401
+
402
+ export interface SwapUnavailableResponse {
403
+ /** Whether sufficient liquidity is available to settle the swap. All other fields in the response will be empty if this is false. */
404
+ liquidityAvailable: boolean;
405
+ }
406
+
407
+ /**
408
+ * A wrapper for the response of a swap price operation.
409
+ */
410
+ export type GetSwapPriceResponseWrapper = GetSwapPriceResponse | SwapUnavailableResponse;
411
+
412
+ /**
413
+ * The approval object which contains the necessary fields to submit an approval for this transaction. Null if the `fromToken` is the native token or the transaction is a native token wrap / unwrap.
414
+ * @nullable
415
+ */
416
+ export type CreateSwapQuoteResponseAllOfPermit2 = {
417
+ /**
418
+ * The hash for the approval according to [EIP-712](https://eips.ethereum.org/EIPS/eip-712). Computing the hash of the `eip712` field should match the value of this field.
419
+ * @pattern ^0x[a-fA-F0-9]{64}$
420
+ */
421
+ hash: string;
422
+ eip712: EIP712Message;
423
+ } | null;
424
+
425
+ /**
426
+ * The details of the transaction to be signed and submitted to execute the swap.
427
+ */
428
+ export type CreateSwapQuoteResponseAllOfTransaction = {
429
+ /**
430
+ * The 0x-prefixed address of the contract to call.
431
+ * @pattern ^0x[a-fA-F0-9]{40}$
432
+ */
433
+ to: string;
434
+ /** The hex-encoded call data to send to the contract. */
435
+ data: string;
436
+ /**
437
+ * The estimated gas limit that should be used to send the transaction to guarantee settlement.
438
+ * @pattern ^\d+$
439
+ */
440
+ gas: string;
441
+ /**
442
+ * The gas price, in Wei, that should be used to send the transaction. For EIP-1559 transactions, this value should be seen as the `maxFeePerGas` value. The transaction should be sent with this gas price to guarantee settlement.
443
+ * @pattern ^\d+$
444
+ */
445
+ gasPrice: string;
446
+ /**
447
+ * The value of the transaction in Wei.
448
+ * @pattern ^\d+$
449
+ */
450
+ value: string;
451
+ };
452
+
453
+ export type CreateSwapQuoteResponseAllOf = {
454
+ /**
455
+ * The approval object which contains the necessary fields to submit an approval for this transaction. Null if the `fromToken` is the native token or the transaction is a native token wrap / unwrap.
456
+ * @nullable
457
+ */
458
+ permit2: CreateSwapQuoteResponseAllOfPermit2;
459
+ /** The details of the transaction to be signed and submitted to execute the swap. */
460
+ transaction: CreateSwapQuoteResponseAllOfTransaction;
461
+ };
462
+
463
+ export type CreateSwapQuoteResponse = CreateSwapQuoteResponseAllOf & CommonSwapResponse;
464
+
465
+ /**
466
+ * A wrapper for the response of a swap quote operation.
467
+ */
468
+ export type CreateSwapQuoteResponseWrapper = CreateSwapQuoteResponse | SwapUnavailableResponse;
469
+
195
470
  /**
196
471
  * The name of the supported EVM networks in human-readable format.
197
472
  */
@@ -329,7 +604,7 @@ export interface EvmAddressCriterion {
329
604
  export type SignEvmTransactionCriteriaItem = EthValueCriterion | EvmAddressCriterion;
330
605
 
331
606
  /**
332
- * A schema for specifying the rejection criteria for the SignEvmTransaction operation.
607
+ * A schema for specifying criteria for the SignEvmTransaction operation.
333
608
  */
334
609
  export type SignEvmTransactionCriteria = SignEvmTransactionCriteriaItem[];
335
610
 
@@ -417,7 +692,7 @@ export type SendEvmTransactionCriteriaItem =
417
692
  | EvmNetworkCriterion;
418
693
 
419
694
  /**
420
- * A schema for specifying the rejection criteria for the SignEvmTransaction operation.
695
+ * A schema for specifying criteria for the SignEvmTransaction operation.
421
696
  */
422
697
  export type SendEvmTransactionCriteria = SendEvmTransactionCriteriaItem[];
423
698
 
@@ -488,7 +763,7 @@ export interface SolAddressCriterion {
488
763
  }
489
764
 
490
765
  /**
491
- * A schema for specifying the rejection criteria for the SignSolTransaction operation.
766
+ * A schema for specifying criteria for the SignSolTransaction operation.
492
767
  */
493
768
  export type SignSolTransactionCriteria = SolAddressCriterion[];
494
769
 
@@ -578,6 +853,236 @@ Account names are guaranteed to be unique across all Solana accounts in the deve
578
853
  policies?: string[];
579
854
  }
580
855
 
856
+ /**
857
+ * The action of the payment method.
858
+ */
859
+ export type PaymentRailAction = (typeof PaymentRailAction)[keyof typeof PaymentRailAction];
860
+
861
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
862
+ export const PaymentRailAction = {
863
+ source: "source",
864
+ target: "target",
865
+ } as const;
866
+
867
+ /**
868
+ * The type of payment method.
869
+ */
870
+ export type PaymentMethodType = (typeof PaymentMethodType)[keyof typeof PaymentMethodType];
871
+
872
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
873
+ export const PaymentMethodType = {
874
+ card: "card",
875
+ fiat_account: "fiat_account",
876
+ } as const;
877
+
878
+ /**
879
+ * The limit for this payment method being used as a source for transfers.
880
+ */
881
+ export type PaymentMethodLimitsSourceLimit = {
882
+ /** The amount of the limit. */
883
+ amount?: string;
884
+ /** The currency of the limit. */
885
+ currency?: string;
886
+ };
887
+
888
+ /**
889
+ * The limit for this payment method being used as a target for transfers.
890
+ */
891
+ export type PaymentMethodLimitsTargetLimit = {
892
+ /** The amount of the limit. */
893
+ amount?: string;
894
+ /** The currency of the limit. */
895
+ currency?: string;
896
+ };
897
+
898
+ /**
899
+ * The limits of the payment method.
900
+ */
901
+ export type PaymentMethodLimits = {
902
+ /** The limit for this payment method being used as a source for transfers. */
903
+ sourceLimit?: PaymentMethodLimitsSourceLimit;
904
+ /** The limit for this payment method being used as a target for transfers. */
905
+ targetLimit?: PaymentMethodLimitsTargetLimit;
906
+ };
907
+
908
+ /**
909
+ * The fiat payment method object.
910
+ */
911
+ export interface PaymentMethod {
912
+ /**
913
+ * The ID of the payment method which previously was added.
914
+ * @pattern ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
915
+ */
916
+ id: string;
917
+ /** The type of payment method. */
918
+ type: PaymentMethodType;
919
+ /** The currency of the payment method. */
920
+ currency: string;
921
+ /** The actions for the payment method. */
922
+ actions: PaymentRailAction[];
923
+ /** The limits of the payment method. */
924
+ limits?: PaymentMethodLimits;
925
+ }
926
+
927
+ /**
928
+ * The networks of the asset.
929
+ */
930
+ export type CryptoRailNetworksItem = {
931
+ /** The name of the network. */
932
+ name?: string;
933
+ /** The chain ID of the network. */
934
+ chainId?: number;
935
+ /** The contract address of the asset on the network. */
936
+ contractAddress?: string;
937
+ };
938
+
939
+ /**
940
+ * The crypto rails available.
941
+ */
942
+ export interface CryptoRail {
943
+ /** The currency symbol of the asset. */
944
+ currency: string;
945
+ /** The name of the asset. */
946
+ name: string;
947
+ /** All available networks of the asset. */
948
+ networks: CryptoRailNetworksItem[];
949
+ /** The actions for the crypto rail. */
950
+ actions: PaymentRailAction[];
951
+ }
952
+
953
+ /**
954
+ * The fiat payment method request object.
955
+ */
956
+ export interface PaymentMethodRequest {
957
+ /**
958
+ * The ID of the payment method.
959
+ * @pattern ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
960
+ */
961
+ id: string;
962
+ }
963
+
964
+ /**
965
+ * The source of the transfer.
966
+ */
967
+ export type TransferSource = PaymentMethodRequest;
968
+
969
+ /**
970
+ * The crypto rail input object which specifies the symbol, network, and address which is the source or destination wallet address.
971
+ */
972
+ export interface CryptoRailAddress {
973
+ /** The symbol of the currency of the payment rail. */
974
+ currency: string;
975
+ /** The network of the payment rail. */
976
+ network: string;
977
+ /** The address of the payment rail. This is the source or destination wallet address. It is not a contract address. */
978
+ address: string;
979
+ }
980
+
981
+ /**
982
+ * The target of the transfer.
983
+ */
984
+ export type TransferTarget = CryptoRailAddress;
985
+
986
+ /**
987
+ * The type of fee.
988
+ */
989
+ export type FeeType = (typeof FeeType)[keyof typeof FeeType];
990
+
991
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
992
+ export const FeeType = {
993
+ exchange_fee: "exchange_fee",
994
+ network_fee: "network_fee",
995
+ } as const;
996
+
997
+ /**
998
+ * The fee for the transfer.
999
+ */
1000
+ export interface Fee {
1001
+ /** The type of fee. */
1002
+ type: FeeType;
1003
+ /** The amount of the fee. */
1004
+ amount: string;
1005
+ /** The currency of the fee. */
1006
+ currency: string;
1007
+ /** The description of the fee. */
1008
+ description?: string;
1009
+ }
1010
+
1011
+ /**
1012
+ * The type of the source of the transfer.
1013
+ */
1014
+ export type TransferSourceType = (typeof TransferSourceType)[keyof typeof TransferSourceType];
1015
+
1016
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
1017
+ export const TransferSourceType = {
1018
+ payment_method: "payment_method",
1019
+ } as const;
1020
+
1021
+ /**
1022
+ * The type of the target of the transfer.
1023
+ */
1024
+ export type TransferTargetType = (typeof TransferTargetType)[keyof typeof TransferTargetType];
1025
+
1026
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
1027
+ export const TransferTargetType = {
1028
+ crypto_rail: "crypto_rail",
1029
+ } as const;
1030
+
1031
+ /**
1032
+ * The status of the transfer.
1033
+ */
1034
+ export type TransferStatus = (typeof TransferStatus)[keyof typeof TransferStatus];
1035
+
1036
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
1037
+ export const TransferStatus = {
1038
+ created: "created",
1039
+ pending: "pending",
1040
+ started: "started",
1041
+ completed: "completed",
1042
+ failed: "failed",
1043
+ } as const;
1044
+
1045
+ /**
1046
+ * The transfer object.
1047
+ */
1048
+ export interface Transfer {
1049
+ /**
1050
+ * The ID of the transfer.
1051
+ * @pattern ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
1052
+ */
1053
+ id: string;
1054
+ /** The type of the source of the transfer. */
1055
+ sourceType: TransferSourceType;
1056
+ /** The source of the transfer. */
1057
+ source: PaymentMethodRequest;
1058
+ /** The type of the target of the transfer. */
1059
+ targetType: TransferTargetType;
1060
+ /** The target of the transfer. */
1061
+ target: CryptoRailAddress;
1062
+ /** The amount the source will transfer. */
1063
+ sourceAmount: string;
1064
+ /** The currency the source will transfer. */
1065
+ sourceCurrency: string;
1066
+ /** The amount the target will receive. */
1067
+ targetAmount: string;
1068
+ /** The currency the target will receive. */
1069
+ targetCurrency: string;
1070
+ /** The amount the customer put in to transfer. */
1071
+ userAmount: string;
1072
+ /** The currency the customer put in to transfer. */
1073
+ userCurrency: string;
1074
+ /** The fees for the transfer. */
1075
+ fees: Fee[];
1076
+ /** The status of the transfer. */
1077
+ status: TransferStatus;
1078
+ /** The UTC date and time in ISO 8601 format the transfer was created. */
1079
+ createdAt: string;
1080
+ /** The UTC date and time in ISO 8601 format the transfer was updated. */
1081
+ updatedAt: string;
1082
+ /** The transaction hash or transaction signature of the transfer. */
1083
+ transactionHash?: string;
1084
+ }
1085
+
581
1086
  /**
582
1087
  * Internal server error.
583
1088
  */
@@ -645,6 +1150,11 @@ Account names must be unique across all EVM accounts in the developer's CDP Proj
645
1150
  * @pattern ^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$
646
1151
  */
647
1152
  name?: string;
1153
+ /**
1154
+ * The ID of the account-level policy to apply to the account.
1155
+ * @pattern ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
1156
+ */
1157
+ accountPolicy?: string;
648
1158
  };
649
1159
 
650
1160
  export type UpdateEvmAccountBody = {
@@ -782,6 +1292,57 @@ export type SendUserOperationBody = {
782
1292
  signature: string;
783
1293
  };
784
1294
 
1295
+ export type GetEvmSwapPriceParams = {
1296
+ network: EvmSwapsNetwork;
1297
+ toToken: ToToken;
1298
+ fromToken: FromToken;
1299
+ fromAmount: FromAmount;
1300
+ taker: Taker;
1301
+ signerAddress?: SignerAddress;
1302
+ gasPrice?: GasPrice;
1303
+ slippageBps?: SlippageBps;
1304
+ };
1305
+
1306
+ export type CreateEvmSwapQuoteBody = {
1307
+ network: EvmSwapsNetwork;
1308
+ /**
1309
+ * The 0x-prefixed contract address of the token to receive.
1310
+ * @pattern ^0x[a-fA-F0-9]{40}$
1311
+ */
1312
+ toToken: string;
1313
+ /**
1314
+ * The 0x-prefixed contract address of the token to send.
1315
+ * @pattern ^0x[a-fA-F0-9]{40}$
1316
+ */
1317
+ fromToken: string;
1318
+ /**
1319
+ * The amount of the `fromToken` to send in atomic units of the token. For example, `1000000000000000000` when sending ETH equates to 1 ETH, `1000000` when sending USDC equates to 1 USDC, etc.
1320
+ * @pattern ^\d+$
1321
+ */
1322
+ fromAmount: string;
1323
+ /**
1324
+ * The 0x-prefixed address that holds the `fromToken` balance and has the `Permit2` allowance set for the swap.
1325
+ * @pattern ^0x[a-fA-F0-9]{40}$
1326
+ */
1327
+ taker: string;
1328
+ /**
1329
+ * The 0x-prefixed Externally Owned Account (EOA) address that will sign the `Permit2` EIP-712 permit message. This is only needed if `taker` is a smart contract.
1330
+ * @pattern ^0x[a-fA-F0-9]{40}$
1331
+ */
1332
+ signerAddress?: string;
1333
+ /**
1334
+ * The target gas price for the swap transaction, in Wei. For EIP-1559 transactions, this value should be seen as the `maxFeePerGas` value. If not provided, the API will use an estimate based on the current network conditions.
1335
+ * @pattern ^\d+$
1336
+ */
1337
+ gasPrice?: string;
1338
+ /**
1339
+ * The maximum acceptable slippage of the `toToken` in basis points. If this parameter is set to 0, no slippage will be tolerated. If not provided, the default slippage tolerance is 100 bps (i.e., 1%).
1340
+ * @minimum 0
1341
+ * @maximum 10000
1342
+ */
1343
+ slippageBps?: number;
1344
+ };
1345
+
785
1346
  export type ListEvmTokenBalancesParams = {
786
1347
  /**
787
1348
  * The number of balances to return per page.
@@ -936,6 +1497,11 @@ Account names must be unique across all Solana accounts in the developer's CDP P
936
1497
  * @pattern ^[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$
937
1498
  */
938
1499
  name?: string;
1500
+ /**
1501
+ * The ID of the account-level policy to apply to the account.
1502
+ * @pattern ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
1503
+ */
1504
+ accountPolicy?: string;
939
1505
  };
940
1506
 
941
1507
  export type UpdateSolanaAccountBody = {
@@ -998,3 +1564,51 @@ export type RequestSolanaFaucet200 = {
998
1564
  /** The signature identifying the transaction that requested the funds. */
999
1565
  transactionSignature: string;
1000
1566
  };
1567
+
1568
+ export type GetCryptoRailsParams = {
1569
+ /**
1570
+ * Comma separated list of networks to filter the rails by.
1571
+ */
1572
+ networks?: string;
1573
+ };
1574
+
1575
+ /**
1576
+ * The type of the source of the transfer.
1577
+ */
1578
+ export type CreatePaymentTransferQuoteBodySourceType =
1579
+ (typeof CreatePaymentTransferQuoteBodySourceType)[keyof typeof CreatePaymentTransferQuoteBodySourceType];
1580
+
1581
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
1582
+ export const CreatePaymentTransferQuoteBodySourceType = {
1583
+ payment_method: "payment_method",
1584
+ } as const;
1585
+
1586
+ /**
1587
+ * The type of the target of the transfer.
1588
+ */
1589
+ export type CreatePaymentTransferQuoteBodyTargetType =
1590
+ (typeof CreatePaymentTransferQuoteBodyTargetType)[keyof typeof CreatePaymentTransferQuoteBodyTargetType];
1591
+
1592
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
1593
+ export const CreatePaymentTransferQuoteBodyTargetType = {
1594
+ crypto_rail: "crypto_rail",
1595
+ } as const;
1596
+
1597
+ export type CreatePaymentTransferQuoteBody = {
1598
+ /** The type of the source of the transfer. */
1599
+ sourceType: CreatePaymentTransferQuoteBodySourceType;
1600
+ source: TransferSource;
1601
+ /** The type of the target of the transfer. */
1602
+ targetType: CreatePaymentTransferQuoteBodyTargetType;
1603
+ target: TransferTarget;
1604
+ /** The amount of the transfer, which is either for the source currency to buy, or the target currency to receive. */
1605
+ amount: string;
1606
+ /** The currency of the transfer. This can be specified as the source currency, which would be used to buy, or else the target currency, which is how much will be received. */
1607
+ currency: string;
1608
+ /** Whether to execute the transfer. If true, the transfer will be committed and executed. If false, the quote will be generated and returned. */
1609
+ execute?: boolean;
1610
+ };
1611
+
1612
+ export type CreatePaymentTransferQuote201 = {
1613
+ transfer: Transfer;
1614
+ };