@coinbase/cdp-api-client 0.0.123 → 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.
@@ -1,5 +1,53 @@
1
1
  import { AxiosRequestConfig } from 'axios';
2
2
 
3
+ /**
4
+ * A request to adjust an existing borrow position for an end user's smart account on the specified borrow product.
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 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
+ */
8
+ export declare interface AdjustBorrowPositionRequest {
9
+ borrowProductId: BorrowProductId;
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
+ addCollateralAmount?: PositiveDecimal;
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
+ 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` or `addCollateralAmount`. */
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` or `removeCollateralAmount`. */
17
+ borrowLoanAmount?: PositiveDecimal;
18
+ /**
19
+ * The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth header.
20
+ * @pattern ^[a-zA-Z0-9-]{1,100}$
21
+ */
22
+ walletSecretId: string;
23
+ /** Whether to use the CDP Paymaster for the user operation. When `true`, `paymasterUrl` must not be set. */
24
+ useCdpPaymaster: boolean;
25
+ /** Paymaster URL to use for the user operation. Must not be set when `useCdpPaymaster` is `true`.
26
+ If `useCdpPaymaster` is `false` and no `paymasterUrl` is set, the smart account must have sufficient funds to cover network fees. */
27
+ paymasterUrl?: Url;
28
+ /** Optional paymaster metadata forwarded to the configured paymaster service. Valid only when a paymaster is configured via `useCdpPaymaster: true` or a `paymasterUrl`. */
29
+ paymasterContext?: PaymasterContext;
30
+ }
31
+
32
+ /**
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
+ 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 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
+ 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
+ * @summary Adjust a borrow position for an end user smart account
38
+ */
39
+ export declare const adjustBorrowPositionWithEndUserAccount: (userId: string, address: string, adjustBorrowPositionRequest: AdjustBorrowPositionRequest, params?: AdjustBorrowPositionWithEndUserAccountParams, options?: SecondParameter<typeof cdpApiClient<EvmUserOperation>>) => Promise<EvmUserOperation>;
40
+
41
+ export declare type AdjustBorrowPositionWithEndUserAccountParams = {
42
+ /**
43
+ * The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
44
+ * @pattern ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
45
+ */
46
+ projectID?: ProjectIDOptionalParameter;
47
+ };
48
+
49
+ export declare type AdjustBorrowPositionWithEndUserAccountResult = NonNullable<Awaited<ReturnType<typeof adjustBorrowPositionWithEndUserAccount>>>;
50
+
3
51
  /**
4
52
  * The resource already exists.
5
53
  */
@@ -32,6 +80,12 @@ export declare class APIError extends Error {
32
80
  errorMessage: string;
33
81
  correlationId?: string;
34
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[]>;
35
89
  /**
36
90
  * Constructor for the APIError class
37
91
  *
@@ -41,8 +95,9 @@ export declare class APIError extends Error {
41
95
  * @param correlationId - The correlation ID
42
96
  * @param errorLink - URL to documentation about this error
43
97
  * @param cause - The cause of the error
98
+ * @param headers - The response headers, lowercase-keyed
44
99
  */
45
- 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[]>);
46
101
  /**
47
102
  * Convert the error to a JSON object, excluding undefined properties
48
103
  *
@@ -166,6 +221,203 @@ export declare type BadGatewayErrorResponse = Error_2;
166
221
  */
167
222
  export declare type BlockchainAddress = string;
168
223
 
