@coinbase/cdp-api-client 0.0.124 → 0.0.125

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.
@@ -3,17 +3,17 @@ import { AxiosRequestConfig } from 'axios';
3
3
  /**
4
4
  * A request to adjust an existing borrow position for an end user's smart account on the specified borrow product.
5
5
  The request can supply collateral, withdraw collateral, repay debt, and/or borrow more of the loan asset, broadcasting a user operation to apply the changes onchain.
6
- A single request cannot combine supplying and withdrawing collateral, or repaying debt and borrowing more debt.
6
+ A single request must not combine `addCollateralAmount` with `removeCollateralAmount` or `repayLoanAmount`, and must not combine `borrowLoanAmount` with `repayLoanAmount` or `removeCollateralAmount`. Otherwise any subset of the four amount fields may be supplied; at least one is required.
7
7
  */
8
8
  export declare interface AdjustBorrowPositionRequest {
9
9
  borrowProductId: BorrowProductId;
10
- /** The amount of collateral to add to the position, as a decimal string in standard unit denomination (i.e. "1" for 1 cbBTC). Must not be combined with `removeCollateralAmount`. */
10
+ /** The amount of collateral to add to the position, as a decimal string in standard unit denomination of the collateral token (i.e. "1" for 1 cbBTC). Must not be combined with `removeCollateralAmount` or `repayLoanAmount`. */
11
11
  addCollateralAmount?: PositiveDecimal;
12
- /** The amount of collateral to withdraw from the position, as a decimal string in standard unit denomination (i.e. "1" for 1 cbBTC). Must not be combined with `addCollateralAmount`. */
12
+ /** The amount of collateral to withdraw from the position, as a decimal string in standard unit denomination of the collateral token (i.e. "1" for 1 cbBTC). Must not be combined with `addCollateralAmount` or `borrowLoanAmount`. */
13
13
  removeCollateralAmount?: PositiveDecimal;
14
- /** The amount of the loan token to repay, as a decimal string in standard unit denomination of the loan token (i.e. "100" for 100 USDC). Must not be combined with `borrowLoanAmount`. */
14
+ /** The amount of the loan token to repay, as a decimal string in standard unit denomination of the loan token (i.e. "100" for 100 USDC). Must not be combined with `borrowLoanAmount` or `addCollateralAmount`. */
15
15
  repayLoanAmount?: PositiveDecimal;
16
- /** The amount of the loan token to borrow, as a decimal string in standard unit denomination of the loan token (i.e. "100" for 100 USDC). Must not be combined with `repayLoanAmount`. */
16
+ /** The amount of the loan token to borrow, as a decimal string in standard unit denomination of the loan token (i.e. "100" for 100 USDC). Must not be combined with `repayLoanAmount` or `removeCollateralAmount`. */
17
17
  borrowLoanAmount?: PositiveDecimal;
18
18
  /**
19
19
  * The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth header.
@@ -32,7 +32,7 @@ export declare interface AdjustBorrowPositionRequest {
32
32
  /**
33
33
  * Adjusts an existing borrow position for a specific borrow product by supplying collateral, withdrawing collateral, repaying debt, and/or borrowing more of the loan asset from an end user smart account.
34
34
  The `borrowProductId` identifies the product whose position to adjust, and the `addCollateralAmount`, `removeCollateralAmount`, `repayLoanAmount`, and `borrowLoanAmount` fields specify the changes to apply, each expressed as a decimal string in standard unit denomination of the respective token.
35
- A single request cannot combine supplying and withdrawing collateral, or repaying debt and borrowing more debt.
35
+ A single request must not combine `addCollateralAmount` with `removeCollateralAmount` or `repayLoanAmount`, and must not combine `borrowLoanAmount` with `repayLoanAmount` or `removeCollateralAmount`. Otherwise any subset of the four amount fields may be supplied; at least one is required.
36
36
  A user operation is broadcast to adjust the position onchain. Poll `getUserOperationWithEndUserAccount` with the returned `userOpHash` until it reaches a terminal state. Once the user operation succeeds onchain, use the borrow positions list endpoint to view the user's adjusted positions.
37
37
  * @summary Adjust a borrow position for an end user smart account
38
38
  */
@@ -80,6 +80,12 @@ export declare class APIError extends Error {
80
80
  errorMessage: string;
81
81
  correlationId?: string;
82
82
  errorLink?: string;
83
+ /**
84
+ * Response headers, lowercase-keyed (e.g. `x-mfa-challenge-id`). Never included in
85
+ * {@link toJSON}. Multi-value headers (e.g. `set-cookie`) come back as arrays; callers
86
+ * must guard with `Array.isArray` before treating a value as a string.
87
+ */
88
+ headers?: Record<string, string | string[]>;
83
89
  /**
84
90
  * Constructor for the APIError class
85
91
  *
@@ -89,8 +95,9 @@ export declare class APIError extends Error {
89
95
  * @param correlationId - The correlation ID
90
96
  * @param errorLink - URL to documentation about this error
91
97
  * @param cause - The cause of the error
98
+ * @param headers - The response headers, lowercase-keyed
92
99
  */
93
- constructor(statusCode: number, errorType: APIErrorType, errorMessage: string, correlationId?: string, errorLink?: string, cause?: Error);
100
+ constructor(statusCode: number, errorType: APIErrorType, errorMessage: string, correlationId?: string, errorLink?: string, cause?: Error, headers?: Record<string, string | string[]>);
94
101
  /**
95
102
  * Convert the error to a JSON object, excluding undefined properties
96
103
  *
@@ -420,14 +427,14 @@ export declare interface BorrowProductVenue {
420
427
  export declare type CapabilityName = (typeof CapabilityName)[keyof typeof CapabilityName];
421
428
 
422
429
  export declare const CapabilityName: {
423
- readonly custodyCrypto: "custodyCrypto";
424
- readonly custodyFiat: "custodyFiat";
425
- readonly custodyStablecoin: "custodyStablecoin";
426
- readonly tradeCrypto: "tradeCrypto";
427
- readonly tradeStablecoin: "tradeStablecoin";
428
- readonly transferCrypto: "transferCrypto";
429
- readonly transferFiat: "transferFiat";
430
- readonly transferStablecoin: "transferStablecoin";
430
+ readonly CustodyCrypto: "custodyCrypto";
431
+ readonly CustodyFiat: "custodyFiat";
432
+ readonly CustodyStablecoin: "custodyStablecoin";
433
+ readonly TradeCrypto: "tradeCrypto";
434
+ readonly TradeStablecoin: "tradeStablecoin";
435
+ readonly TransferCrypto: "transferCrypto";
436
+ readonly TransferFiat: "transferFiat";
437
+ readonly TransferStablecoin: "transferStablecoin";
431
438
  };
432
439
 
433
440
  /**
@@ -435,11 +442,26 @@ export declare const CapabilityName: {
435
442
  * to the request headers.
436
443
  *
437
444
  * @param {AxiosRequestConfig} config - The Axios request configuration.
438
- * @param idempotencyKey - The idempotency key.
445
+ * @param options - Per-request options, or a bare idempotency key string (legacy form).
439
446
  * @returns {Promise<T>} A promise that resolves to the response data.
440
447
  * @throws {APIError} If the request fails.
441
448
  */
442
- declare const cdpApiClient: <T>(config: AxiosRequestConfig, idempotencyKey?: string) => Promise<T>;
449
+ declare const cdpApiClient: <T>(config: AxiosRequestConfig, options?: CdpApiClientOptions | string) => Promise<T>;
450
+
451
+ /**
452
+ * Per-request options accepted as the second parameter of {@link cdpApiClient}
453
+ * (the `options` argument of every generated operation).
454
+ */
455
+ export declare type CdpApiClientOptions = {
456
+ /** Idempotency key for safe retries, sent as the X-Idempotency-Key header. */
457
+ idempotencyKey?: string;
458
+ /**
459
+ * Opaque per-request MFA challenge handle, sent as the X-Mfa-Challenge-Id
460
+ * header on the MFA initiate and submit endpoints when the project's
461
+ * `verificationScope` is `request`.
462
+ */
463
+ mfaChallengeId?: string;
464
+ };
443
465
 
444
466
  /**
445
467
  * The options for the CDP API Client.
@@ -1298,7 +1320,7 @@ export declare interface EndUserBtcAccount {
1298
1320
  addressType: EndUserBtcAccountAddressType;
1299
1321
  /** The Bitcoin network this account is associated with. */
1300
1322
  network: EndUserBtcAccountNetwork;
1301
- /** The BIP-32 extended public key (xpub) at the account derivation path, base58check encoded, used to derive child addresses. Present only when the response includes it explicitly (the `createEndUserBtcAccount` response, or `getAuthenticatedEndUser` with `includeBtcXpubs=true`); otherwise omitted. */
1323
+ /** The BIP-32 extended public key (xpub) at the account derivation path, base58check encoded, used to derive child addresses. Present only when the response includes it explicitly (the `createEndUserBtcAccount` or `addEndUserBtcAccount` response, or `getAuthenticatedEndUser` with `includeBtcXpubs=true`); otherwise omitted. */
1302
1324
  xpub?: string;
1303
1325
  /**
1304
1326
  * The lowercase hex-encoded SHA-256 of the UTF-8 bytes of the `xpub` string (the base58check-encoded form exactly as returned, not the decoded key bytes). Used as a stable identifier to select the proper account during signing. This is intentionally not the BIP-32 key fingerprint: hashing the full string form avoids the fingerprint's 4-byte collision risk and yields an identifier that can be recomputed consistently without decoding the key.
@@ -1615,6 +1637,7 @@ export declare const ErrorType: {
1615
1637
  readonly asset_mismatch: "asset_mismatch";
1616
1638
  readonly mfa_already_enrolled: "mfa_already_enrolled";
1617
1639
  readonly mfa_invalid_code: "mfa_invalid_code";
1640
+ readonly mfa_challenge_not_found: "mfa_challenge_not_found";
1618
1641
  readonly mfa_flow_expired: "mfa_flow_expired";
1619
1642
  readonly mfa_required: "mfa_required";
1620
1643
  readonly mfa_not_enrolled: "mfa_not_enrolled";
@@ -1726,6 +1749,9 @@ export declare const EvmSwapsNetwork: {
1726
1749
  readonly polygon: "polygon";
1727
1750
  };
1728
1751
 
1752
+ /**
1753
+ * A smart account operation response.
1754
+ */
1729
1755
  export declare interface EvmUserOperation {
1730
1756
  network: EvmUserOperationNetwork;
1731
1757
  /**
@@ -1780,6 +1806,46 @@ export declare const EvmUserOperationStatus: {
1780
1806
  readonly failed: "failed";
1781
1807
  };
1782
1808
 
1809
+ /**
1810
+ * Export an existing Bitcoin HD (Hierarchical Deterministic) account's master seed as encrypted BIP39 entropy. The 32-byte entropy is encrypted in transport to the provided RSA public key and can be encoded into a BIP39 mnemonic (seed phrase) client-side to import the account into a compatible wallet. It is important to store the exported seed phrase in a secure place after it's exported.
1811
+ * @summary Export end user Bitcoin account
1812
+ */
1813
+ export declare const exportEndUserBtcAccount: (userId: string, exportEndUserBtcAccountBody: ExportEndUserBtcAccountBody, params?: ExportEndUserBtcAccountParams, options?: SecondParameter<typeof cdpApiClient<ExportEndUserBtcAccount200>>) => Promise<ExportEndUserBtcAccount200>;
1814
+
1815
+ export declare type ExportEndUserBtcAccount200 = {
1816
+ /** The base64-encoded, encrypted 32-byte BIP39 entropy of the Bitcoin HD account. This is the initial entropy (not a PBKDF2-derived BIP39 seed): it is encrypted in transport using the exportEncryptionKey in the request and is encoded into a 24-word BIP39 mnemonic (seed phrase) client-side. */
1817
+ encryptedEntropy: string;
1818
+ };
1819
+
1820
+ export declare type ExportEndUserBtcAccountBody = {
1821
+ /**
1822
+ * The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth Header.
1823
+ * @pattern ^[a-zA-Z0-9-]{1,100}$
1824
+ */
1825
+ walletSecretId: string;
1826
+ /**
1827
+ * The lowercase hex-encoded SHA-256 of the UTF-8 bytes of the `xpub` string (the base58check-encoded form exactly as returned, not the decoded key bytes). Selects which of the end user's Bitcoin accounts to export. Use the `xpubHash` returned with the account when it is created or retrieved.
1828
+ * @pattern ^[0-9a-f]{64}$
1829
+ */
1830
+ xpubHash: string;
1831
+ /** The base64-encoded, public part of the RSA key in DER format used to encrypt the account entropy. */
1832
+ exportEncryptionKey: string;
1833
+ /** The origin of the parent site that opened the secure iframe. This origin will be validated against the project's configured allowed origins. Must be a valid origin in the format <scheme>://<host>(:<port>) (e.g., https://example.com, http://localhost:3000). */
1834
+ parentOrigin?: Url;
1835
+ /** If true, the account is ejected after the master seed is exported. Ejection immediately blocks all signing and sending operations on this account. The master seed can still be re-exported during the server-controlled grace period. Setting eject to false or omitting it does not cancel ejection, and re-exporting does not extend or reset the grace period. After the grace period (TTL), the HD key material is permanently deleted from Coinbase systems. This action is irreversible. Ejection is an opt-in feature. To enable it, reach out to us on Discord. */
1836
+ eject?: boolean;
1837
+ };
1838
+
1839
+ export declare type ExportEndUserBtcAccountParams = {
1840
+ /**
1841
+ * The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
1842
+ * @pattern ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
1843
+ */
1844
+ projectID?: ProjectIDOptionalParameter;
1845
+ };
1846
+
1847
+ export declare type ExportEndUserBtcAccountResult = NonNullable<Awaited<ReturnType<typeof exportEndUserBtcAccount>>>;
1848
+
1783
1849
  /**
1784
1850
  * Export an existing end user EVM account's private key. It is important to store the private key in a secure place after it's exported.
1785
1851
  * @summary Export end user EVM account
@@ -1806,7 +1872,7 @@ export declare type ExportEndUserEvmAccountBody = {
1806
1872
  walletSecretId: string;
1807
1873
  /** The origin of the parent site that opened the secure iframe. This origin will be validated against the project's configured allowed origins. Must be a valid origin in the format <scheme>://<host>(:<port>) (e.g., https://example.com, http://localhost:3000). */
1808
1874
  parentOrigin?: Url;
1809
- /** If true, the account is ejected after the private key is exported. Ejection immediately blocks all signing and sending operations on this account. The private key can still be re-exported during the grace period with eject set to false. After the configured grace period (TTL), the key material is permanently deleted from Coinbase systems. This action is irreversible. Ejection is an opt-in feature. To enable it, reach out to us on Discord. */
1875
+ /** If true, the account is ejected after the private key is exported. Ejection immediately blocks all signing and sending operations on this account. The private key can still be re-exported during the server-controlled grace period. Setting eject to false or omitting it does not cancel ejection, and re-exporting does not extend or reset the grace period. After the grace period (TTL), the key material is permanently deleted from Coinbase systems. This action is irreversible. Ejection is an opt-in feature. To enable it, reach out to us on Discord. */
1810
1876
  eject?: boolean;
1811
1877
  };
1812
1878
 
@@ -1846,7 +1912,7 @@ export declare type ExportEndUserSolanaAccountBody = {
1846
1912
  walletSecretId: string;
1847
1913
  /** The origin of the parent site that opened the secure iframe. This origin will be validated against the project's configured allowed origins. Must be a valid origin in the format <scheme>://<host>(:<port>) (e.g., https://example.com, http://localhost:3000). */
1848
1914
  parentOrigin?: Url;
1849
- /** If true, the account is ejected after the private key is exported. Ejection immediately blocks all signing and sending operations on this account. The private key can still be re-exported during the grace period with eject set to false. After the configured grace period (TTL), the key material is permanently deleted from Coinbase systems. This action is irreversible. Ejection is an opt-in feature. To enable it, reach out to us on Discord. */
1915
+ /** If true, the account is ejected after the private key is exported. Ejection immediately blocks all signing and sending operations on this account. The private key can still be re-exported during the server-controlled grace period. Setting eject to false or omitting it does not cancel ejection, and re-exporting does not extend or reset the grace period. After the grace period (TTL), the key material is permanently deleted from Coinbase systems. This action is irreversible. Ejection is an opt-in feature. To enable it, reach out to us on Discord. */
1850
1916
  eject?: boolean;
1851
1917
  };
1852
1918
 
@@ -1897,7 +1963,7 @@ export declare type GetAuthenticatedEndUserParams = {
1897
1963
  /**
1898
1964
  * When `true`, each Bitcoin account in `btcAccountObjects` includes its raw `xpub`. When `false` (the default), only `xpubHash` is returned.
1899
1965
  */
1900
- includeBtcXpubs?: boolean;
1966
+ includeBtcXpubs?: IncludeBtcXpubsParameter;
1901
1967
  };
1902
1968
 
1903
1969
  export declare type GetAuthenticatedEndUserResult = NonNullable<Awaited<ReturnType<typeof getAuthenticatedEndUser>>>;
@@ -2222,6 +2288,11 @@ export declare type IdempotencyErrorResponse = Error_2;
2222
2288
  */
2223
2289
  export declare type IdempotencyKeyParameter = string;
2224
2290
 
2291
+ /**
2292
+ * When `true`, each Bitcoin account in `btcAccountObjects` includes its raw `xpub`. When `false` (the default), only `xpubHash` is returned.
2293
+ */
2294
+ export declare type IncludeBtcXpubsParameter = boolean;
2295
+
2225
2296
  /**
2226
2297
  * Initiates the authentication flow for an end user. This is an optionally authenticated endpoint. The exact response depends on the authentication method specified in the request body. If a valid access token is included in the Authorization header, it is treated as an attempt to add an additional authentication method to the existing user associated with the token. If the authentication method already exists, an error is returned.
2227
2298
  * @summary Initiate end user authentication
@@ -2371,8 +2442,13 @@ export declare interface InitiateMfaEnrollmentTotpResponse {
2371
2442
 
2372
2443
  /**
2373
2444
  * Initiates an MFA verification flow for operations requiring MFA. This endpoint should be called when a user attempts a sensitive operation (like transaction signing) but doesn't have a valid MFA-verified session.
2445
+
2374
2446
  For SMS, generates and sends a 6-digit OTP to the enrolled phone number. For TOTP, user generates code from their authenticator app.
2447
+
2375
2448
  For passkey (WebAuthn), returns credential request options (in the response body) to pass to navigator.credentials.get() in the browser; the resulting assertion must be submitted to the submit endpoint. Only the passkey method returns a response body here; TOTP and SMS return `{}`.
2449
+
2450
+ When the project's `verificationScope` is `request`, the caller supplies the challenge from the `X-Mfa-Challenge-Id` header of the `403 mfa_required` response in the `X-Mfa-Challenge-Id` request header, which binds the ceremony to that request. A missing header is rejected. When the project's `verificationScope` is `session`, the caller doesn't need to supply the header.
2451
+
2376
2452
  Passkey requests must carry an `Origin` header that is one of the project's configured CORS origins and is either `https://` or `http://localhost`; otherwise the request is rejected with a 400. Only passkeys enrolled from that exact host are offered, so a user with passkeys on other hosts only receives a 404 here and must enroll a passkey for this origin.
2377
2453
  * @summary Initiate MFA verification
2378
2454
  */
@@ -2859,6 +2935,18 @@ export declare type LogOutEndUserResult = NonNullable<Awaited<ReturnType<typeof
2859
2935
  */
2860
2936
  export declare type MfaAlreadyEnrolledErrorResponse = Error_2;
2861
2937
 
2938
+ /**
2939
+ * The challenge returned via the `X-Mfa-Challenge-Id` response header when the server rejected an mfa-required operation with `403 mfa_required`. Include as the `X-Mfa-Challenge-Id` request header of the MFA initiate and submit endpoints so the ceremony binds to that specific request. Required when the project's `verificationScope` is `request`; ignored under `session`.
2940
+ For passkey, this ID keys the pending WebAuthn ceremony; the authenticator signs the ceremony's own WebAuthn challenge (returned by `initiateMfaVerification`) via `clientDataJSON`. For TOTP and SMS, this ID is the per-request binding — the 6-digit code signs nothing, so phishing resistance under `request` scope requires passkey.
2941
+ * @pattern ^mfa_challenge_[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
2942
+ */
2943
+ export declare type MfaChallengeId = string;
2944
+
2945
+ /**
2946
+ * Sent as the `X-Mfa-Challenge-Id` request header on the MFA initiate and submit endpoints. See the `MfaChallengeId` schema for value semantics.
2947
+ */
2948
+ export declare type MfaChallengeIdParameterParameter = string;
2949
+
2862
2950
  /**
2863
2951
  * MFA configuration for a project.
2864
2952
  */
@@ -2869,7 +2957,9 @@ export declare interface MfaConfig {
2869
2957
  totpConfig: TotpConfig;
2870
2958
  smsConfig?: SmsConfig;
2871
2959
  passkeyConfig?: PasskeyConfig;
2872
- /** The duration in seconds for which a single MFA verification remains valid. After this period, the user must re-authenticate with MFA. */
2960
+ verificationScope: MfaVerificationScope;
2961
+ /** The duration in seconds for which a single MFA verification remains valid. After this period, the user must re-authenticate with MFA. Only applies when `verificationScope` is `session`; ignored under `request`, where each verification authorizes exactly one operation.
2962
+ Read-only: the window is set server-side, 300 seconds by default, and is not writable through `updateMfaConfig`. */
2873
2963
  verificationWindowSeconds: number;
2874
2964
  /** Whether applications should prompt users for MFA enrollment during the login flow if they are not already enrolled. */
2875
2965
  promptEnrollmentOnLogin: boolean;
@@ -2930,6 +3020,18 @@ export declare type MFAMethodsTotp = {
2930
3020
  enrolledAt: string;
2931
3021
  };
2932
3022
 
3023
+ /**
3024
+ * The configuration defining how a project enforces MFA. A project that has never set one behaves as `session`.
3025
+ Under `session` scope, one verification opens the project's verification window (`verificationWindowSeconds`, 300 by default), and any MFA-required operation inside that window is authorized.
3026
+ Under `request` scope, one verification authorizes one sign/send request, bound to the pending challenge identified by `X-Mfa-Challenge-Id`. A failed submit consumes that challenge. The next attempt must re-initiate the flow; for SMS, that sends a new OTP. Under `session` scope, `mfa_invalid_code` leaves the retry loop open instead.
3027
+ */
3028
+ export declare type MfaVerificationScope = (typeof MfaVerificationScope)[keyof typeof MfaVerificationScope];
3029
+
3030
+ export declare const MfaVerificationScope: {
3031
+ readonly MfaVerificationScopeSession: "session";
3032
+ readonly MfaVerificationScopeRequest: "request";
3033
+ };
3034
+
2933
3035
  /**
2934
3036
  * Morpho Blue's immutable onchain market parameters that uniquely define a borrow product.
2935
3037
  */
@@ -3138,6 +3240,23 @@ export declare interface OnrampSessionRequest {
3138
3240
  partnerUserRef?: string;
3139
3241
  }
3140
3242
 
3243
+ /**
3244
+ * Borrow origination-fee configuration for a project.
3245
+ */
3246
+ export declare interface OriginationFeeProjectConfig {
3247
+ /**
3248
+ * The EVM address that receives borrow origination fees.
3249
+ * @pattern ^0x[a-fA-F0-9]{40}$
3250
+ */
3251
+ recipientAddress: string;
3252
+ /**
3253
+ * The customer-provided borrow origination-fee rate, in basis points.
3254
+ * @minimum 0
3255
+ * @maximum 1000
3256
+ */
3257
+ feeBps: number;
3258
+ }
3259
+
3141
3260
  /**
3142
3261
  * An OTP email logo upload and its moderation state.
3143
3262
  */
@@ -3294,10 +3413,13 @@ export declare interface ProjectConfig {
3294
3413
  iCloudAutoLinkingEnabled?: boolean;
3295
3414
  /** Whether delegated signing is enabled for this project. When enabled, end users can delegate transaction signing to the project. */
3296
3415
  delegatedSigningEnabled?: boolean;
3416
+ /** The OAuth client ID attributed as the manager of this project. This field is informational only and must not be used for authorization. Omitted for projects not managed by an OAuth client. */
3417
+ readonly managingOAuthClientId?: string;
3297
3418
  /** The verified cookie domain for this project, if one is active. When present, the SDK should route all auth requests through https://{activeCookieDomain}/v2/embedded-wallet-api/... so that first-party HttpOnly session cookies are scoped to the developer's domain. Absent when no cookie domain is registered or the registered domain is not yet active. */
3298
3419
  activeCookieDomain?: string;
3299
3420
  appAttestation?: AppAttestationProjectConfig;
3300
3421
  passkey?: PasskeyProjectConfig;
3422
+ originationFee?: OriginationFeeProjectConfig;
3301
3423
  /** The project's OTP email logos, sorted by upload time from oldest to newest. When the latest upload is approved, only that logo is returned. When the latest upload is pending or rejected, the previously approved logo is also returned when one exists.
3302
3424
  */
3303
3425
  logos?: OtpEmailLogo[];
@@ -4366,6 +4488,8 @@ export declare type SignSolanaTransactionWithEndUserAccountBody = {
4366
4488
  * @pattern ^[1-9A-HJ-NP-Za-km-z]{32,44}$
4367
4489
  */
4368
4490
  address: string;
4491
+ /** The Solana network the transaction targets. Required when using versioned transactions that reference address lookup tables, since resolving those tables requires querying a specific network. Optional otherwise. */
4492
+ network?: SignSolanaTransactionWithEndUserAccountBodyNetwork;
4369
4493
  /** The base64 encoded transaction to sign. */
4370
4494
  transaction: string;
4371
4495
  /**
@@ -4375,6 +4499,16 @@ export declare type SignSolanaTransactionWithEndUserAccountBody = {
4375
4499
  walletSecretId?: string;
4376
4500
  };
4377
4501
 
4502
+ /**
4503
+ * The Solana network the transaction targets. Required when using versioned transactions that reference address lookup tables, since resolving those tables requires querying a specific network. Optional otherwise.
4504
+ */
4505
+ export declare type SignSolanaTransactionWithEndUserAccountBodyNetwork = (typeof SignSolanaTransactionWithEndUserAccountBodyNetwork)[keyof typeof SignSolanaTransactionWithEndUserAccountBodyNetwork];
4506
+
4507
+ export declare const SignSolanaTransactionWithEndUserAccountBodyNetwork: {
4508
+ readonly solana: "solana";
4509
+ readonly "solana-devnet": "solana-devnet";
4510
+ };
4511
+
4378
4512
  export declare type SignSolanaTransactionWithEndUserAccountParams = {
4379
4513
  /**
4380
4514
  * The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
@@ -4580,6 +4714,7 @@ export declare type SubmitMfaEnrollmentResult = NonNullable<Awaited<ReturnType<t
4580
4714
  /**
4581
4715
  * Submits an MFA code to complete the verification process.
4582
4716
  For passkey, the request must carry the same `Origin` header the verification was initiated from — the ceremony is bound to that exact origin (scheme, host, and port). A missing, disallowed, or differing `Origin` restarts the ceremony rather than silently changing the Relying Party ID.
4717
+ When the project's `verificationScope` is `request`, the caller supplies the same `X-Mfa-Challenge-Id` request header that was passed to `initiateMfaVerification`. A mismatched or missing header is rejected. When the project's `verificationScope` is `session`, the caller doesn't need to supply the header.
4583
4718
  * @summary Submit MFA verification
4584
4719
  */
4585
4720
  export declare const submitMfaVerification: (userId: string, mfaMethod: "totp" | "sms" | "passkey", submitMfaVerificationRequest: SubmitMfaVerificationRequest, params?: SubmitMfaVerificationParams, options?: SecondParameter<typeof cdpApiClient<void>>) => Promise<void>;
@@ -5467,6 +5602,50 @@ export declare type X402UptoEvmPermit2PayloadPermit2AuthorizationWitness = {
5467
5602
  validAfter: string;
5468
5603
  };
5469
5604
 
5605
+ /**
5606
+ * The x402 protocol upto scheme payload for Solana networks. The `upto` scheme authorizes a maximum amount and lets the resource server settle for the actual amount used.
5607
+
5608
+ A Solana transfer commits to an exact amount once signed, so this scheme escrows the ceiling in an onchain payment channel instead: the client signs an `open` transaction that deposits `maxAmount`, the facilitator co-signs it as fee payer and channel rent payer and broadcasts it before the resource runs, and the resource server later authorizes the metered charge with an Ed25519 voucher signed by the `receiverAuthorizer` key it advertised in the payment requirements `extra`. The facilitator seals and distributes the channel for that amount and refunds the remainder to the client.
5609
+
5610
+ The payment requirements `extra` for this scheme carries `feePayer` (from the facilitator `/supported` response), `receiverAuthorizer`, `withdrawDelay`, and `tokenProgram`. For more details, see [Solana Upto Scheme Details](https://github.com/x402-foundation/x402/blob/main/specs/schemes/upto/scheme_upto_svm.md).
5611
+ */
5612
+ export declare interface X402UptoSolanaPayload {
5613
+ /** The base58-encoded Solana address of the payer that funds the channel deposit. */
5614
+ from: BlockchainAddress;
5615
+ /**
5616
+ * The maximum amount the client authorizes in atomic units of the payment asset. Equals the verification-phase `amount` of the payment requirements.
5617
+ * @pattern ^[0-9]+$
5618
+ */
5619
+ maxAmount: string;
5620
+ /**
5621
+ * The amount escrowed in the payment channel by the `open` transaction, in atomic units. Must equal `maxAmount`.
5622
+ * @pattern ^[0-9]+$
5623
+ */
5624
+ deposit: string;
5625
+ /** The unix timestamp in seconds after which the settlement voucher is no longer valid. Must be nonzero. */
5626
+ expiresAt: number;
5627
+ /** The unix timestamp in seconds after which the payment is valid. */
5628
+ validAfter: number;
5629
+ /**
5630
+ * The unique unsigned 64-bit salt, as a decimal string, encoded in the `open` instruction and used as a channel PDA seed.
5631
+ * @pattern ^[0-9]+$
5632
+ */
5633
+ nonce: string;
5634
+ /**
5635
+ * The Solana slot, an unsigned 64-bit integer as a decimal string, encoded in the `open` instruction and used as a channel PDA seed.
5636
+ * @pattern ^[0-9]+$
5637
+ */
5638
+ openSlot: string;
5639
+ /** The base58-encoded program-derived address of the payment channel, derived from `from`, the fee payer, the asset, the authorized signer, `nonce`, and `openSlot`. */
5640
+ channelId: BlockchainAddress;
5641
+ /** The base58-encoded Solana address authorized to sign settlement vouchers for this channel. Must equal the `receiverAuthorizer` advertised in the payment requirements `extra` field. */
5642
+ authorizedSigner: BlockchainAddress;
5643
+ /** The base64-encoded channel `open` transaction, signed by the payer. The facilitator adds its fee payer signature before broadcasting it. */
5644
+ openTransaction: string;
5645
+ /** The base58-encoded Ed25519 signature by `authorizedSigner` over the settlement voucher, which commits to `channelId`, the settled amount, and `expiresAt`. Added by the resource server on the settle request that claims the metered charge, and required there even when the settled amount is `0`. It is owned by the resource server, so verify and the deposit settle reject any client-supplied value. */
5646
+ voucherSignature?: string;
5647
+ }
5648
+
5470
5649
  /**
5471
5650
  * The x402 v1 network identifier. x402 v1 uses human-readable network names. Supported networks: Base mainnet and testnet, Solana mainnet and devnet.
5472
5651
  */
@@ -5606,7 +5785,7 @@ export declare type X402V2PaymentPayloadExtensions = {
5606
5785
  /**
5607
5786
  * The payload of the payment depending on the x402Version, scheme, and network. Discriminated by scheme-specific fields: exact-EVM/upto-EVM payloads carry a `signature`; exact-Solana carries a `transaction`; batch-settlement carries a `type` discriminator. See `x402BatchSettlementEvmPayload` for the documented batch-settlement variants.
5608
5787
  */
5609
- export declare type X402V2PaymentPayloadPayload = X402ExactEvmPayload | X402ExactEvmPermit2Payload | X402ExactSolanaPayload | X402UptoEvmPermit2Payload | X402BatchSettlementEvmPayload;
5788
+ export declare type X402V2PaymentPayloadPayload = X402ExactEvmPayload | X402ExactEvmPermit2Payload | X402ExactSolanaPayload | X402UptoEvmPermit2Payload | X402UptoSolanaPayload | X402BatchSettlementEvmPayload;
5610
5789
 
5611
5790
  /**
5612
5791
  * The x402 v2 payment requirements. Uses CAIP-2 network identifiers and supports `exact`, `upto`, and `batch-settlement` schemes. Carries only the payment fields (no resource metadata — that is in the enclosing `x402V2PaymentPayload.resource`).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinbase/cdp-api-client",
3
- "version": "0.0.124",
3
+ "version": "0.0.125",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist/**",