@coinbase/cdp-api-client 0.0.123 → 0.0.124

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 cannot combine supplying and withdrawing collateral, or repaying debt and borrowing more debt.
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 (i.e. "1" for 1 cbBTC). Must not be combined with `removeCollateralAmount`. */
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`. */
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`. */
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`. */
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 cannot combine supplying and withdrawing collateral, or repaying debt and borrowing more debt.
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
  */
@@ -166,6 +214,203 @@ export declare type BadGatewayErrorResponse = Error_2;
166
214
  */
167
215
  export declare type BlockchainAddress = string;
168
216
 
217
+ /**
218
+ * 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.
219
+ */
220
+ export declare interface BorrowPosition {
221
+ borrowProductId: BorrowProductId;
222
+ /**
223
+ * The smart account address that owns the borrow position.
224
+ * @pattern ^0x[0-9a-fA-F]{40}$
225
+ */
226
+ address: string;
227
+ network: BorrowProductNetwork;
228
+ snapshot: BorrowProductSnapshot;
229
+ onchainState: BorrowPositionOnchainState;
230
+ }
231
+
232
+ /**
233
+ * The balance of either the collateral or debt token for a borrow position, as a decimal string in the token's standard unit denomination.
234
+ */
235
+ export declare interface BorrowPositionAssetAmount {
236
+ /**
237
+ * 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.
238
+ * @pattern ^bp_asset_[a-f0-9-]{36}$
239
+ */
240
+ assetId: string;
241
+ /** The onchain token this balance is denominated in. */
242
+ token: BorrowProductToken;
243
+ /** The token balance as a decimal string in the token's standard unit denomination (i.e. "5000" for 5000 mGLO). */
244
+ amount: PositiveDecimal;
245
+ }
246
+
247
+ /**
248
+ * The debt balance for a borrow position, including accrued interest, plus its current borrow rate.
249
+ */
250
+ export declare type BorrowPositionDebt = BorrowPositionAssetAmount & BorrowPositionDebtAllOf;
251
+
252
+ export declare type BorrowPositionDebtAllOf = {
253
+ /**
254
+ * 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.
255
+ * @minimum 0
256
+ */
257
+ borrowApyBps?: number;
258
+ };
259
+
260
+ /**
261
+ * The aggregate health of a borrow position.
262
+
263
+ - `no_debt`: the position has no outstanding debt.
264
+ - `healthy`: the position has debt and is above its liquidation threshold.
265
+ - `undercollateralized`: the position is at or below its liquidation threshold and may be eligible for liquidation.
266
+ */
267
+ export declare type BorrowPositionHealthStatus = (typeof BorrowPositionHealthStatus)[keyof typeof BorrowPositionHealthStatus];
268
+
269
+ export declare const BorrowPositionHealthStatus: {
270
+ readonly no_debt: "no_debt";
271
+ readonly healthy: "healthy";
272
+ readonly undercollateralized: "undercollateralized";
273
+ };
274
+
275
+ /**
276
+ * The live onchain state of a borrow position. The `type` field indicates which protocol-specific schema describes the state.
277
+ */
278
+ export declare type BorrowPositionOnchainState = MorphoBlueOnchainState;
279
+
280
+ /**
281
+ * A borrow product on an EVM network, operated by a lending protocol such as Morpho Blue.
282
+ 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.
283
+ */
284
+ export declare interface BorrowProduct {
285
+ borrowProductId: BorrowProductId;
286
+ network: BorrowProductNetwork;
287
+ /** A human-readable name for the product, typically derived from its loan and collateral tokens. */
288
+ name: string;
289
+ venue: BorrowProductVenue;
290
+ /** The assets available to be borrowed or borrowed against in this market. */
291
+ assets: BorrowProductAsset[];
292
+ snapshot: BorrowProductSnapshot;
293
+ protocolDetails: BorrowProductProtocolDetails;
294
+ }
295
+
296
+ /**
297
+ * The assets available to be borrowed or borrowed against in this market, together with the capabilities (collateral and/or debt) they provide.
298
+ */
299
+ export declare interface BorrowProductAsset {
300
+ /**
301
+ * A stable identifier for the asset within the product, which is a UUID prefixed with the string `bp_asset_`.
302
+ * @pattern ^bp_asset_[a-f0-9-]{36}$
303
+ */
304
+ assetId: string;
305
+ /** The onchain token that can be used as collateral or debt. */
306
+ token: BorrowProductToken;
307
+ /**
308
+ * The capabilities this asset provides within the borrow product. An asset may be used as collateral and/or debt.
309
+ * @minItems 1
310
+ */
311
+ capabilities: BorrowProductAssetCapability[];
312
+ }
313
+
314
+ /**
315
+ * 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.
316
+ */
317
+ export declare interface BorrowProductAssetCapability {
318
+ /** 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. */
319
+ type: BorrowProductAssetCapabilityType;
320
+ /** Whether this capability is currently active. For example, an asset with a `collateral` capability and `enabled: false` cannot currently be borrowed against.
321
+ 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. */
322
+ enabled: boolean;
323
+ }
324
+
325
+ /**
326
+ * 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.
327
+ */
328
+ export declare type BorrowProductAssetCapabilityType = (typeof BorrowProductAssetCapabilityType)[keyof typeof BorrowProductAssetCapabilityType];
329
+
330
+ export declare const BorrowProductAssetCapabilityType: {
331
+ readonly collateral: "collateral";
332
+ readonly debt: "debt";
333
+ };
334
+
335
+ /**
336
+ * The globally unique ID of the borrow product, which is a UUID prefixed with the string `bp_`.
337
+ * @pattern ^bp_[a-f0-9-]{36}$
338
+ */
339
+ export declare type BorrowProductId = string;
340
+
341
+ /**
342
+ * The name of the EVM network that a borrow product is deployed on.
343
+ */
344
+ export declare type BorrowProductNetwork = (typeof BorrowProductNetwork)[keyof typeof BorrowProductNetwork];
345
+
346
+ export declare const BorrowProductNetwork: {
347
+ readonly base: "base";
348
+ };
349
+
350
+ /**
351
+ * The lending protocol that operates the borrow product.
352
+ */
353
+ export declare type BorrowProductProtocol = (typeof BorrowProductProtocol)[keyof typeof BorrowProductProtocol];
354
+
355
+ export declare const BorrowProductProtocol: {
356
+ readonly morpho_blue: "morpho_blue";
357
+ };
358
+
359
+ /**
360
+ * Protocol-specific immutable onchain details that uniquely define a borrow product. The `type` field indicates which protocol-specific schema describes the product's details.
361
+ */
362
+ export declare type BorrowProductProtocolDetails = MorphoBlueProtocolDetails;
363
+
364
+ /**
365
+ * 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.
366
+ */
367
+ export declare interface BorrowProductSnapshot {
368
+ /** The block number at which the state was observed. */
369
+ blockNumber: number;
370
+ /**
371
+ * The hash of the block at which the state was observed.
372
+ * @pattern ^0x[0-9a-fA-F]{64}$
373
+ */
374
+ blockHash: string;
375
+ /** The onchain block timestamp at which the state was observed in Unix seconds. */
376
+ blockTimestamp: number;
377
+ /** The timestamp at which the state was observed. */
378
+ observedAt: string;
379
+ }
380
+
381
+ /**
382
+ * A token on an EVM borrow product network.
383
+ */
384
+ export declare interface BorrowProductToken {
385
+ /**
386
+ * The contract address of the token.
387
+ * @pattern ^0x[0-9a-fA-F]{40}$
388
+ */
389
+ address: string;
390
+ /** The symbol of the token (e.g. USDC, WETH). */
391
+ symbol: string;
392
+ /** The number of decimal places used by the token. */
393
+ decimals: number;
394
+ }
395
+
396
+ /**
397
+ * 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.
398
+ */
399
+ export declare interface BorrowProductVenue {
400
+ /**
401
+ * A stable identifier for the venue, which is a UUID prefixed with the string `bp_venue_`.
402
+ * @pattern ^bp_venue_[a-f0-9-]{36}$
403
+ */
404
+ venueId: string;
405
+ /**
406
+ * The contract address of the venue's entrypoint.
407
+ * @pattern ^0x[0-9a-fA-F]{40}$
408
+ */
409
+ entrypointAddress: string;
410
+ /** A human-readable name for the venue. */
411
+ name: string;
412
+ }
413
+
169
414
  /**
170
415
  * The name of a capability. Capabilities represent granular functional permissions
171
416
  that determine what actions a customer can perform. Each capability must be
@@ -239,6 +484,44 @@ export declare type CdpOptions = {
239
484
  platform?: string;
240
485
  };
241
486
 
487
+ /**
488
+ * A request to close an end user smart account's borrow position for the specified borrow product.
489
+ 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.
490
+ */
491
+ export declare interface CloseBorrowPositionRequest {
492
+ borrowProductId: BorrowProductId;
493
+ /**
494
+ * The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth header.
495
+ * @pattern ^[a-zA-Z0-9-]{1,100}$
496
+ */
497
+ walletSecretId: string;
498
+ /** Whether to use the CDP Paymaster for the user operation. When `true`, `paymasterUrl` must not be set. */
499
+ useCdpPaymaster: boolean;
500
+ /** Paymaster URL to use for the user operation. Must not be set when `useCdpPaymaster` is `true`.
501
+ If `useCdpPaymaster` is `false` and no `paymasterUrl` is set, the smart account must have sufficient funds to cover network fees. */
502
+ paymasterUrl?: Url;
503
+ /** Optional paymaster metadata forwarded to the configured paymaster service. Valid only when a paymaster is configured via `useCdpPaymaster: true` or a `paymasterUrl`. */
504
+ paymasterContext?: PaymasterContext;
505
+ }
506
+
507
+ /**
508
+ * 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.
509
+ 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.
510
+ 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.
511
+ * @summary Close a borrow position for an end user smart account
512
+ */
513
+ export declare const closeBorrowPositionWithEndUserAccount: (userId: string, address: string, closeBorrowPositionRequest: CloseBorrowPositionRequest, params?: CloseBorrowPositionWithEndUserAccountParams, options?: SecondParameter<typeof cdpApiClient<EvmUserOperation>>) => Promise<EvmUserOperation>;
514
+
515
+ export declare type CloseBorrowPositionWithEndUserAccountParams = {
516
+ /**
517
+ * The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
518
+ * @pattern ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
519
+ */
520
+ projectID?: ProjectIDOptionalParameter;
521
+ };
522
+
523
+ export declare type CloseBorrowPositionWithEndUserAccountResult = NonNullable<Awaited<ReturnType<typeof closeBorrowPositionWithEndUserAccount>>>;
524
+
242
525
  /**
243
526
  * Configures the CDP client with the given options.
244
527
  *
@@ -246,6 +529,48 @@ export declare type CdpOptions = {
246
529
  */
247
530
  export declare const configureCdpApiClient: (options: CdpOptions) => void;
248
531
 
532
+ /**
533
+ * A request to create a borrow position for an end user's smart account for the specified borrow product.
534
+ The smart account posts collateral and borrows against it, broadcasting a user operation to open the position onchain.
535
+ */
536
+ export declare interface CreateBorrowPositionRequest {
537
+ borrowProductId: BorrowProductId;
538
+ /** The amount of collateral to post, as a decimal string in standard unit denomination of the collateral token (i.e. "1" for 1 cbBTC). */
539
+ collateralAmount: PositiveDecimal;
540
+ /** 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). */
541
+ loanAmount: PositiveDecimal;
542
+ /**
543
+ * The ID of the Temporary Wallet Secret that was used to sign the X-Wallet-Auth header.
544
+ * @pattern ^[a-zA-Z0-9-]{1,100}$
545
+ */
546
+ walletSecretId: string;
547
+ /** Whether to use the CDP Paymaster for the user operation. When `true`, `paymasterUrl` must not be set. */
548
+ useCdpPaymaster: boolean;
549
+ /** Paymaster URL to use for the user operation. Must not be set when `useCdpPaymaster` is `true`.
550
+ If `useCdpPaymaster` is `false` and no `paymasterUrl` is set, the smart account must have sufficient funds to cover network fees. */
551
+ paymasterUrl?: Url;
552
+ /** Optional paymaster metadata forwarded to the configured paymaster service. Valid only when a paymaster is configured via `useCdpPaymaster: true` or a `paymasterUrl`. */
553
+ paymasterContext?: PaymasterContext;
554
+ }
555
+
556
+ /**
557
+ * 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.
558
+ 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.
559
+ 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.
560
+ * @summary Create a borrow position for an end user smart account
561
+ */
562
+ export declare const createBorrowPositionWithEndUserAccount: (userId: string, address: string, createBorrowPositionRequest: CreateBorrowPositionRequest, params?: CreateBorrowPositionWithEndUserAccountParams, options?: SecondParameter<typeof cdpApiClient<EvmUserOperation>>) => Promise<EvmUserOperation>;
563
+
564
+ export declare type CreateBorrowPositionWithEndUserAccountParams = {
565
+ /**
566
+ * The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
567
+ * @pattern ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
568
+ */
569
+ projectID?: ProjectIDOptionalParameter;
570
+ };
571
+
572
+ export declare type CreateBorrowPositionWithEndUserAccountResult = NonNullable<Awaited<ReturnType<typeof createBorrowPositionWithEndUserAccount>>>;
573
+
249
574
  /**
250
575
  * 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
576
  * @summary Create delegation for end user
@@ -1802,6 +2127,23 @@ export declare type GetEndUserEvmSwapPriceParams = {
1802
2127
 
1803
2128
  export declare type GetEndUserEvmSwapPriceResult = NonNullable<Awaited<ReturnType<typeof getEndUserEvmSwapPrice>>>;
1804
2129
 
2130
+ /**
2131
+ * Gets a single borrow product by its ID.
2132
+ 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.
2133
+ * @summary Get a borrow product
2134
+ */
2135
+ export declare const getEvmBorrowProduct: (borrowProductId: BorrowProductId, params?: GetEvmBorrowProductParams, options?: SecondParameter<typeof cdpApiClient<BorrowProduct>>) => Promise<BorrowProduct>;
2136
+
2137
+ export declare type GetEvmBorrowProductParams = {
2138
+ /**
2139
+ * The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
2140
+ * @pattern ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
2141
+ */
2142
+ projectID?: ProjectIDOptionalParameter;
2143
+ };
2144
+
2145
+ export declare type GetEvmBorrowProductResult = NonNullable<Awaited<ReturnType<typeof getEvmBorrowProduct>>>;
2146
+
1805
2147
  /**
1806
2148
  * 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
2149
  * @summary Get EIP-7702 delegation operation for end user EVM account
@@ -2369,6 +2711,84 @@ export declare const isRefreshTokenUnavailableError: (error: unknown) => error i
2369
2711
  */
2370
2712
  export declare const isTransientTokenReadError: (error: RefreshTokenUnavailableError) => boolean;
2371
2713
 
2714
+ /**
2715
+ * 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.
2716
+ 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.
2717
+ * @summary List borrow positions for an end user smart account
2718
+ */
2719
+ export declare const listBorrowPositionsWithEndUserAccount: (userId: string, address: string, params?: ListBorrowPositionsWithEndUserAccountParams, options?: SecondParameter<typeof cdpApiClient<ListBorrowPositionsWithEndUserAccount200>>) => Promise<ListBorrowPositionsWithEndUserAccount200>;
2720
+
2721
+ export declare type ListBorrowPositionsWithEndUserAccount200 = ListBorrowPositionsWithEndUserAccount200AllOf & ListResponse;
2722
+
2723
+ /**
2724
+ * Response containing a list of borrow positions.
2725
+ */
2726
+ export declare type ListBorrowPositionsWithEndUserAccount200AllOf = {
2727
+ /** The borrow positions held by the smart account. */
2728
+ borrowPositions: BorrowPosition[];
2729
+ };
2730
+
2731
+ export declare type ListBorrowPositionsWithEndUserAccountParams = {
2732
+ /**
2733
+ * The number of resources to return per page.
2734
+ */
2735
+ pageSize?: PageSizeParameter;
2736
+ /**
2737
+ * The token for the next page of resources, if any.
2738
+ */
2739
+ pageToken?: PageTokenParameter;
2740
+ /**
2741
+ * The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
2742
+ * @pattern ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
2743
+ */
2744
+ projectID?: ProjectIDOptionalParameter;
2745
+ };
2746
+
2747
+ export declare type ListBorrowPositionsWithEndUserAccountResult = NonNullable<Awaited<ReturnType<typeof listBorrowPositionsWithEndUserAccount>>>;
2748
+
2749
+ /**
2750
+ * 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.
2751
+ 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.
2752
+ * @summary List borrow products
2753
+ */
2754
+ export declare const listEvmBorrowProducts: (params?: ListEvmBorrowProductsParams, options?: SecondParameter<typeof cdpApiClient<ListEvmBorrowProducts200>>) => Promise<ListEvmBorrowProducts200>;
2755
+
2756
+ export declare type ListEvmBorrowProducts200 = ListEvmBorrowProducts200AllOf & ListResponse;
2757
+
2758
+ /**
2759
+ * Response containing a list of borrow products.
2760
+ */
2761
+ export declare type ListEvmBorrowProducts200AllOf = {
2762
+ /** The list of borrow products, optionally filtered by the supplied network and/or protocol. */
2763
+ borrowProducts: BorrowProduct[];
2764
+ };
2765
+
2766
+ export declare type ListEvmBorrowProductsParams = {
2767
+ /**
2768
+ * The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
2769
+ * @pattern ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
2770
+ */
2771
+ projectID?: ProjectIDOptionalParameter;
2772
+ /**
2773
+ * The EVM network name to list borrow products for.
2774
+ */
2775
+ network?: BorrowProductNetwork;
2776
+ /**
2777
+ * The lending protocol whose borrow products to list.
2778
+ */
2779
+ protocol?: BorrowProductProtocol;
2780
+ /**
2781
+ * The number of resources to return per page.
2782
+ */
2783
+ pageSize?: PageSizeParameter;
2784
+ /**
2785
+ * The token for the next page of resources, if any.
2786
+ */
2787
+ pageToken?: PageTokenParameter;
2788
+ };
2789
+
2790
+ export declare type ListEvmBorrowProductsResult = NonNullable<Awaited<ReturnType<typeof listEvmBorrowProducts>>>;
2791
+
2372
2792
  /**
2373
2793
  * Lists the passkey (WebAuthn) credentials enrolled by the end user. Never returns the COSE public key or other sensitive credential material.
2374
2794
  * @summary List passkeys
@@ -2510,6 +2930,83 @@ export declare type MFAMethodsTotp = {
2510
2930
  enrolledAt: string;
2511
2931
  };
2512
2932
 
2933
+ /**
2934
+ * Morpho Blue's immutable onchain market parameters that uniquely define a borrow product.
2935
+ */
2936
+ export declare interface MorphoBlueMarketParams {
2937
+ /**
2938
+ * The Morpho Blue native bytes32 market ID that uniquely identifies the underlying market onchain.
2939
+ * @pattern ^0x[0-9a-fA-F]{64}$
2940
+ */
2941
+ onchainMarketId: string;
2942
+ /** The token that is borrowed in the product. */
2943
+ loanToken: BorrowProductToken;
2944
+ /** The token posted as collateral in the product. */
2945
+ collateralToken: BorrowProductToken;
2946
+ /**
2947
+ * The contract address of the oracle used to price the collateral token against the loan token.
2948
+ * @pattern ^0x[0-9a-fA-F]{40}$
2949
+ */
2950
+ oracleAddress: string;
2951
+ /**
2952
+ * The contract address of the interest rate model that governs the product's borrow rate.
2953
+ * @pattern ^0x[0-9a-fA-F]{40}$
2954
+ */
2955
+ interestRateModelAddress: string;
2956
+ /**
2957
+ * The liquidation loan-to-value of the product, expressed in basis points. For example, `9150` represents an LLTV of 91.5%.
2958
+ * @minimum 0
2959
+ * @maximum 10000
2960
+ */
2961
+ lltvBps: number;
2962
+ }
2963
+
2964
+ /**
2965
+ * The live onchain state of a Morpho Blue borrow position, read at the block described by the position's snapshot.
2966
+ */
2967
+ export declare interface MorphoBlueOnchainState {
2968
+ type: MorphoBlueOnchainStateType;
2969
+ /** The non-zero collateral balances securing the position. */
2970
+ collateral: BorrowPositionAssetAmount[];
2971
+ /** The non-zero debt balances owed by the position. */
2972
+ debt: BorrowPositionDebt[];
2973
+ /** 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. */
2974
+ healthFactor?: string;
2975
+ /**
2976
+ * 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.
2977
+ * @minimum 0
2978
+ */
2979
+ currentLtvBps?: number;
2980
+ /**
2981
+ * 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.
2982
+ * @minimum 0
2983
+ * @maximum 10000
2984
+ */
2985
+ liquidationThresholdBps?: number;
2986
+ healthStatus: BorrowPositionHealthStatus;
2987
+ }
2988
+
2989
+ export declare type MorphoBlueOnchainStateType = (typeof MorphoBlueOnchainStateType)[keyof typeof MorphoBlueOnchainStateType];
2990
+
2991
+ export declare const MorphoBlueOnchainStateType: {
2992
+ readonly morpho_blue: "morpho_blue";
2993
+ };
2994
+
2995
+ /**
2996
+ * Morpho Blue-specific immutable onchain protocol details that uniquely define a borrow product.
2997
+ */
2998
+ export declare interface MorphoBlueProtocolDetails {
2999
+ type: MorphoBlueProtocolDetailsType;
3000
+ /** The Morpho Blue market parameters that uniquely define the product onchain. */
3001
+ marketParams: MorphoBlueMarketParams;
3002
+ }
3003
+
3004
+ export declare type MorphoBlueProtocolDetailsType = (typeof MorphoBlueProtocolDetailsType)[keyof typeof MorphoBlueProtocolDetailsType];
3005
+
3006
+ export declare const MorphoBlueProtocolDetailsType: {
3007
+ readonly morpho_blue: "morpho_blue";
3008
+ };
3009
+
2513
3010
  /**
2514
3011
  * The blockchain network for the payment. Supported networks depend on the account type.
2515
3012
  */
@@ -2774,6 +3271,12 @@ export declare type PaymentMethodRequiredErrorResponse = Error_2;
2774
3271
  */
2775
3272
  export declare type PhoneNumber = string;
2776
3273
 
3274
+ /**
3275
+ * A positive decimal string without scientific notation or whitespace.
3276
+ * @pattern ^\+?(?:(?:0*[1-9]\d*)(?:\.\d*)?|0*\.\d*[1-9]\d*)$
3277
+ */
3278
+ export declare type PositiveDecimal = string;
3279
+
2777
3280
  /**
2778
3281
  * Configuration for a project.
2779
3282
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinbase/cdp-api-client",
3
- "version": "0.0.123",
3
+ "version": "0.0.124",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist/**",