224
+ /**
225
+ * A borrow position held by a smart account in a borrow product, together with its live onchain state read at a point-in-time snapshot.
226
+ */
227
+ export declare interface BorrowPosition {
228
+ borrowProductId: BorrowProductId;
229
+ /**
230
+ * The smart account address that owns the borrow position.
231
+ * @pattern ^0x[0-9a-fA-F]{40}$
232
+ */
233
+ address: string;
234
+ network: BorrowProductNetwork;
235
+ snapshot: BorrowProductSnapshot;
236
+ onchainState: BorrowPositionOnchainState;
237
+ }
238
+
239
+ /**
240
+ * The balance of either the collateral or debt token for a borrow position, as a decimal string in the token's standard unit denomination.
241
+ */
242
+ export declare interface BorrowPositionAssetAmount {
243
+ /**
244
+ * The stable identifier for the asset within the borrow product, which is a UUID prefixed with the string `bp_asset_`. This matches the `assetId` of the corresponding asset on the borrow product.
245
+ * @pattern ^bp_asset_[a-f0-9-]{36}$
246
+ */
247
+ assetId: string;
248
+ /** The onchain token this balance is denominated in. */
249
+ token: BorrowProductToken;
250
+ /** The token balance as a decimal string in the token's standard unit denomination (i.e. "5000" for 5000 mGLO). */
251
+ amount: PositiveDecimal;
252
+ }
253
+
254
+ /**
255
+ * The debt balance for a borrow position, including accrued interest, plus its current borrow rate.
256
+ */
257
+ export declare type BorrowPositionDebt = BorrowPositionAssetAmount & BorrowPositionDebtAllOf;
258
+
259
+ export declare type BorrowPositionDebtAllOf = {
260
+ /**
261
+ * The current annualized borrow rate for the debt, expressed in basis points. For example, `525` represents a borrow APY of 5.25%. Omitted when the rate is unavailable.
262
+ * @minimum 0
263
+ */
264
+ borrowApyBps?: number;
265
+ };
266
+
267
+ /**
268
+ * The aggregate health of a borrow position.
269
+
270
+ - `no_debt`: the position has no outstanding debt.
271
+ - `healthy`: the position has debt and is above its liquidation threshold.
272
+ - `undercollateralized`: the position is at or below its liquidation threshold and may be eligible for liquidation.
273
+ */
274
+ export declare type BorrowPositionHealthStatus = (typeof BorrowPositionHealthStatus)[keyof typeof BorrowPositionHealthStatus];
275
+
276
+ export declare const BorrowPositionHealthStatus: {
277
+ readonly no_debt: "no_debt";
278
+ readonly healthy: "healthy";
279
+ readonly undercollateralized: "undercollateralized";
280
+ };
281
+
282
+ /**
283
+ * The live onchain state of a borrow position. The `type` field indicates which protocol-specific schema describes the state.
284
+ */
285
+ export declare type BorrowPositionOnchainState = MorphoBlueOnchainState;
286
+
287
+ /**
288
+ * A borrow product on an EVM network, operated by a lending protocol such as Morpho Blue.
289
+ A borrow product is a protocol-native representation of a borrowable market, describing the venue that hosts it, the assets that are borrowed or borrowed against in it, a point-in-time snapshot of its onchain state, and the protocol-specific immutable parameters that uniquely define it.
290
+ */
291
+ export declare interface BorrowProduct {
292
+ borrowProductId: BorrowProductId;
293
+ network: BorrowProductNetwork;
294
+ /** A human-readable name for the product, typically derived from its loan and collateral tokens. */
295
+ name: string;
296
+ venue: BorrowProductVenue;
297
+ /** The assets available to be borrowed or borrowed against in this market. */
298
+ assets: BorrowProductAsset[];
299
+ snapshot: BorrowProductSnapshot;
300
+ protocolDetails: BorrowProductProtocolDetails;
301
+ }
302
+
303
+ /**
304
+ * The assets available to be borrowed or borrowed against in this market, together with the capabilities (collateral and/or debt) they provide.
305
+ */
306
+ export declare interface BorrowProductAsset {
307
+ /**
308
+ * A stable identifier for the asset within the product, which is a UUID prefixed with the string `bp_asset_`.
309
+ * @pattern ^bp_asset_[a-f0-9-]{36}$
310
+ */
311
+ assetId: string;
312
+ /** The onchain token that can be used as collateral or debt. */
313
+ token: BorrowProductToken;
314
+ /**
315
+ * The capabilities this asset provides within the borrow product. An asset may be used as collateral and/or debt.
316
+ * @minItems 1
317
+ */
318
+ capabilities: BorrowProductAssetCapability[];
319
+ }
320
+
321
+ /**
322
+ * A capability an asset provides within a borrow product, describing the role the asset plays, either as collateral or debt, and whether that capability is currently active.
323
+ */
324
+ export declare interface BorrowProductAssetCapability {
325
+ /** The role the asset plays within the product. `collateral` indicates the asset can be posted as collateral, and `debt` indicates the asset can be borrowed. */
326
+ type: BorrowProductAssetCapabilityType;
327
+ /** Whether this capability is currently active. For example, an asset with a `collateral` capability and `enabled: false` cannot currently be borrowed against.
328
+ Some venues may temporarily disable an asset's capability, which will be reflected in the `enabled` field. This would not affect any user's existing borrow positions. */
329
+ enabled: boolean;
330
+ }
331
+
332
+ /**
333
+ * The role the asset plays within the product. `collateral` indicates the asset can be posted as collateral, and `debt` indicates the asset can be borrowed.
334
+ */
335
+ export declare type BorrowProductAssetCapabilityType = (typeof BorrowProductAssetCapabilityType)[keyof typeof BorrowProductAssetCapabilityType];
336
+
337
+ export declare const BorrowProductAssetCapabilityType: {
338
+ readonly collateral: "collateral";
339
+ readonly debt: "debt";
340
+ };
341
+
342
+ /**
343
+ * The globally unique ID of the borrow product, which is a UUID prefixed with the string `bp_`.
344
+ * @pattern ^bp_[a-f0-9-]{36}$
345
+ */
346
+ export declare type BorrowProductId = string;
347
+
348
+ /**
349
+ * The name of the EVM network that a borrow product is deployed on.
350
+ */
351
+ export declare type BorrowProductNetwork = (typeof BorrowProductNetwork)[keyof typeof BorrowProductNetwork];
352
+
353
+ export declare const BorrowProductNetwork: {
354
+ readonly base: "base";
355
+ };
356
+
357
+ /**
358
+ * The lending protocol that operates the borrow product.
359
+ */
360
+ export declare type BorrowProductProtocol = (typeof BorrowProductProtocol)[keyof typeof BorrowProductProtocol];
361
+
362
+ export declare const BorrowProductProtocol: {
363
+ readonly morpho_blue: "morpho_blue";
364
+ };
365
+
366
+ /**
367
+ * Protocol-specific immutable onchain details that uniquely define a borrow product. The `type` field indicates which protocol-specific schema describes the product's details.
368
+ */
369
+ export declare type BorrowProductProtocolDetails = MorphoBlueProtocolDetails;
370
+
371
+ /**
372
+ * The point-in-time at which onchain state, such as a borrow product or borrow position, was captured. This is when the data was last read from the chain.
373
+ */
374
+ export declare interface BorrowProductSnapshot {
375
+ /** The block number at which the state was observed. */
376
+ blockNumber: number;
377
+ /**
378
+ * The hash of the block at which the state was observed.
379
+ * @pattern ^0x[0-9a-fA-F]{64}$
380
+ */
381
+ blockHash: string;
382
+ /** The onchain block timestamp at which the state was observed in Unix seconds. */
383
+ blockTimestamp: number;
384
+ /** The timestamp at which the state was observed. */
385
+ observedAt: string;
386
+ }
387
+
388
+ /**
389
+ * A token on an EVM borrow product network.
390
+ */
391
+ export declare interface BorrowProductToken {
392
+ /**
393
+ * The contract address of the token.
394
+ * @pattern ^0x[0-9a-fA-F]{40}$
395
+ */
396
+ address: string;
397
+ /** The symbol of the token (e.g. USDC, WETH). */
398
+ symbol: string;
399
+ /** The number of decimal places used by the token. */
400
+ decimals: number;
401
+ }
402
+
403
+ /**
404
+ * The onchain venue that hosts a borrow product. The venue comprises the protocol and network the product is deployed on. An example of a venue would be Morpho Blue on Base Mainnet.
405
+ */
406
+ export declare interface BorrowProductVenue {
407
+ /**
408
+ * A stable identifier for the venue, which is a UUID prefixed with the string `bp_venue_`.
409
+ * @pattern ^bp_venue_[a-f0-9-]{36}$
410
+ */
411
+ venueId: string;
412
+ /**
413
+ * The contract address of the venue's entrypoint.
414
+ * @pattern ^0x[0-9a-fA-F]{40}$
415
+ */
416
+ entrypointAddress: string;
417
+ /** A human-readable name for the venue. */
418
+ name: string;
419
+ }
420
+
169
421
  /**
170
422
  * The name of a capability. Capabilities represent granular functional permissions
171
423
  that determine what actions a customer can perform. Each capability must be
@@ -175,14 +427,14 @@ export declare type BlockchainAddress = string;
175
427
  export declare type CapabilityName = (typeof CapabilityName)[keyof typeof CapabilityName];
176
428
 
177
429
  export declare const CapabilityName: {
178
- readonly custodyCrypto: "custodyCrypto";
179
- readonly custodyFiat: "custodyFiat";
180
- readonly custodyStablecoin: "custodyStablecoin";
181
- readonly tradeCrypto: "tradeCrypto";
182
- readonly tradeStablecoin: "tradeStablecoin";
183
- readonly transferCrypto: "transferCrypto";
184
- readonly transferFiat: "transferFiat";
185
- 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";
186
438
  };
187
439
 
188
440
  /**
@@ -190,11 +442,26 @@ export declare const CapabilityName: {
190
442
  * to the request headers.
191
443
  *
192
444
  * @param {AxiosRequestConfig} config - The Axios request configuration.
193
- * @param idempotencyKey - The idempotency key.
445
+ * @param options - Per-request options, or a bare idempotency key string (legacy form).
194
446
  * @returns {Promise<T>} A promise that resolves to the response data.
195
447
  * @throws {APIError} If the request fails.
196
448
  */
