@compass-labs/api-sdk 2.2.29 → 2.2.30
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.
- package/README.md +2 -2
- package/dist/commonjs/funcs/creditCreditBundle.d.ts +1 -1
- package/dist/commonjs/funcs/creditCreditBundle.js +1 -1
- package/dist/commonjs/funcs/earnEarnVaults.js +1 -0
- package/dist/commonjs/funcs/earnEarnVaults.js.map +1 -1
- package/dist/commonjs/models/components/approvetransferresponse.d.ts +8 -2
- package/dist/commonjs/models/components/approvetransferresponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/approvetransferresponse.js +2 -2
- package/dist/commonjs/models/components/approvetransferresponse.js.map +1 -1
- package/dist/commonjs/models/components/creditborrowrequest.d.ts +10 -10
- package/dist/commonjs/models/components/creditborrowrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditborrowrequest.js +3 -3
- package/dist/commonjs/models/components/creditborrowrequest.js.map +1 -1
- package/dist/commonjs/models/components/creditrepayrequest.d.ts +7 -7
- package/dist/commonjs/models/components/creditrepayrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditrepayrequest.js +2 -2
- package/dist/commonjs/models/components/creditrepayrequest.js.map +1 -1
- package/dist/commonjs/models/components/credittransfertoaddressparams.d.ts +44 -0
- package/dist/commonjs/models/components/credittransfertoaddressparams.d.ts.map +1 -0
- package/dist/commonjs/models/components/credittransfertoaddressparams.js +63 -0
- package/dist/commonjs/models/components/credittransfertoaddressparams.js.map +1 -0
- package/dist/commonjs/models/components/credituseroperation.d.ts +5 -4
- package/dist/commonjs/models/components/credituseroperation.d.ts.map +1 -1
- package/dist/commonjs/models/components/credituseroperation.js +3 -0
- package/dist/commonjs/models/components/credituseroperation.js.map +1 -1
- package/dist/commonjs/models/components/depositforburnresponse.d.ts +8 -2
- package/dist/commonjs/models/components/depositforburnresponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/depositforburnresponse.js +3 -2
- package/dist/commonjs/models/components/depositforburnresponse.js.map +1 -1
- package/dist/commonjs/models/components/earnmanageresponse.d.ts +8 -2
- package/dist/commonjs/models/components/earnmanageresponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/earnmanageresponse.js +3 -2
- package/dist/commonjs/models/components/earnmanageresponse.js.map +1 -1
- package/dist/commonjs/models/components/earnswapresponse.d.ts +11 -2
- package/dist/commonjs/models/components/earnswapresponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/earnswapresponse.js +3 -2
- package/dist/commonjs/models/components/earnswapresponse.js.map +1 -1
- package/dist/commonjs/models/components/earntransferresponse.d.ts +11 -2
- package/dist/commonjs/models/components/earntransferresponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/earntransferresponse.js +2 -2
- package/dist/commonjs/models/components/earntransferresponse.js.map +1 -1
- package/dist/commonjs/models/components/index.d.ts +1 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +1 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/marketallocation.d.ts +9 -9
- package/dist/commonjs/models/components/vaultinfo.d.ts +11 -3
- package/dist/commonjs/models/components/vaultinfo.d.ts.map +1 -1
- package/dist/commonjs/models/components/vaultinfo.js +4 -0
- package/dist/commonjs/models/components/vaultinfo.js.map +1 -1
- package/dist/commonjs/models/operations/v2earnvaults.d.ts +14 -0
- package/dist/commonjs/models/operations/v2earnvaults.d.ts.map +1 -1
- package/dist/commonjs/models/operations/v2earnvaults.js +9 -1
- package/dist/commonjs/models/operations/v2earnvaults.js.map +1 -1
- package/dist/commonjs/sdk/credit.d.ts +1 -1
- package/dist/commonjs/sdk/credit.js +1 -1
- package/dist/esm/funcs/creditCreditBundle.d.ts +1 -1
- package/dist/esm/funcs/creditCreditBundle.js +1 -1
- package/dist/esm/funcs/earnEarnVaults.js +1 -0
- package/dist/esm/funcs/earnEarnVaults.js.map +1 -1
- package/dist/esm/models/components/approvetransferresponse.d.ts +8 -2
- package/dist/esm/models/components/approvetransferresponse.d.ts.map +1 -1
- package/dist/esm/models/components/approvetransferresponse.js +2 -2
- package/dist/esm/models/components/approvetransferresponse.js.map +1 -1
- package/dist/esm/models/components/creditborrowrequest.d.ts +10 -10
- package/dist/esm/models/components/creditborrowrequest.d.ts.map +1 -1
- package/dist/esm/models/components/creditborrowrequest.js +3 -3
- package/dist/esm/models/components/creditborrowrequest.js.map +1 -1
- package/dist/esm/models/components/creditrepayrequest.d.ts +7 -7
- package/dist/esm/models/components/creditrepayrequest.d.ts.map +1 -1
- package/dist/esm/models/components/creditrepayrequest.js +2 -2
- package/dist/esm/models/components/creditrepayrequest.js.map +1 -1
- package/dist/esm/models/components/credittransfertoaddressparams.d.ts +44 -0
- package/dist/esm/models/components/credittransfertoaddressparams.d.ts.map +1 -0
- package/dist/esm/models/components/credittransfertoaddressparams.js +25 -0
- package/dist/esm/models/components/credittransfertoaddressparams.js.map +1 -0
- package/dist/esm/models/components/credituseroperation.d.ts +5 -4
- package/dist/esm/models/components/credituseroperation.d.ts.map +1 -1
- package/dist/esm/models/components/credituseroperation.js +3 -0
- package/dist/esm/models/components/credituseroperation.js.map +1 -1
- package/dist/esm/models/components/depositforburnresponse.d.ts +8 -2
- package/dist/esm/models/components/depositforburnresponse.d.ts.map +1 -1
- package/dist/esm/models/components/depositforburnresponse.js +3 -2
- package/dist/esm/models/components/depositforburnresponse.js.map +1 -1
- package/dist/esm/models/components/earnmanageresponse.d.ts +8 -2
- package/dist/esm/models/components/earnmanageresponse.d.ts.map +1 -1
- package/dist/esm/models/components/earnmanageresponse.js +3 -2
- package/dist/esm/models/components/earnmanageresponse.js.map +1 -1
- package/dist/esm/models/components/earnswapresponse.d.ts +11 -2
- package/dist/esm/models/components/earnswapresponse.d.ts.map +1 -1
- package/dist/esm/models/components/earnswapresponse.js +3 -2
- package/dist/esm/models/components/earnswapresponse.js.map +1 -1
- package/dist/esm/models/components/earntransferresponse.d.ts +11 -2
- package/dist/esm/models/components/earntransferresponse.d.ts.map +1 -1
- package/dist/esm/models/components/earntransferresponse.js +2 -2
- package/dist/esm/models/components/earntransferresponse.js.map +1 -1
- package/dist/esm/models/components/index.d.ts +1 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +1 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/marketallocation.d.ts +9 -9
- package/dist/esm/models/components/vaultinfo.d.ts +11 -3
- package/dist/esm/models/components/vaultinfo.d.ts.map +1 -1
- package/dist/esm/models/components/vaultinfo.js +4 -0
- package/dist/esm/models/components/vaultinfo.js.map +1 -1
- package/dist/esm/models/operations/v2earnvaults.d.ts +14 -0
- package/dist/esm/models/operations/v2earnvaults.d.ts.map +1 -1
- package/dist/esm/models/operations/v2earnvaults.js +7 -0
- package/dist/esm/models/operations/v2earnvaults.js.map +1 -1
- package/dist/esm/sdk/credit.d.ts +1 -1
- package/dist/esm/sdk/credit.js +1 -1
- package/docs/models/components/approvetransferresponse.md +3 -40
- package/docs/models/components/creditborrowrequest.md +3 -3
- package/docs/models/components/creditborrowrequestamountin.md +1 -1
- package/docs/models/components/creditrepayrequest.md +2 -2
- package/docs/models/components/credittransfertoaddressparams.md +28 -0
- package/docs/models/components/credittransfertoaddressparamsamount.md +19 -0
- package/docs/models/components/credituseroperationbody.md +11 -0
- package/docs/models/components/depositforburnresponse.md +3 -37
- package/docs/models/components/earnmanageresponse.md +3 -16
- package/docs/models/components/earnswapresponse.md +3 -37
- package/docs/models/components/earntransferresponse.md +4 -15
- package/docs/models/components/earntransferresponseeip712.md +2 -0
- package/docs/models/components/marketallocation.md +11 -11
- package/docs/models/components/permittypeddataresponseoutput.md +7 -2
- package/docs/models/components/vaultinfo.md +18 -16
- package/docs/models/components/withdrawamount.md +1 -1
- package/docs/models/operations/mindepositcapusd.md +19 -0
- package/docs/models/operations/v2earnvaultsrequest.md +11 -10
- package/docs/sdks/credit/README.md +1 -1
- package/package.json +1 -1
- package/src/funcs/creditCreditBundle.ts +1 -1
- package/src/funcs/earnEarnVaults.ts +1 -0
- package/src/models/components/approvetransferresponse.ts +10 -4
- package/src/models/components/creditborrowrequest.ts +13 -13
- package/src/models/components/creditrepayrequest.ts +9 -9
- package/src/models/components/credittransfertoaddressparams.ts +89 -0
- package/src/models/components/credituseroperation.ts +11 -0
- package/src/models/components/depositforburnresponse.ts +11 -4
- package/src/models/components/earnmanageresponse.ts +11 -4
- package/src/models/components/earnswapresponse.ts +14 -4
- package/src/models/components/earntransferresponse.ts +17 -4
- package/src/models/components/index.ts +1 -0
- package/src/models/components/marketallocation.ts +9 -9
- package/src/models/components/vaultinfo.ts +15 -3
- package/src/models/operations/v2earnvaults.ts +30 -0
- package/src/sdk/credit.ts +1 -1
|
@@ -17,14 +17,14 @@ let value: MarketAllocation = {
|
|
|
17
17
|
|
|
18
18
|
## Fields
|
|
19
19
|
|
|
20
|
-
| Field
|
|
21
|
-
|
|
|
22
|
-
| `marketId`
|
|
23
|
-
| `loanToken`
|
|
24
|
-
| `loanTokenSymbol`
|
|
25
|
-
| `collateralToken`
|
|
26
|
-
| `collateralTokenSymbol`
|
|
27
|
-
| `lltv`
|
|
28
|
-
| `supplyCap`
|
|
29
|
-
| `supplyAssets`
|
|
30
|
-
| `allocationPct`
|
|
20
|
+
| Field | Type | Required | Description |
|
|
21
|
+
| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ |
|
|
22
|
+
| `marketId` | *string* | :heavy_check_mark: | Morpho Blue market unique identifier (bytes32 hex string). |
|
|
23
|
+
| `loanToken` | *string* | :heavy_check_mark: | Address of the token being lent in this market. |
|
|
24
|
+
| `loanTokenSymbol` | *string* | :heavy_minus_sign: | Symbol of the loan token (e.g., 'USDC'). |
|
|
25
|
+
| `collateralToken` | *string* | :heavy_check_mark: | Address of the collateral token accepted by this market. |
|
|
26
|
+
| `collateralTokenSymbol` | *string* | :heavy_minus_sign: | Symbol of the collateral token (e.g., 'WETH'). |
|
|
27
|
+
| `lltv` | *string* | :heavy_check_mark: | Liquidation Loan-To-Value ratio as a raw uint256 string. Divide by 1e18 to get the decimal ratio (e.g., '860000000000000000' = 86%). |
|
|
28
|
+
| `supplyCap` | *string* | :heavy_minus_sign: | Maximum amount the vault is allowed to supply to this market, as a raw uint184 string in the smallest token unit. |
|
|
29
|
+
| `supplyAssets` | *string* | :heavy_minus_sign: | Amount currently supplied by the vault to this market, in the smallest token unit (converted from shares). |
|
|
30
|
+
| `allocationPct` | *number* | :heavy_minus_sign: | Percentage of the vault's total supplied capital allocated to this market (e.g., 45.5 means 45.5%). |
|
|
@@ -11,7 +11,7 @@ let value: PermitTypedDataResponseOutput = {
|
|
|
11
11
|
domain: {
|
|
12
12
|
name: "<value>",
|
|
13
13
|
version: "<value>",
|
|
14
|
-
chainId:
|
|
14
|
+
chainId: 499115,
|
|
15
15
|
verifyingContract: "<value>",
|
|
16
16
|
},
|
|
17
17
|
types: {
|
|
@@ -21,7 +21,12 @@ let value: PermitTypedDataResponseOutput = {
|
|
|
21
21
|
type: "<value>",
|
|
22
22
|
},
|
|
23
23
|
],
|
|
24
|
-
permit: [
|
|
24
|
+
permit: [
|
|
25
|
+
{
|
|
26
|
+
name: "<value>",
|
|
27
|
+
type: "<value>",
|
|
28
|
+
},
|
|
29
|
+
],
|
|
25
30
|
},
|
|
26
31
|
primaryType: "Permit",
|
|
27
32
|
message: {
|
|
@@ -17,19 +17,21 @@ let value: VaultInfo = {
|
|
|
17
17
|
|
|
18
18
|
## Fields
|
|
19
19
|
|
|
20
|
-
| Field
|
|
21
|
-
|
|
|
22
|
-
| `vaultAddress`
|
|
23
|
-
| `chain`
|
|
24
|
-
| `name`
|
|
25
|
-
| `symbol`
|
|
26
|
-
| `owner`
|
|
27
|
-
| `asset`
|
|
28
|
-
| `assetName`
|
|
29
|
-
| `assetSymbol`
|
|
30
|
-
| `tvlUsd`
|
|
31
|
-
| `liquidityUsd`
|
|
32
|
-
| `
|
|
33
|
-
| `
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
20
|
+
| Field | Type | Required | Description |
|
|
21
|
+
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
22
|
+
| `vaultAddress` | *string* | :heavy_check_mark: | The vault contract address. |
|
|
23
|
+
| `chain` | *string* | :heavy_check_mark: | Blockchain name (e.g., 'ethereum', 'base'). |
|
|
24
|
+
| `name` | *string* | :heavy_minus_sign: | The name of the vault. |
|
|
25
|
+
| `symbol` | *string* | :heavy_minus_sign: | The vault share token symbol. |
|
|
26
|
+
| `owner` | *string* | :heavy_check_mark: | The vault owner address. |
|
|
27
|
+
| `asset` | *string* | :heavy_check_mark: | The underlying asset contract address. |
|
|
28
|
+
| `assetName` | *string* | :heavy_minus_sign: | The name of the underlying asset. |
|
|
29
|
+
| `assetSymbol` | *string* | :heavy_minus_sign: | The symbol of the underlying asset (e.g., 'USDC'). |
|
|
30
|
+
| `tvlUsd` | *string* | :heavy_minus_sign: | Total Value Locked in USD. Represents the total assets deposited in the vault. |
|
|
31
|
+
| `liquidityUsd` | *string* | :heavy_minus_sign: | Available liquidity in USD. The amount that can be withdrawn right now, accounting for idle funds and borrowable supply across the vault's markets. Always <= tvl_usd. |
|
|
32
|
+
| `depositCap` | *string* | :heavy_minus_sign: | Maximum additional amount that can be deposited into the vault, in human-readable token units (e.g., 1000.5 USDC). Derived from the ERC4626 maxDeposit function. A value of 0 means the vault is paused or full. |
|
|
33
|
+
| `depositCapUsd` | *string* | :heavy_minus_sign: | Maximum additional depositable amount converted to USD. |
|
|
34
|
+
| `apy7d` | *string* | :heavy_minus_sign: | 7-day APY as a percentage (e.g., 5.25 = 5.25%). |
|
|
35
|
+
| `apy30d` | *string* | :heavy_minus_sign: | 30-day APY as a percentage. |
|
|
36
|
+
| `apy90d` | *string* | :heavy_minus_sign: | 90-day APY as a percentage. |
|
|
37
|
+
| `markets` | [components.MarketAllocation](../../models/components/marketallocation.md)[] | :heavy_minus_sign: | Morpho Blue markets in this vault's supply queue, ordered by queue index. Shows how the vault's capital is split across lending markets with different collateral types and risk parameters. |
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# MinDepositCapUsd
|
|
2
|
+
|
|
3
|
+
Minimum deposit capacity in USD. Vaults below this are excluded. Set to 0 to exclude paused vaults.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Supported Types
|
|
7
|
+
|
|
8
|
+
### `number`
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
const value: number = 1284.03;
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
### `string`
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
const value: string = "<value>";
|
|
18
|
+
```
|
|
19
|
+
|
|
@@ -15,13 +15,14 @@ let value: V2EarnVaultsRequest = {
|
|
|
15
15
|
|
|
16
16
|
## Fields
|
|
17
17
|
|
|
18
|
-
| Field
|
|
19
|
-
|
|
|
20
|
-
| `orderBy`
|
|
21
|
-
| `direction`
|
|
22
|
-
| `offset`
|
|
23
|
-
| `limit`
|
|
24
|
-
| `chain`
|
|
25
|
-
| `assetSymbol`
|
|
26
|
-
| `minTvlUsd`
|
|
27
|
-
| `minLiquidityUsd`
|
|
18
|
+
| Field | Type | Required | Description | Example |
|
|
19
|
+
| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
|
|
20
|
+
| `orderBy` | *string* | :heavy_check_mark: | The field to order the results by. | tvl_usd |
|
|
21
|
+
| `direction` | [operations.V2EarnVaultsDirection](../../models/operations/v2earnvaultsdirection.md) | :heavy_minus_sign: | The direction to order the results by. | desc |
|
|
22
|
+
| `offset` | *number* | :heavy_minus_sign: | The offset of the first item to return. | 0 |
|
|
23
|
+
| `limit` | *number* | :heavy_minus_sign: | The number of items to return. | 50 |
|
|
24
|
+
| `chain` | [components.Chain](../../models/components/chain.md) | :heavy_minus_sign: | Optional chain filter. If not provided, returns vaults for all chains. | |
|
|
25
|
+
| `assetSymbol` | *string* | :heavy_minus_sign: | Filter vaults by underlying asset symbol (e.g., 'USDC', 'WETH'). | |
|
|
26
|
+
| `minTvlUsd` | *operations.V2EarnVaultsMinTvlUsd* | :heavy_minus_sign: | Minimum TVL in USD. Vaults with TVL below this value will be excluded. | |
|
|
27
|
+
| `minLiquidityUsd` | *operations.MinLiquidityUsd* | :heavy_minus_sign: | Minimum available liquidity in USD. Vaults below this are excluded. | |
|
|
28
|
+
| `minDepositCapUsd` | *operations.MinDepositCapUsd* | :heavy_minus_sign: | Minimum deposit capacity in USD. Vaults below this are excluded. Set to 0 to exclude paused vaults. | |
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* [creditBorrow](#creditborrow) - Borrow against collateral
|
|
10
10
|
* [creditTransfer](#credittransfer) - Transfer tokens to/from Credit Account
|
|
11
11
|
* [creditRepay](#creditrepay) - Repay debt and withdraw collateral
|
|
12
|
-
* [creditBundle](#creditbundle) - Execute multiple credit actions
|
|
12
|
+
* [creditBundle](#creditbundle) - Execute multiple credit actions
|
|
13
13
|
|
|
14
14
|
## creditPositions
|
|
15
15
|
|
package/package.json
CHANGED
|
@@ -26,7 +26,7 @@ import { APICall, APIPromise } from "../types/async.js";
|
|
|
26
26
|
import { Result } from "../types/fp.js";
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
* Execute multiple credit actions
|
|
29
|
+
* Execute multiple credit actions
|
|
30
30
|
*
|
|
31
31
|
* @remarks
|
|
32
32
|
* Compose individual credit operations (supply, withdraw, borrow, repay, swap, transfer)
|
|
@@ -102,6 +102,7 @@ async function $do(
|
|
|
102
102
|
"chain": payload.chain,
|
|
103
103
|
"direction": payload.direction,
|
|
104
104
|
"limit": payload.limit,
|
|
105
|
+
"min_deposit_cap_usd": payload.min_deposit_cap_usd,
|
|
105
106
|
"min_liquidity_usd": payload.min_liquidity_usd,
|
|
106
107
|
"min_tvl_usd": payload.min_tvl_usd,
|
|
107
108
|
"offset": payload.offset,
|
|
@@ -17,8 +17,14 @@ import {
|
|
|
17
17
|
} from "./unsignedtransaction.js";
|
|
18
18
|
|
|
19
19
|
export type ApproveTransferResponse = {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Unsigned approval transaction. Present when gas_sponsorship=false.
|
|
22
|
+
*/
|
|
23
|
+
transaction?: UnsignedTransaction | null | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* EIP-712 typed data for off-chain permit signing. Present when gas_sponsorship=true.
|
|
26
|
+
*/
|
|
27
|
+
eip712?: PermitTypedDataResponseOutput | null | undefined;
|
|
22
28
|
};
|
|
23
29
|
|
|
24
30
|
/** @internal */
|
|
@@ -27,8 +33,8 @@ export const ApproveTransferResponse$inboundSchema: z.ZodType<
|
|
|
27
33
|
z.ZodTypeDef,
|
|
28
34
|
unknown
|
|
29
35
|
> = z.object({
|
|
30
|
-
transaction: z.nullable(UnsignedTransaction$inboundSchema),
|
|
31
|
-
eip_712: z.nullable(PermitTypedDataResponseOutput$inboundSchema),
|
|
36
|
+
transaction: z.nullable(UnsignedTransaction$inboundSchema).optional(),
|
|
37
|
+
eip_712: z.nullable(PermitTypedDataResponseOutput$inboundSchema).optional(),
|
|
32
38
|
}).transform((v) => {
|
|
33
39
|
return remap$(v, {
|
|
34
40
|
"eip_712": "eip712",
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./interestratemode.js";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Amount of token_in to use (in token units, not wei).
|
|
14
|
+
* Amount of token_in to use (in token units, not wei). Omit together with token_in and collateral_token for borrow-only mode.
|
|
15
15
|
*/
|
|
16
16
|
export type CreditBorrowRequestAmountIn = number | string;
|
|
17
17
|
|
|
@@ -35,17 +35,17 @@ export type CreditBorrowRequest = {
|
|
|
35
35
|
*/
|
|
36
36
|
chain: Chain;
|
|
37
37
|
/**
|
|
38
|
-
* Token currently held in the Credit Account to use as input. If the same as collateral_token, no swap is performed.
|
|
38
|
+
* Token currently held in the Credit Account to use as input. If the same as collateral_token, no swap is performed. Omit together with amount_in and collateral_token to borrow against existing collateral.
|
|
39
39
|
*/
|
|
40
|
-
tokenIn
|
|
40
|
+
tokenIn?: string | null | undefined;
|
|
41
41
|
/**
|
|
42
|
-
* Amount of token_in to use (in token units, not wei).
|
|
42
|
+
* Amount of token_in to use (in token units, not wei). Omit together with token_in and collateral_token for borrow-only mode.
|
|
43
43
|
*/
|
|
44
|
-
amountIn
|
|
44
|
+
amountIn?: number | string | null | undefined;
|
|
45
45
|
/**
|
|
46
|
-
* Aave reserve token to supply as collateral.
|
|
46
|
+
* Aave reserve token to supply as collateral. Omit together with token_in and amount_in for borrow-only mode.
|
|
47
47
|
*/
|
|
48
|
-
collateralToken
|
|
48
|
+
collateralToken?: string | null | undefined;
|
|
49
49
|
/**
|
|
50
50
|
* Asset to borrow from Aave.
|
|
51
51
|
*/
|
|
@@ -142,9 +142,9 @@ export function creditBorrowRequestSlippageToJSON(
|
|
|
142
142
|
export type CreditBorrowRequest$Outbound = {
|
|
143
143
|
owner: string;
|
|
144
144
|
chain: string;
|
|
145
|
-
token_in
|
|
146
|
-
amount_in
|
|
147
|
-
collateral_token
|
|
145
|
+
token_in?: string | null | undefined;
|
|
146
|
+
amount_in?: number | string | null | undefined;
|
|
147
|
+
collateral_token?: string | null | undefined;
|
|
148
148
|
borrow_token: string;
|
|
149
149
|
borrow_amount: number | string;
|
|
150
150
|
interest_rate_mode?: string | undefined;
|
|
@@ -163,9 +163,9 @@ export const CreditBorrowRequest$outboundSchema: z.ZodType<
|
|
|
163
163
|
> = z.object({
|
|
164
164
|
owner: z.string(),
|
|
165
165
|
chain: Chain$outboundSchema,
|
|
166
|
-
tokenIn: z.string(),
|
|
167
|
-
amountIn: z.union([z.number(), z.string()]),
|
|
168
|
-
collateralToken: z.string(),
|
|
166
|
+
tokenIn: z.nullable(z.string()).optional(),
|
|
167
|
+
amountIn: z.nullable(z.union([z.number(), z.string()])).optional(),
|
|
168
|
+
collateralToken: z.nullable(z.string()).optional(),
|
|
169
169
|
borrowToken: z.string(),
|
|
170
170
|
borrowAmount: z.union([z.number(), z.string()]),
|
|
171
171
|
interestRateMode: InterestRateMode$outboundSchema.optional(),
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
export type RepayAmount = number | string;
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* Amount of collateral to withdraw (in token units, not wei).
|
|
19
|
+
* Amount of collateral to withdraw (in token units, not wei). Omit together with withdraw_token for repay-only mode.
|
|
20
20
|
*/
|
|
21
21
|
export type WithdrawAmount = number | string;
|
|
22
22
|
|
|
@@ -51,13 +51,13 @@ export type CreditRepayRequest = {
|
|
|
51
51
|
*/
|
|
52
52
|
interestRateMode?: InterestRateMode | undefined;
|
|
53
53
|
/**
|
|
54
|
-
* Collateral token to withdraw from Aave after repaying debt.
|
|
54
|
+
* Collateral token to withdraw from Aave after repaying debt. Omit together with withdraw_amount for repay-only mode.
|
|
55
55
|
*/
|
|
56
|
-
withdrawToken
|
|
56
|
+
withdrawToken?: string | null | undefined;
|
|
57
57
|
/**
|
|
58
|
-
* Amount of collateral to withdraw (in token units, not wei).
|
|
58
|
+
* Amount of collateral to withdraw (in token units, not wei). Omit together with withdraw_token for repay-only mode.
|
|
59
59
|
*/
|
|
60
|
-
withdrawAmount
|
|
60
|
+
withdrawAmount?: number | string | null | undefined;
|
|
61
61
|
/**
|
|
62
62
|
* Desired output token. If different from withdraw_token, a swap is performed after withdrawal. If None, the withdrawn collateral is kept as-is.
|
|
63
63
|
*/
|
|
@@ -137,8 +137,8 @@ export type CreditRepayRequest$Outbound = {
|
|
|
137
137
|
repay_token: string;
|
|
138
138
|
repay_amount: number | string;
|
|
139
139
|
interest_rate_mode?: string | undefined;
|
|
140
|
-
withdraw_token
|
|
141
|
-
withdraw_amount
|
|
140
|
+
withdraw_token?: string | null | undefined;
|
|
141
|
+
withdraw_amount?: number | string | null | undefined;
|
|
142
142
|
token_out?: string | null | undefined;
|
|
143
143
|
slippage?: number | string | undefined;
|
|
144
144
|
gas_sponsorship?: boolean | undefined;
|
|
@@ -158,8 +158,8 @@ export const CreditRepayRequest$outboundSchema: z.ZodType<
|
|
|
158
158
|
repayToken: z.string(),
|
|
159
159
|
repayAmount: z.union([z.number(), z.string()]),
|
|
160
160
|
interestRateMode: InterestRateMode$outboundSchema.optional(),
|
|
161
|
-
withdrawToken: z.string(),
|
|
162
|
-
withdrawAmount: z.union([z.number(), z.string()]),
|
|
161
|
+
withdrawToken: z.nullable(z.string()).optional(),
|
|
162
|
+
withdrawAmount: z.nullable(z.union([z.number(), z.string()])).optional(),
|
|
163
163
|
tokenOut: z.nullable(z.string()).optional(),
|
|
164
164
|
slippage: z.union([z.number(), z.string()]).optional(),
|
|
165
165
|
gasSponsorship: z.boolean().optional(),
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The amount of tokens to transfer (in token units, not wei).
|
|
10
|
+
*/
|
|
11
|
+
export type CreditTransferToAddressParamsAmount = number | string;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Transfer tokens from Credit Account to an arbitrary address.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
*
|
|
18
|
+
* Requires all debt positions to be fully repaid (totalDebtBase == 0)
|
|
19
|
+
* before the transfer is allowed.
|
|
20
|
+
*/
|
|
21
|
+
export type CreditTransferToAddressParams = {
|
|
22
|
+
actionType: "CREDIT_TRANSFER_TO_ADDRESS";
|
|
23
|
+
/**
|
|
24
|
+
* The ERC20 token to transfer from the Credit Account.
|
|
25
|
+
*/
|
|
26
|
+
token: string;
|
|
27
|
+
/**
|
|
28
|
+
* The amount of tokens to transfer (in token units, not wei).
|
|
29
|
+
*/
|
|
30
|
+
amount: number | string;
|
|
31
|
+
/**
|
|
32
|
+
* The destination address to receive the tokens.
|
|
33
|
+
*/
|
|
34
|
+
recipient: string;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** @internal */
|
|
38
|
+
export type CreditTransferToAddressParamsAmount$Outbound = number | string;
|
|
39
|
+
|
|
40
|
+
/** @internal */
|
|
41
|
+
export const CreditTransferToAddressParamsAmount$outboundSchema: z.ZodType<
|
|
42
|
+
CreditTransferToAddressParamsAmount$Outbound,
|
|
43
|
+
z.ZodTypeDef,
|
|
44
|
+
CreditTransferToAddressParamsAmount
|
|
45
|
+
> = z.union([z.number(), z.string()]);
|
|
46
|
+
|
|
47
|
+
export function creditTransferToAddressParamsAmountToJSON(
|
|
48
|
+
creditTransferToAddressParamsAmount: CreditTransferToAddressParamsAmount,
|
|
49
|
+
): string {
|
|
50
|
+
return JSON.stringify(
|
|
51
|
+
CreditTransferToAddressParamsAmount$outboundSchema.parse(
|
|
52
|
+
creditTransferToAddressParamsAmount,
|
|
53
|
+
),
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** @internal */
|
|
58
|
+
export type CreditTransferToAddressParams$Outbound = {
|
|
59
|
+
action_type: "CREDIT_TRANSFER_TO_ADDRESS";
|
|
60
|
+
token: string;
|
|
61
|
+
amount: number | string;
|
|
62
|
+
recipient: string;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/** @internal */
|
|
66
|
+
export const CreditTransferToAddressParams$outboundSchema: z.ZodType<
|
|
67
|
+
CreditTransferToAddressParams$Outbound,
|
|
68
|
+
z.ZodTypeDef,
|
|
69
|
+
CreditTransferToAddressParams
|
|
70
|
+
> = z.object({
|
|
71
|
+
actionType: z.literal("CREDIT_TRANSFER_TO_ADDRESS"),
|
|
72
|
+
token: z.string(),
|
|
73
|
+
amount: z.union([z.number(), z.string()]),
|
|
74
|
+
recipient: z.string(),
|
|
75
|
+
}).transform((v) => {
|
|
76
|
+
return remap$(v, {
|
|
77
|
+
actionType: "action_type",
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
export function creditTransferToAddressParamsToJSON(
|
|
82
|
+
creditTransferToAddressParams: CreditTransferToAddressParams,
|
|
83
|
+
): string {
|
|
84
|
+
return JSON.stringify(
|
|
85
|
+
CreditTransferToAddressParams$outboundSchema.parse(
|
|
86
|
+
creditTransferToAddressParams,
|
|
87
|
+
),
|
|
88
|
+
);
|
|
89
|
+
}
|
|
@@ -23,6 +23,11 @@ import {
|
|
|
23
23
|
CreditSupplyParams$Outbound,
|
|
24
24
|
CreditSupplyParams$outboundSchema,
|
|
25
25
|
} from "./creditsupplyparams.js";
|
|
26
|
+
import {
|
|
27
|
+
CreditTransferToAddressParams,
|
|
28
|
+
CreditTransferToAddressParams$Outbound,
|
|
29
|
+
CreditTransferToAddressParams$outboundSchema,
|
|
30
|
+
} from "./credittransfertoaddressparams.js";
|
|
26
31
|
import {
|
|
27
32
|
CreditWithdrawParams,
|
|
28
33
|
CreditWithdrawParams$Outbound,
|
|
@@ -49,6 +54,7 @@ export type CreditUserOperationBody =
|
|
|
49
54
|
| CreditEnableCollateralParams
|
|
50
55
|
| CreditRepayParams
|
|
51
56
|
| CreditSupplyParams
|
|
57
|
+
| CreditTransferToAddressParams
|
|
52
58
|
| CreditWithdrawParams
|
|
53
59
|
| EarnSwapParams
|
|
54
60
|
| EarnTransferFromEOAParams
|
|
@@ -63,6 +69,7 @@ export type CreditUserOperation = {
|
|
|
63
69
|
| CreditEnableCollateralParams
|
|
64
70
|
| CreditRepayParams
|
|
65
71
|
| CreditSupplyParams
|
|
72
|
+
| CreditTransferToAddressParams
|
|
66
73
|
| CreditWithdrawParams
|
|
67
74
|
| EarnSwapParams
|
|
68
75
|
| EarnTransferFromEOAParams
|
|
@@ -75,6 +82,7 @@ export type CreditUserOperationBody$Outbound =
|
|
|
75
82
|
| CreditEnableCollateralParams$Outbound
|
|
76
83
|
| CreditRepayParams$Outbound
|
|
77
84
|
| CreditSupplyParams$Outbound
|
|
85
|
+
| CreditTransferToAddressParams$Outbound
|
|
78
86
|
| CreditWithdrawParams$Outbound
|
|
79
87
|
| EarnSwapParams$Outbound
|
|
80
88
|
| EarnTransferFromEOAParams$Outbound
|
|
@@ -90,6 +98,7 @@ export const CreditUserOperationBody$outboundSchema: z.ZodType<
|
|
|
90
98
|
CreditEnableCollateralParams$outboundSchema,
|
|
91
99
|
CreditRepayParams$outboundSchema,
|
|
92
100
|
CreditSupplyParams$outboundSchema,
|
|
101
|
+
CreditTransferToAddressParams$outboundSchema,
|
|
93
102
|
CreditWithdrawParams$outboundSchema,
|
|
94
103
|
EarnSwapParams$outboundSchema,
|
|
95
104
|
EarnTransferFromEOAParams$outboundSchema,
|
|
@@ -111,6 +120,7 @@ export type CreditUserOperation$Outbound = {
|
|
|
111
120
|
| CreditEnableCollateralParams$Outbound
|
|
112
121
|
| CreditRepayParams$Outbound
|
|
113
122
|
| CreditSupplyParams$Outbound
|
|
123
|
+
| CreditTransferToAddressParams$Outbound
|
|
114
124
|
| CreditWithdrawParams$Outbound
|
|
115
125
|
| EarnSwapParams$Outbound
|
|
116
126
|
| EarnTransferFromEOAParams$Outbound
|
|
@@ -128,6 +138,7 @@ export const CreditUserOperation$outboundSchema: z.ZodType<
|
|
|
128
138
|
CreditEnableCollateralParams$outboundSchema,
|
|
129
139
|
CreditRepayParams$outboundSchema,
|
|
130
140
|
CreditSupplyParams$outboundSchema,
|
|
141
|
+
CreditTransferToAddressParams$outboundSchema,
|
|
131
142
|
CreditWithdrawParams$outboundSchema,
|
|
132
143
|
EarnSwapParams$outboundSchema,
|
|
133
144
|
EarnTransferFromEOAParams$outboundSchema,
|
|
@@ -45,8 +45,14 @@ export type DepositForBurnResponse = {
|
|
|
45
45
|
* Unique bridge identifier for tracking this cross-chain transfer. Use this ID when calling /mint/prepare to complete the transfer. Only present when Redis is configured on the server.
|
|
46
46
|
*/
|
|
47
47
|
bridgeId?: string | null | undefined;
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Unsigned transaction for direct execution. Present when gas_sponsorship=false.
|
|
50
|
+
*/
|
|
51
|
+
transaction?: UnsignedTransaction | null | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* EIP-712 typed data for gas-sponsored execution. Present when gas_sponsorship=true.
|
|
54
|
+
*/
|
|
55
|
+
eip712?: BatchedSafeOperationsResponseOutput | null | undefined;
|
|
50
56
|
/**
|
|
51
57
|
* The transfer speed mode used. 'fast' uses confirmed finality (~30s), 'standard' uses full finality (~15-19 min).
|
|
52
58
|
*/
|
|
@@ -73,8 +79,9 @@ export const DepositForBurnResponse$inboundSchema: z.ZodType<
|
|
|
73
79
|
unknown
|
|
74
80
|
> = z.object({
|
|
75
81
|
bridge_id: z.nullable(z.string()).optional(),
|
|
76
|
-
transaction: z.nullable(UnsignedTransaction$inboundSchema),
|
|
77
|
-
eip_712: z.nullable(BatchedSafeOperationsResponseOutput$inboundSchema)
|
|
82
|
+
transaction: z.nullable(UnsignedTransaction$inboundSchema).optional(),
|
|
83
|
+
eip_712: z.nullable(BatchedSafeOperationsResponseOutput$inboundSchema)
|
|
84
|
+
.optional(),
|
|
78
85
|
transfer_mode: DepositForBurnResponseTransferMode$inboundSchema,
|
|
79
86
|
fee: z.nullable(z.string()).optional(),
|
|
80
87
|
estimated_time_seconds: z.number().int(),
|
|
@@ -17,8 +17,14 @@ import {
|
|
|
17
17
|
} from "./unsignedtransaction.js";
|
|
18
18
|
|
|
19
19
|
export type EarnManageResponse = {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Unsigned transaction for direct execution. Present when gas_sponsorship=false.
|
|
22
|
+
*/
|
|
23
|
+
transaction?: UnsignedTransaction | null | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* EIP-712 typed data for gas-sponsored execution. Present when gas_sponsorship=true.
|
|
26
|
+
*/
|
|
27
|
+
eip712?: BatchedSafeOperationsResponseOutput | null | undefined;
|
|
22
28
|
};
|
|
23
29
|
|
|
24
30
|
/** @internal */
|
|
@@ -27,8 +33,9 @@ export const EarnManageResponse$inboundSchema: z.ZodType<
|
|
|
27
33
|
z.ZodTypeDef,
|
|
28
34
|
unknown
|
|
29
35
|
> = z.object({
|
|
30
|
-
transaction: z.nullable(UnsignedTransaction$inboundSchema),
|
|
31
|
-
eip_712: z.nullable(BatchedSafeOperationsResponseOutput$inboundSchema)
|
|
36
|
+
transaction: z.nullable(UnsignedTransaction$inboundSchema).optional(),
|
|
37
|
+
eip_712: z.nullable(BatchedSafeOperationsResponseOutput$inboundSchema)
|
|
38
|
+
.optional(),
|
|
32
39
|
}).transform((v) => {
|
|
33
40
|
return remap$(v, {
|
|
34
41
|
"eip_712": "eip712",
|
|
@@ -17,8 +17,17 @@ import {
|
|
|
17
17
|
} from "./unsignedtransaction.js";
|
|
18
18
|
|
|
19
19
|
export type EarnSwapResponse = {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Unsigned transaction for direct execution. Present when gas_sponsorship=false.
|
|
22
|
+
*/
|
|
23
|
+
transaction?: UnsignedTransaction | null | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* EIP-712 typed data for gas-sponsored execution. Present when gas_sponsorship=true.
|
|
26
|
+
*/
|
|
27
|
+
eip712?: BatchedSafeOperationsResponseOutput | null | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Estimated amount of output token received from the swap.
|
|
30
|
+
*/
|
|
22
31
|
estimatedAmountOut: string;
|
|
23
32
|
};
|
|
24
33
|
|
|
@@ -28,8 +37,9 @@ export const EarnSwapResponse$inboundSchema: z.ZodType<
|
|
|
28
37
|
z.ZodTypeDef,
|
|
29
38
|
unknown
|
|
30
39
|
> = z.object({
|
|
31
|
-
transaction: z.nullable(UnsignedTransaction$inboundSchema),
|
|
32
|
-
eip_712: z.nullable(BatchedSafeOperationsResponseOutput$inboundSchema)
|
|
40
|
+
transaction: z.nullable(UnsignedTransaction$inboundSchema).optional(),
|
|
41
|
+
eip_712: z.nullable(BatchedSafeOperationsResponseOutput$inboundSchema)
|
|
42
|
+
.optional(),
|
|
33
43
|
estimated_amount_out: z.string(),
|
|
34
44
|
}).transform((v) => {
|
|
35
45
|
return remap$(v, {
|