197
- 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
+ };
198
465
 
199
466
  /**
200
467
  * The options for the CDP API Client.
@@ -239,6 +506,44 @@ export declare type CdpOptions = {
239
506
  platform?: string;
240
507
  };
241
508
 
509
+ /**
510
+ * A request to close an end user smart account's borrow position for the specified borrow product.
511
+ Closing fully repays the position's outstanding loan and withdraws all remaining collateral back to the smart account, broadcasting a single user operation to settle the position onchain. There is no partial close; use `adjustBorrowPositionWithEndUserAccount` to adjust a position without closing it.
512
+ */
513
+ export declare interface CloseBorrowPositionRequest {
514
+ borrowProductId: BorrowProductId;
515
+ /**
516
+ * The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth header.
517
+ * @pattern ^[a-zA-Z0-9-]{1,100}$
518
+ */
519
+ walletSecretId: string;
520
+ /** Whether to use the CDP Paymaster for the user operation. When `true`, `paymasterUrl` must not be set. */
521
+ useCdpPaymaster: boolean;
522
+ /** Paymaster URL to use for the user operation. Must not be set when `useCdpPaymaster` is `true`.
523
+ If `useCdpPaymaster` is `false` and no `paymasterUrl` is set, the smart account must have sufficient funds to cover network fees. */
524
+ paymasterUrl?: Url;
525
+ /** Optional paymaster metadata forwarded to the configured paymaster service. Valid only when a paymaster is configured via `useCdpPaymaster: true` or a `paymasterUrl`. */
526
+ paymasterContext?: PaymasterContext;
527
+ }
528
+
529
+ /**
530
+ * Closes an end user smart account's borrow position by fully repaying its outstanding loan and withdrawing all remaining collateral back to the smart account, in a single user operation.
531
+ A borrow position is identified by the smart account `address` and the `borrowProductId` in the request body, since a smart account holds at most one position per borrow product. Closing repays the entire accrued debt and withdraws the full collateral balance; there is no partial close. To adjust a position without closing it, use `adjustBorrowPositionWithEndUserAccount` instead.
532
+ A user operation is broadcast to close the position onchain. Poll `getUserOperationWithEndUserAccount` with the returned `userOpHash` until it reaches a terminal state. Once the user operation succeeds onchain, the position is closed and no longer appears in the borrow positions list.
533
+ * @summary Close a borrow position for an end user smart account
534
+ */
535
+ export declare const closeBorrowPositionWithEndUserAccount: (userId: string, address: string, closeBorrowPositionRequest: CloseBorrowPositionRequest, params?: CloseBorrowPositionWithEndUserAccountParams, options?: SecondParameter<typeof cdpApiClient<EvmUserOperation>>) => Promise<EvmUserOperation>;
536
+
537
+ export declare type CloseBorrowPositionWithEndUserAccountParams = {
538
+ /**
539
+ * The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
540
+ * @pattern ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
541
+ */
542
+ projectID?: ProjectIDOptionalParameter;
543
+ };
544
+
545
+ export declare type CloseBorrowPositionWithEndUserAccountResult = NonNullable<Awaited<ReturnType<typeof closeBorrowPositionWithEndUserAccount>>>;
546
+
242
547
  /**
243
548
  * Configures the CDP client with the given options.
244
549
  *
@@ -246,6 +551,48 @@ export declare type CdpOptions = {
246
551
  */
247
552
  export declare const configureCdpApiClient: (options: CdpOptions) => void;
248
553
 
554
+ /**
555
+ * A request to create a borrow position for an end user's smart account for the specified borrow product.
556
+ The smart account posts collateral and borrows against it, broadcasting a user operation to open the position onchain.
557
+ */
558
+ export declare interface CreateBorrowPositionRequest {
559
+ borrowProductId: BorrowProductId;
560
+ /** The amount of collateral to post, as a decimal string in standard unit denomination of the collateral token (i.e. "1" for 1 cbBTC). */
561
+ collateralAmount: PositiveDecimal;
562
+ /** 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). */
563
+ loanAmount: PositiveDecimal;
564
+ /**
565
+ * The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth header.
566
+ * @pattern ^[a-zA-Z0-9-]{1,100}$
567
+ */
568
+ walletSecretId: string;
569
+ /** Whether to use the CDP Paymaster for the user operation. When `true`, `paymasterUrl` must not be set. */
570
+ useCdpPaymaster: boolean;
571
+ /** Paymaster URL to use for the user operation. Must not be set when `useCdpPaymaster` is `true`.
572
+ If `useCdpPaymaster` is `false` and no `paymasterUrl` is set, the smart account must have sufficient funds to cover network fees. */
573
+ paymasterUrl?: Url;
574
+ /** Optional paymaster metadata forwarded to the configured paymaster service. Valid only when a paymaster is configured via `useCdpPaymaster: true` or a `paymasterUrl`. */
575
+ paymasterContext?: PaymasterContext;
576
+ }
577
+
578
+ /**
579
+ * Creates a borrow position for a specific borrow product, by posting collateral from an end user smart account and borrowing a loan against it. One position can be opened per borrow product for a given smart account.
580
+ A borrow product is a protocol-native representation of a borrowable market, such as a Morpho Blue market that lends USDC against cbBTC. The `borrowProductId` identifies the product to borrow against, and the `collateralAmount` and `loanAmount` specify the collateral to post and the loan to take, both expressed as decimal strings in standard unit denomination of their respective tokens.
581
+ A user operation is broadcast to open 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 active positions.
582
+ * @summary Create a borrow position for an end user smart account
583
+ */
584
+ export declare const createBorrowPositionWithEndUserAccount: (userId: string, address: string, createBorrowPositionRequest: CreateBorrowPositionRequest, params?: CreateBorrowPositionWithEndUserAccountParams, options?: SecondParameter<typeof cdpApiClient<EvmUserOperation>>) => Promise<EvmUserOperation>;
585
+
586
+ export declare type CreateBorrowPositionWithEndUserAccountParams = {
587
+ /**
588
+ * The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
589
+ * @pattern ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
590
+ */
591
+ projectID?: ProjectIDOptionalParameter;
592
+ };
593
+
594
+ export declare type CreateBorrowPositionWithEndUserAccountResult = NonNullable<Awaited<ReturnType<typeof createBorrowPositionWithEndUserAccount>>>;
595
+
249
596
  /**
250
597
  * Creates a delegation that allows a developer to sign on behalf of an end user for the specified duration. The end user must be authenticated to authorize this delegation.
251
598
  * @summary Create delegation for end user
@@ -973,7 +1320,7 @@ export declare interface EndUserBtcAccount {
973
1320
  addressType: EndUserBtcAccountAddressType;
974
1321
  /** The Bitcoin network this account is associated with. */
975
1322
  network: EndUserBtcAccountNetwork;
976
- /** 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. */
977
1324
  xpub?: string;
978
1325
  /**
979
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.
@@ -1290,6 +1637,7 @@ export declare const ErrorType: {
1290
1637
  readonly asset_mismatch: "asset_mismatch";
1291
1638
  readonly mfa_already_enrolled: "mfa_already_enrolled";
1292
1639
  readonly mfa_invalid_code: "mfa_invalid_code";
1640
+ readonly mfa_challenge_not_found: "mfa_challenge_not_found";
1293
1641
  readonly mfa_flow_expired: "mfa_flow_expired";
1294
1642
  readonly mfa_required: "mfa_required";
1295
1643
  readonly mfa_not_enrolled: "mfa_not_enrolled";
@@ -1401,6 +1749,9 @@ export declare const EvmSwapsNetwork: {
1401
1749
  readonly polygon: "polygon";
1402
1750
  };
1403
1751
 
1752
+ /**
1753
+ * A smart account operation response.
1754
+ */
1404
1755
  export declare interface EvmUserOperation {
1405
1756
  network: EvmUserOperationNetwork;
1406
1757
  /**
@@ -1455,6 +1806,46 @@ export declare const EvmUserOperationStatus: {
1455
1806
  readonly failed: "failed";
1456
1807
  };
1457
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
+
1458
1849
  /**
1459
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.
1460
1851
  * @summary Export end user EVM account
@@ -1481,7 +1872,7 @@ export declare type ExportEndUserEvmAccountBody = {
1481
1872
  walletSecretId: string;
1482
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). */
1483
1874
  parentOrigin?: Url;
1484
- /** 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. */
1485
1876
  eject?: boolean;
1486
1877
  };
1487
1878
 
@@ -1521,7 +1912,7 @@ export declare type ExportEndUserSolanaAccountBody = {
1521
1912
  walletSecretId: string;
1522
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). */
1523
1914
  parentOrigin?: Url;
1524
- /** 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. */
1525
1916
  eject?: boolean;
1526
1917
  };
1527
1918
 
@@ -1572,7 +1963,7 @@ export declare type GetAuthenticatedEndUserParams = {
1572
1963
  /**
1573
1964
  * When `true`, each Bitcoin account in `btcAccountObjects` includes its raw `xpub`. When `false` (the default), only `xpubHash` is returned.
1574
1965
  */
1575
- includeBtcXpubs?: boolean;
1966
+ includeBtcXpubs?: IncludeBtcXpubsParameter;
1576
1967
  };
1577
1968
 
1578
1969
  export declare type GetAuthenticatedEndUserResult = NonNullable<Awaited<ReturnType<typeof getAuthenticatedEndUser>>>;
@@ -1802,6 +2193,23 @@ export declare type GetEndUserEvmSwapPriceParams = {
1802
2193
 
1803
2194
  export declare type GetEndUserEvmSwapPriceResult = NonNullable<Awaited<ReturnType<typeof getEndUserEvmSwapPrice>>>;
1804
2195
 
2196
+ /**
2197
+ * Gets a single borrow product by its ID.
2198
+ The ID is a stable identifier that uniquely identifies a single borrow product based on the product's onchain parameters. A borrow product is a protocol-native representation of a borrowable market, describing the venue that hosts it and the assets that participate in it together with their collateral and debt capabilities.
2199
+ * @summary Get a borrow product
2200
+ */
2201
+ export declare const getEvmBorrowProduct: (borrowProductId: BorrowProductId, params?: GetEvmBorrowProductParams, options?: SecondParameter<typeof cdpApiClient<BorrowProduct>>) => Promise<BorrowProduct>;
2202
+
2203
+ export declare type GetEvmBorrowProductParams = {
2204
+ /**
2205
+ * The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
2206
+ * @pattern ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
2207
+ */
2208
+ projectID?: ProjectIDOptionalParameter;
2209
+ };
2210
+
2211
+ export declare type GetEvmBorrowProductResult = NonNullable<Awaited<ReturnType<typeof getEvmBorrowProduct>>>;
2212
+
1805
2213
  /**
1806
2214
  * Returns the EIP-7702 delegation operation for an end user's EVM account. Use the delegationOperationId returned by the Create EIP-7702 delegation endpoint to poll for operation completion.
1807
2215
  * @summary Get EIP-7702 delegation operation for end user EVM account
@@ -1880,6 +2288,11 @@ export declare type IdempotencyErrorResponse = Error_2;
1880
2288
  */
1881
2289
  export declare type IdempotencyKeyParameter = string;
1882
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
+
1883
2296
  /**
1884
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.
1885
2298
  * @summary Initiate end user authentication
@@ -2029,8 +2442,13 @@ export declare interface InitiateMfaEnrollmentTotpResponse {
2029
2442
 
2030
2443
  /**
2031
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
+
2032
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
+
2033
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
+
2034
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.
2035
2453
  * @summary Initiate MFA verification
2036
2454
  */
@@ -2369,6 +2787,84 @@ export declare const isRefreshTokenUnavailableError: (error: unknown) => error i
2369
2787
  */
2370
2788
  export declare const isTransientTokenReadError: (error: RefreshTokenUnavailableError) => boolean;
2371
2789
 
2790
+ /**
2791
+ * Lists the borrow positions held by an end user smart account, with the live onchain state of each position read at a point-in-time snapshot.
2792
+ A borrow position represents collateral posted and a loan borrowed against it in a borrow product, such as a Morpho Blue market that lends USDC against cbBTC. Each position reports its current collateral and debt balances, its health factor, and its health status. Returns an empty list if the smart account has no borrow positions.
2793
+ * @summary List borrow positions for an end user smart account
2794
+ */
2795
+ export declare const listBorrowPositionsWithEndUserAccount: (userId: string, address: string, params?: ListBorrowPositionsWithEndUserAccountParams, options?: SecondParameter<typeof cdpApiClient<ListBorrowPositionsWithEndUserAccount200>>) => Promise<ListBorrowPositionsWithEndUserAccount200>;
2796
+
2797
+ export declare type ListBorrowPositionsWithEndUserAccount200 = ListBorrowPositionsWithEndUserAccount200AllOf & ListResponse;
2798
+
2799
+ /**
2800
+ * Response containing a list of borrow positions.
2801
+ */
2802
+ export declare type ListBorrowPositionsWithEndUserAccount200AllOf = {
2803
+ /** The borrow positions held by the smart account. */
2804
+ borrowPositions: BorrowPosition[];
2805
+ };
2806
+
2807
+ export declare type ListBorrowPositionsWithEndUserAccountParams = {
2808
+ /**
2809
+ * The number of resources to return per page.
2810
+ */
2811
+ pageSize?: PageSizeParameter;
2812
+ /**
2813
+ * The token for the next page of resources, if any.
2814
+ */
2815
+ pageToken?: PageTokenParameter;
2816
+ /**
2817
+ * The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
2818
+ * @pattern ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
2819
+ */
2820
+ projectID?: ProjectIDOptionalParameter;
2821
+ };
2822
+
2823
+ export declare type ListBorrowPositionsWithEndUserAccountResult = NonNullable<Awaited<ReturnType<typeof listBorrowPositionsWithEndUserAccount>>>;
2824
+
2825
+ /**
2826
+ * Lists the borrow products available across all supported networks and protocols. If a network and/or protocol query parameter is supplied, then borrow products are filtered and returned accordingly.
2827
+ A borrow product is a protocol-native representation of a borrowable market, describing the venue that hosts it, the assets that can be borrowed or posted as collateral, and their collateral and debt capabilities. For example, a Morpho Blue market that lends USDC against cbBTC.
2828
+ * @summary List borrow products
2829
+ */
2830
+ export declare const listEvmBorrowProducts: (params?: ListEvmBorrowProductsParams, options?: SecondParameter<typeof cdpApiClient<ListEvmBorrowProducts200>>) => Promise<ListEvmBorrowProducts200>;
2831
+
2832
+ export declare type ListEvmBorrowProducts200 = ListEvmBorrowProducts200AllOf & ListResponse;
2833
+
2834
+ /**
2835
+ * Response containing a list of borrow products.
2836
+ */
2837
+ export declare type ListEvmBorrowProducts200AllOf = {
2838
+ /** The list of borrow products, optionally filtered by the supplied network and/or protocol. */
2839
+ borrowProducts: BorrowProduct[];
2840
+ };
2841
+
2842
+ export declare type ListEvmBorrowProductsParams = {
2843
+ /**
2844
+ * The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
2845
+ * @pattern ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
2846
+ */
2847
+ projectID?: ProjectIDOptionalParameter;
2848
+ /**
2849
+ * The EVM network name to list borrow products for.
2850
+ */
2851
+ network?: BorrowProductNetwork;
2852
+ /**
2853
+ * The lending protocol whose borrow products to list.
2854
+ */
2855
+ protocol?: BorrowProductProtocol;
2856
+ /**
2857
+ * The number of resources to return per page.
2858
+ */
2859
+ pageSize?: PageSizeParameter;
2860
+ /**
2861
+ * The token for the next page of resources, if any.
2862
+ */
2863
+ pageToken?: PageTokenParameter;
2864
+ };
2865
+
2866
+ export declare type ListEvmBorrowProductsResult = NonNullable<Awaited<ReturnType<typeof listEvmBorrowProducts>>>;
2867
+
2372
2868
  /**
2373
2869
  * Lists the passkey (WebAuthn) credentials enrolled by the end user. Never returns the COSE public key or other sensitive credential material.
2374
2870
  * @summary List passkeys
@@ -2439,6 +2935,18 @@ export declare type LogOutEndUserResult = NonNullable<Awaited<ReturnType<typeof
2439
2935
  */
2440
2936
  export declare type MfaAlreadyEnrolledErrorResponse = Error_2;
2441
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
+
2442
2950
  /**
2443
2951
  * MFA configuration for a project.
2444
2952
  */
@@ -2449,7 +2957,9 @@ export declare interface MfaConfig {
2449
2957
  totpConfig: TotpConfig;
2450
2958
  smsConfig?: SmsConfig;
2451
2959
  passkeyConfig?: PasskeyConfig;
2452
- /** 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`. */
2453
2963
  verificationWindowSeconds: number;
2454
2964
  /** Whether applications should prompt users for MFA enrollment during the login flow if they are not already enrolled. */
2455
2965
  promptEnrollmentOnLogin: boolean;
@@ -2510,6 +3020,95 @@ export declare type MFAMethodsTotp = {
2510
3020
  enrolledAt: string;
2511
3021
  };
2512
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
+
3035
+ /**
3036
+ * Morpho Blue's immutable onchain market parameters that uniquely define a borrow product.
3037
+ */
3038
+ export declare interface MorphoBlueMarketParams {
3039
+ /**
3040
+ * The Morpho Blue native bytes32 market ID that uniquely identifies the underlying market onchain.
3041
+ * @pattern ^0x[0-9a-fA-F]{64}$
3042
+ */
3043
+ onchainMarketId: string;
3044
+ /** The token that is borrowed in the product. */
3045
+ loanToken: BorrowProductToken;
3046
+ /** The token posted as collateral in the product. */
3047
+ collateralToken: BorrowProductToken;
3048
+ /**
3049
+ * The contract address of the oracle used to price the collateral token against the loan token.
3050
+ * @pattern ^0x[0-9a-fA-F]{40}$
3051
+ */
3052
+ oracleAddress: string;
3053
+ /**
3054
+ * The contract address of the interest rate model that governs the product's borrow rate.
3055
+ * @pattern ^0x[0-9a-fA-F]{40}$
3056
+ */
3057
+ interestRateModelAddress: string;
3058
+ /**
3059
+ * The liquidation loan-to-value of the product, expressed in basis points. For example, `9150` represents an LLTV of 91.5%.
3060
+ * @minimum 0
3061
+ * @maximum 10000
3062
+ */
3063
+ lltvBps: number;
3064
+ }
3065
+
3066
+ /**
3067
+ * The live onchain state of a Morpho Blue borrow position, read at the block described by the position's snapshot.
3068
+ */
3069
+ export declare interface MorphoBlueOnchainState {
3070
+ type: MorphoBlueOnchainStateType;
3071
+ /** The non-zero collateral balances securing the position. */
3072
+ collateral: BorrowPositionAssetAmount[];
3073
+ /** The non-zero debt balances owed by the position. */
3074
+ debt: BorrowPositionDebt[];
3075
+ /** The position's liquidation headroom as a decimal string, where `1.0` is the liquidation boundary and higher is safer. For example, `1.79` means the position's weighted collateral is 1.79x its debt. Omitted when the position has no debt. */
3076
+ healthFactor?: string;
3077
+ /**
3078
+ * The position's current loan-to-value, expressed in basis points. For example, `5000` represents a current LTV of 50%. Omitted when the position has no debt.
3079
+ * @minimum 0
3080
+ */
3081
+ currentLtvBps?: number;
3082
+ /**
3083
+ * The loan-to-value at which the position becomes eligible for liquidation, expressed in basis points. For example, `8250` represents 82.5%. Omitted when the position has no debt.
3084
+ * @minimum 0
3085
+ * @maximum 10000
3086
+ */
3087
+ liquidationThresholdBps?: number;
3088
+ healthStatus: BorrowPositionHealthStatus;
3089
+ }
3090
+
3091
+ export declare type MorphoBlueOnchainStateType = (typeof MorphoBlueOnchainStateType)[keyof typeof MorphoBlueOnchainStateType];
3092
+
3093
+ export declare const MorphoBlueOnchainStateType: {
3094
+ readonly morpho_blue: "morpho_blue";
3095
+ };
3096
+
3097
+ /**
3098
+ * Morpho Blue-specific immutable onchain protocol details that uniquely define a borrow product.
3099
+ */
3100
+ export declare interface MorphoBlueProtocolDetails {
3101
+ type: MorphoBlueProtocolDetailsType;
3102
+ /** The Morpho Blue market parameters that uniquely define the product onchain. */
3103
+ marketParams: MorphoBlueMarketParams;
3104
+ }
3105
+
3106
+ export declare type MorphoBlueProtocolDetailsType = (typeof MorphoBlueProtocolDetailsType)[keyof typeof MorphoBlueProtocolDetailsType];
3107
+
3108
+ export declare const MorphoBlueProtocolDetailsType: {
3109
+ readonly morpho_blue: "morpho_blue";
3110
+ };
3111
+
2513
3112
  /**
2514
3113
  * The blockchain network for the payment. Supported networks depend on the account type.
2515
3114
  */
@@ -2641,6 +3240,23 @@ export declare interface OnrampSessionRequest {
2641
3240
  partnerUserRef?: string;
2642
3241
  }
2643
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
+
2644
3260
  /**
2645
3261
  * An OTP email logo upload and its moderation state.
2646
3262
  */
@@ -2774,6 +3390,12 @@ export declare type PaymentMethodRequiredErrorResponse = Error_2;
2774
3390
  */
2775
3391
  export declare type PhoneNumber = string;
2776
3392
 
3393
+ /**
3394
+ * A positive decimal string without scientific notation or whitespace.
3395
+ * @pattern ^\+?(?:(?:0*[1-9]\d*)(?:\.\d*)?|0*\.\d*[1-9]\d*)$
3396
+ */
3397
+ export declare type PositiveDecimal = string;
3398
+
2777
3399
  /**
2778
3400
  * Configuration for a project.
2779
3401
  */
@@ -2791,10 +3413,13 @@ export declare interface ProjectConfig {
2791
3413
  iCloudAutoLinkingEnabled?: boolean;
2792
3414
  /** Whether delegated signing is enabled for this project. When enabled, end users can delegate transaction signing to the project. */
2793
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;
2794
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. */
2795
3419
  activeCookieDomain?: string;
2796
3420
  appAttestation?: AppAttestationProjectConfig;
2797
3421
  passkey?: PasskeyProjectConfig;
3422
+ originationFee?: OriginationFeeProjectConfig;
2798
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.
2799
3424
  */
2800
3425
  logos?: OtpEmailLogo[];
@@ -3863,6 +4488,8 @@ export declare type SignSolanaTransactionWithEndUserAccountBody = {
3863
4488
  * @pattern ^[1-9A-HJ-NP-Za-km-z]{32,44}$
3864
4489
  */
3865
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;
3866
4493
  /** The base64 encoded transaction to sign. */
3867
4494
  transaction: string;
3868
4495
  /**
@@ -3872,6 +4499,16 @@ export declare type SignSolanaTransactionWithEndUserAccountBody = {
3872
4499
  walletSecretId?: string;
3873
4500
  };
3874
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
+
3875
4512
  export declare type SignSolanaTransactionWithEndUserAccountParams = {
3876
4513
  /**
3877
4514
  * The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
@@ -4077,6 +4714,7 @@ export declare type SubmitMfaEnrollmentResult = NonNullable<Awaited<ReturnType<t
4077
4714
  /**
4078
4715
  * Submits an MFA code to complete the verification process.
4079
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.
4080
4718
  * @summary Submit MFA verification
4081
4719
  */
4082
4720
  export declare const submitMfaVerification: (userId: string, mfaMethod: "totp" | "sms" | "passkey", submitMfaVerificationRequest: SubmitMfaVerificationRequest, params?: SubmitMfaVerificationParams, options?: SecondParameter<typeof cdpApiClient<void>>) => Promise<void>;
@@ -4964,6 +5602,50 @@ export declare type X402UptoEvmPermit2PayloadPermit2AuthorizationWitness = {
4964
5602
  validAfter: string;
4965
5603
  };
4966
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
+
4967
5649
  /**
4968
5650
  * The x402 v1 network identifier. x402 v1 uses human-readable network names. Supported networks: Base mainnet and testnet, Solana mainnet and devnet.
4969
5651
  */
@@ -5103,7 +5785,7 @@ export declare type X402V2PaymentPayloadExtensions = {
5103
5785
  /**
5104
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.
5105
5787
  */
5106
- export declare type X402V2PaymentPayloadPayload = X402ExactEvmPayload | X402ExactEvmPermit2Payload | X402ExactSolanaPayload | X402UptoEvmPermit2Payload | X402BatchSettlementEvmPayload;
5788
+ export declare type X402V2PaymentPayloadPayload = X402ExactEvmPayload | X402ExactEvmPermit2Payload | X402ExactSolanaPayload | X402UptoEvmPermit2Payload | X402UptoSolanaPayload | X402BatchSettlementEvmPayload;
5107
5789
 
5108
5790
  /**
5109
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`).