@liquidium/client 0.4.0 → 0.5.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -51
- package/dist/index.cjs +1136 -455
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +348 -348
- package/dist/index.d.ts +348 -348
- package/dist/index.js +1133 -456
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -25,7 +25,7 @@ interface LiquidiumClientConfig {
|
|
|
25
25
|
/** Extra headers sent with every SDK API request. */
|
|
26
26
|
headers?: Record<string, string>;
|
|
27
27
|
/** Override individual canister principals for custom deployments. */
|
|
28
|
-
canisterIds?:
|
|
28
|
+
canisterIds?: CanisterIdOverrides;
|
|
29
29
|
/** Custom `fetch` implementation for SDK API requests. */
|
|
30
30
|
fetch?: typeof fetch;
|
|
31
31
|
/** Per-request timeout for SDK API calls in milliseconds. */
|
|
@@ -37,19 +37,33 @@ interface LiquidiumClientConfig {
|
|
|
37
37
|
/** Existing viem public client or compatible read client for EVM reads. */
|
|
38
38
|
evmPublicClient?: EvmReadClient;
|
|
39
39
|
}
|
|
40
|
+
/** Pool canister principal text values grouped by pool asset. */
|
|
41
|
+
interface PoolCanisterIds {
|
|
42
|
+
/** BTC pool canister principal. */
|
|
43
|
+
btc: string;
|
|
44
|
+
/** USDT pool canister principal. */
|
|
45
|
+
usdt: string;
|
|
46
|
+
/** USDC pool canister principal. */
|
|
47
|
+
usdc: string;
|
|
48
|
+
/** ICP pool canister principal. */
|
|
49
|
+
icp: string;
|
|
50
|
+
}
|
|
40
51
|
/** Principal text values for canisters used by the client. */
|
|
41
52
|
interface CanisterIds {
|
|
42
53
|
/** Liquidium lending canister principal. */
|
|
43
54
|
lending: string;
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
/** ERC-20 pool canister principal. */
|
|
47
|
-
ercPool: string;
|
|
55
|
+
/** Pool canister principals grouped by pool asset. */
|
|
56
|
+
pools: PoolCanisterIds;
|
|
48
57
|
/** ckETH minter deposit helper canister principal. */
|
|
49
58
|
ethDeposit: string;
|
|
50
59
|
/** Accountless instant-loans canister principal. */
|
|
51
60
|
instantLoans: string;
|
|
52
61
|
}
|
|
62
|
+
/** Custom canister principal overrides accepted by client configuration. */
|
|
63
|
+
type CanisterIdOverrides = Omit<Partial<CanisterIds>, "pools"> & {
|
|
64
|
+
/** Partial grouped pool canister principal overrides. */
|
|
65
|
+
pools?: Partial<PoolCanisterIds>;
|
|
66
|
+
};
|
|
53
67
|
/** Supported deployment environments with bundled canister ids. */
|
|
54
68
|
declare const Environment: {
|
|
55
69
|
readonly mainnet: "mainnet";
|
|
@@ -59,7 +73,7 @@ type Environment = (typeof Environment)[keyof typeof Environment];
|
|
|
59
73
|
/** Canonical asset symbols supported by state-mutating protocol flows. */
|
|
60
74
|
declare const Asset: {
|
|
61
75
|
readonly BTC: "BTC";
|
|
62
|
-
readonly
|
|
76
|
+
readonly ICP: "ICP";
|
|
63
77
|
readonly USDC: "USDC";
|
|
64
78
|
readonly USDT: "USDT";
|
|
65
79
|
};
|
|
@@ -69,13 +83,40 @@ type Asset = (typeof Asset)[keyof typeof Asset];
|
|
|
69
83
|
declare const Chain: {
|
|
70
84
|
readonly BTC: "BTC";
|
|
71
85
|
readonly ETH: "ETH";
|
|
86
|
+
readonly ICP: "ICP";
|
|
72
87
|
};
|
|
73
88
|
/** Canonical chain identifier used by wallet and protocol actions. */
|
|
74
89
|
type Chain = (typeof Chain)[keyof typeof Chain];
|
|
75
|
-
/**
|
|
76
|
-
type
|
|
77
|
-
/**
|
|
78
|
-
type
|
|
90
|
+
/** Chains whose wallets can authorize Liquidium protocol actions. */
|
|
91
|
+
type SigningChain = typeof Chain.BTC | typeof Chain.ETH;
|
|
92
|
+
/** Supported asset and transfer-chain combinations. */
|
|
93
|
+
type AssetIdentifier = {
|
|
94
|
+
chain: typeof Chain.BTC;
|
|
95
|
+
asset: typeof Asset.BTC;
|
|
96
|
+
} | {
|
|
97
|
+
chain: typeof Chain.ETH;
|
|
98
|
+
asset: typeof Asset.USDC;
|
|
99
|
+
} | {
|
|
100
|
+
chain: typeof Chain.ETH;
|
|
101
|
+
asset: typeof Asset.USDT;
|
|
102
|
+
} | {
|
|
103
|
+
chain: typeof Chain.ICP;
|
|
104
|
+
asset: typeof Asset.BTC;
|
|
105
|
+
} | {
|
|
106
|
+
chain: typeof Chain.ICP;
|
|
107
|
+
asset: typeof Asset.ICP;
|
|
108
|
+
} | {
|
|
109
|
+
chain: typeof Chain.ICP;
|
|
110
|
+
asset: typeof Asset.USDC;
|
|
111
|
+
} | {
|
|
112
|
+
chain: typeof Chain.ICP;
|
|
113
|
+
asset: typeof Asset.USDT;
|
|
114
|
+
};
|
|
115
|
+
/** Returns whether an asset and chain form a supported SDK identifier. */
|
|
116
|
+
declare function isAssetIdentifier(identifier: {
|
|
117
|
+
chain: string;
|
|
118
|
+
asset: string;
|
|
119
|
+
}): identifier is AssetIdentifier;
|
|
79
120
|
/** Inflow operation performed by a supply target. */
|
|
80
121
|
declare const SupplyAction: {
|
|
81
122
|
readonly deposit: "deposit";
|
|
@@ -94,7 +135,7 @@ type OutflowType = (typeof OutflowType)[keyof typeof OutflowType];
|
|
|
94
135
|
/** Wallet address and chain pair linked to a Liquidium profile. */
|
|
95
136
|
interface Wallet {
|
|
96
137
|
/** Chain where the wallet address is valid. */
|
|
97
|
-
chain:
|
|
138
|
+
chain: SigningChain;
|
|
98
139
|
/** Wallet address as stored by the protocol. */
|
|
99
140
|
address: string;
|
|
100
141
|
}
|
|
@@ -104,18 +145,62 @@ interface CanisterContext {
|
|
|
104
145
|
canisterIds: CanisterIds;
|
|
105
146
|
}
|
|
106
147
|
|
|
107
|
-
/**
|
|
108
|
-
declare const
|
|
109
|
-
readonly
|
|
110
|
-
readonly
|
|
148
|
+
/** Account type hint for Liquidium account inputs and normalized account responses. */
|
|
149
|
+
declare const LiquidiumAccountType: {
|
|
150
|
+
readonly ChainAddress: "ChainAddress";
|
|
151
|
+
readonly IcPrincipal: "IcPrincipal";
|
|
152
|
+
readonly IcpAccountIdentifier: "IcpAccountIdentifier";
|
|
153
|
+
readonly IcrcAccount: "IcrcAccount";
|
|
111
154
|
};
|
|
112
|
-
/**
|
|
113
|
-
type
|
|
155
|
+
/** Account type hint for Liquidium account inputs and normalized account responses. */
|
|
156
|
+
type LiquidiumAccountType = (typeof LiquidiumAccountType)[keyof typeof LiquidiumAccountType];
|
|
157
|
+
/** Chain-native destination account, such as a BTC or EVM address. */
|
|
158
|
+
interface ChainAddressAccount {
|
|
159
|
+
/** Account type. */
|
|
160
|
+
type: "ChainAddress";
|
|
161
|
+
/** Chain-native address. */
|
|
162
|
+
address: string;
|
|
163
|
+
}
|
|
164
|
+
/** IC principal account. */
|
|
165
|
+
interface IcPrincipalAccount {
|
|
166
|
+
/** Account type. */
|
|
167
|
+
type: "IcPrincipal";
|
|
168
|
+
/** Principal text. */
|
|
169
|
+
address: string;
|
|
170
|
+
}
|
|
171
|
+
/** Legacy ICP ledger account identifier. */
|
|
172
|
+
interface IcpAccountIdentifierAccount {
|
|
173
|
+
/** Account type. */
|
|
174
|
+
type: "IcpAccountIdentifier";
|
|
175
|
+
/** ICP ledger account identifier text. */
|
|
176
|
+
address: string;
|
|
177
|
+
}
|
|
178
|
+
/** ICRC account display shape shared by lending and instant-loan responses. */
|
|
179
|
+
interface IcrcAccount {
|
|
180
|
+
/** Account type. */
|
|
181
|
+
type: "IcrcAccount";
|
|
182
|
+
/** ICRC account owner principal text. */
|
|
183
|
+
owner: string;
|
|
184
|
+
/** Optional ICRC subaccount bytes. */
|
|
185
|
+
subaccount?: Uint8Array;
|
|
186
|
+
/** Text-encoded ICRC account for display. */
|
|
187
|
+
address: string;
|
|
188
|
+
}
|
|
189
|
+
/** Normalized Liquidium account returned by SDK flows. */
|
|
190
|
+
type LiquidiumAccount = ChainAddressAccount | IcPrincipalAccount | IcpAccountIdentifierAccount | IcrcAccount;
|
|
191
|
+
/** Address input with an optional account type hint. */
|
|
192
|
+
interface LiquidiumAccountReference {
|
|
193
|
+
/** Address, principal, ICRC account, or ICP account identifier. */
|
|
194
|
+
address: string;
|
|
195
|
+
/** Account type hint. Use string shorthand when the SDK should auto-detect. */
|
|
196
|
+
type: LiquidiumAccountType;
|
|
197
|
+
}
|
|
198
|
+
/** Account input accepted by SDK flows that can auto-detect string addresses. */
|
|
199
|
+
type LiquidiumAccountInput = string | LiquidiumAccountReference;
|
|
200
|
+
|
|
114
201
|
/** Wallet capability required to execute a prepared SDK action. */
|
|
115
202
|
declare const WalletExecutionKind: {
|
|
116
|
-
readonly sendEthTransaction: "send-eth-transaction";
|
|
117
203
|
readonly signMessage: "sign-message";
|
|
118
|
-
readonly signPsbt: "sign-psbt";
|
|
119
204
|
};
|
|
120
205
|
/** Wallet capability required to execute a prepared SDK action. */
|
|
121
206
|
type WalletExecutionKind = (typeof WalletExecutionKind)[keyof typeof WalletExecutionKind];
|
|
@@ -141,46 +226,29 @@ interface EthTransactionRequest {
|
|
|
141
226
|
/** Message-signing request passed to wallet adapters. */
|
|
142
227
|
interface SignMessageRequest {
|
|
143
228
|
/** Chain for the signing wallet. */
|
|
144
|
-
chain:
|
|
229
|
+
chain: SigningChain;
|
|
145
230
|
/** Plaintext message to sign. */
|
|
146
231
|
message: string;
|
|
147
232
|
/** Optional account override for the signing wallet. */
|
|
148
233
|
account?: string;
|
|
149
234
|
/** SDK action type that produced this request. */
|
|
150
235
|
actionType: string;
|
|
151
|
-
/** Transfer path associated with the action. */
|
|
152
|
-
transferMode: TransferMode;
|
|
153
|
-
}
|
|
154
|
-
/** PSBT-signing request passed to BTC wallet adapters. */
|
|
155
|
-
interface SignPsbtRequest {
|
|
156
|
-
/** BTC chain discriminator. */
|
|
157
|
-
chain: Extract<Chain, "BTC">;
|
|
158
|
-
/** Base64-encoded unsigned PSBT. */
|
|
159
|
-
psbtBase64: string;
|
|
160
|
-
/** Optional BTC account override. */
|
|
161
|
-
account?: string;
|
|
162
|
-
/** SDK action type that produced this request. */
|
|
163
|
-
actionType: string;
|
|
164
|
-
/** Transfer path associated with the action. */
|
|
165
|
-
transferMode: TransferMode;
|
|
166
236
|
}
|
|
167
237
|
/** ETH transaction-sending request passed to wallet adapters. */
|
|
168
238
|
interface SendEthTransactionRequest {
|
|
169
239
|
/** ETH chain discriminator. */
|
|
170
|
-
chain:
|
|
240
|
+
chain: "ETH";
|
|
171
241
|
/** Transaction payload to send. */
|
|
172
242
|
transaction: EthTransactionRequest;
|
|
173
243
|
/** Optional account override for the sending wallet. */
|
|
174
244
|
account?: string;
|
|
175
245
|
/** SDK action type that produced this request. */
|
|
176
246
|
actionType: string;
|
|
177
|
-
/** Transfer path associated with the action. */
|
|
178
|
-
transferMode: TransferMode;
|
|
179
247
|
}
|
|
180
248
|
/** BTC transaction-sending request passed to wallet adapters. */
|
|
181
249
|
interface SendBtcTransactionRequest {
|
|
182
250
|
/** BTC chain discriminator. */
|
|
183
|
-
chain:
|
|
251
|
+
chain: "BTC";
|
|
184
252
|
/** Recipient BTC address. */
|
|
185
253
|
toAddress: string;
|
|
186
254
|
/** Amount in satoshis when the SDK knows the transfer amount. */
|
|
@@ -189,46 +257,60 @@ interface SendBtcTransactionRequest {
|
|
|
189
257
|
account?: string;
|
|
190
258
|
/** SDK action type that produced this request. */
|
|
191
259
|
actionType: string;
|
|
192
|
-
|
|
193
|
-
|
|
260
|
+
}
|
|
261
|
+
/** ICRC ledger transfer payload passed to wallet adapters. */
|
|
262
|
+
interface IcrcTransferDetails {
|
|
263
|
+
/** Ledger canister principal that should receive the transfer call. */
|
|
264
|
+
ledgerCanisterId: string;
|
|
265
|
+
/** Recipient ICRC account. */
|
|
266
|
+
to: IcrcAccount;
|
|
267
|
+
/** Transfer amount in ledger base units. */
|
|
268
|
+
amount: bigint;
|
|
269
|
+
/** Optional ledger fee in base units. */
|
|
270
|
+
fee?: bigint;
|
|
271
|
+
/** Optional ledger memo bytes. */
|
|
272
|
+
memo?: Uint8Array;
|
|
273
|
+
}
|
|
274
|
+
/** ICRC transaction-sending request passed to wallet adapters. */
|
|
275
|
+
interface SendIcrcTransferRequest {
|
|
276
|
+
/** ICRC transfers are submitted on the Internet Computer. */
|
|
277
|
+
chain: "ICP";
|
|
278
|
+
/** Asset represented by the target ledger transfer. */
|
|
279
|
+
asset: Asset;
|
|
280
|
+
/** Transfer details for the ledger call. */
|
|
281
|
+
transfer: IcrcTransferDetails;
|
|
282
|
+
/** Optional account override for the sending wallet. */
|
|
283
|
+
account?: string;
|
|
284
|
+
/** SDK action type that produced this request. */
|
|
285
|
+
actionType: string;
|
|
194
286
|
}
|
|
195
287
|
/**
|
|
196
288
|
* Optional wallet capabilities. Implement only what your flow uses:
|
|
197
289
|
*
|
|
198
290
|
* - `signMessage` - account creation, borrow, withdraw
|
|
199
|
-
* - `sendBtcTransaction` / `sendEthTransaction` - automated
|
|
200
|
-
* - `
|
|
201
|
-
* - `
|
|
291
|
+
* - `sendBtcTransaction` / `sendEthTransaction` - automated native-asset transfer supply
|
|
292
|
+
* - `sendIcrcTransfer` - automated ck-ledger and ICP ledger transfer supply
|
|
293
|
+
* - `sendEthTransaction` - contract-interaction supply and ETH native-asset sends
|
|
202
294
|
*/
|
|
203
295
|
interface WalletAdapter {
|
|
204
296
|
/** Signs an SDK plaintext message and returns the wallet signature. BTC adapters may return base64 BIP-322 or hex-encoded signature bytes. */
|
|
205
297
|
signMessage?: (request: SignMessageRequest) => Promise<string>;
|
|
206
|
-
/** Reserved for future PSBT-signing flows; no current SDK method calls this. */
|
|
207
|
-
signPsbt?: (request: SignPsbtRequest) => Promise<string>;
|
|
208
298
|
/** Sends an EVM transaction and returns its transaction hash. */
|
|
209
299
|
sendEthTransaction?: (request: SendEthTransactionRequest) => Promise<string>;
|
|
210
300
|
/** Sends a BTC transaction and returns its transaction id. */
|
|
211
301
|
sendBtcTransaction?: (request: SendBtcTransactionRequest) => Promise<string>;
|
|
302
|
+
/** Sends an ICRC ledger transfer and returns the ledger transaction reference. */
|
|
303
|
+
sendIcrcTransfer?: (request: SendIcrcTransferRequest) => Promise<string>;
|
|
212
304
|
}
|
|
213
305
|
/** Signature payload submitted to a sign-message action. */
|
|
214
306
|
interface SignatureInfo {
|
|
215
307
|
/** Wallet signature over the action message. BTC signatures may be base64 BIP-322 or hex-encoded bytes. */
|
|
216
308
|
signature: string;
|
|
217
309
|
/** Chain used to produce the signature. */
|
|
218
|
-
chain:
|
|
310
|
+
chain: SigningChain;
|
|
219
311
|
/** Account that produced the signature, when different from the action default. */
|
|
220
312
|
account?: string;
|
|
221
313
|
}
|
|
222
|
-
/** Request submitted after a BTC PSBT has been signed. */
|
|
223
|
-
interface SignPsbtSubmitRequest {
|
|
224
|
-
/** Base64-encoded signed PSBT. */
|
|
225
|
-
signedPsbtBase64: string;
|
|
226
|
-
}
|
|
227
|
-
/** Request submitted after an ETH transaction has been sent. */
|
|
228
|
-
interface SendEthTransactionSubmitRequest {
|
|
229
|
-
/** EVM transaction hash returned by the wallet. */
|
|
230
|
-
txHash: string;
|
|
231
|
-
}
|
|
232
314
|
/** Prepared action that requires message signing before submit. */
|
|
233
315
|
interface SignMessageWalletAction<TData, TResult> {
|
|
234
316
|
/** Protocol action kind. */
|
|
@@ -237,8 +319,6 @@ interface SignMessageWalletAction<TData, TResult> {
|
|
|
237
319
|
executionKind: typeof WalletExecutionKind.signMessage;
|
|
238
320
|
/** Adapter-facing action type. */
|
|
239
321
|
actionType: string;
|
|
240
|
-
/** Transfer path associated with the action. */
|
|
241
|
-
transferMode: TransferMode;
|
|
242
322
|
/** Default account to pass to the wallet adapter. */
|
|
243
323
|
account: string;
|
|
244
324
|
/** Plaintext message that must be signed. */
|
|
@@ -248,42 +328,8 @@ interface SignMessageWalletAction<TData, TResult> {
|
|
|
248
328
|
/** Submits the signature and resolves the protocol result. */
|
|
249
329
|
submit(signatureInfo: SignatureInfo): Promise<TResult>;
|
|
250
330
|
}
|
|
251
|
-
/** Reserved prepared action for future BTC PSBT-signing flows. */
|
|
252
|
-
interface SignPsbtWalletAction<TResult> {
|
|
253
|
-
/** Protocol action kind. */
|
|
254
|
-
kind: WalletActionKind;
|
|
255
|
-
/** Wallet capability required to execute the action. */
|
|
256
|
-
executionKind: typeof WalletExecutionKind.signPsbt;
|
|
257
|
-
/** Adapter-facing action type. */
|
|
258
|
-
actionType: string;
|
|
259
|
-
/** Transfer path associated with the action. */
|
|
260
|
-
transferMode: TransferMode;
|
|
261
|
-
/** Optional default account to pass to the wallet adapter. */
|
|
262
|
-
account?: string;
|
|
263
|
-
/** Base64-encoded unsigned PSBT. */
|
|
264
|
-
psbtBase64: string;
|
|
265
|
-
/** Submits the signed PSBT and resolves the protocol result. */
|
|
266
|
-
submit(request: SignPsbtSubmitRequest): Promise<TResult>;
|
|
267
|
-
}
|
|
268
|
-
/** Prepared action that requires sending an ETH transaction before submit. */
|
|
269
|
-
interface SendEthTransactionWalletAction<TResult> {
|
|
270
|
-
/** Protocol action kind. */
|
|
271
|
-
kind: WalletActionKind;
|
|
272
|
-
/** Wallet capability required to execute the action. */
|
|
273
|
-
executionKind: typeof WalletExecutionKind.sendEthTransaction;
|
|
274
|
-
/** Adapter-facing action type. */
|
|
275
|
-
actionType: string;
|
|
276
|
-
/** Transfer path associated with the action. */
|
|
277
|
-
transferMode: TransferMode;
|
|
278
|
-
/** Optional default account to pass to the wallet adapter. */
|
|
279
|
-
account?: string;
|
|
280
|
-
/** EVM transaction request to send. */
|
|
281
|
-
transaction: EthTransactionRequest;
|
|
282
|
-
/** Submits the transaction hash and resolves the protocol result. */
|
|
283
|
-
submit(request: SendEthTransactionSubmitRequest): Promise<TResult>;
|
|
284
|
-
}
|
|
285
331
|
/** Any prepared action returned by SDK methods and executable by {@link executeWith}. */
|
|
286
|
-
type WalletAction<TResult> = SignMessageWalletAction<unknown, TResult
|
|
332
|
+
type WalletAction<TResult> = SignMessageWalletAction<unknown, TResult>;
|
|
287
333
|
|
|
288
334
|
/** Options for preparing a profile-creation action. */
|
|
289
335
|
interface PrepareCreateProfileOptions {
|
|
@@ -295,7 +341,7 @@ interface CreateProfileParams {
|
|
|
295
341
|
/** Wallet address that will own the new profile. */
|
|
296
342
|
account: string;
|
|
297
343
|
/** Chain used to sign the profile-creation message. */
|
|
298
|
-
chain:
|
|
344
|
+
chain: SigningChain;
|
|
299
345
|
/** Wallet adapter used to sign the profile-creation message. */
|
|
300
346
|
walletAdapter: WalletAdapter;
|
|
301
347
|
}
|
|
@@ -304,11 +350,8 @@ interface CreateAccountData {
|
|
|
304
350
|
/** Unix expiry timestamp in seconds, included in the signed message. */
|
|
305
351
|
expiryTimestamp: bigint;
|
|
306
352
|
}
|
|
307
|
-
/** Sign-message action that can be submitted after wallet signing. */
|
|
308
|
-
interface SignableAction<TData, TResult> extends SignMessageWalletAction<TData, TResult> {
|
|
309
|
-
}
|
|
310
353
|
/** Prepared action for creating a Liquidium profile. */
|
|
311
|
-
interface CreateAccountAction extends
|
|
354
|
+
interface CreateAccountAction extends SignMessageWalletAction<CreateAccountData, string> {
|
|
312
355
|
/** Protocol action kind. */
|
|
313
356
|
kind: typeof WalletActionKind.createAccount;
|
|
314
357
|
/** Required wallet capability. */
|
|
@@ -634,7 +677,7 @@ declare class HistoryModule {
|
|
|
634
677
|
/** Wallet execution dependencies for borrow and withdraw convenience methods. */
|
|
635
678
|
interface WalletExecutionParams {
|
|
636
679
|
/** Chain used by the signing wallet. */
|
|
637
|
-
signerChain:
|
|
680
|
+
signerChain: SigningChain;
|
|
638
681
|
/** Wallet adapter used to execute the prepared action. */
|
|
639
682
|
signerWalletAdapter: WalletAdapter;
|
|
640
683
|
}
|
|
@@ -654,40 +697,6 @@ interface CreateTransferErc20TransactionParams {
|
|
|
654
697
|
/** Transfer amount in token base units. */
|
|
655
698
|
amount: bigint;
|
|
656
699
|
}
|
|
657
|
-
/** Destination account for a completed outflow. */
|
|
658
|
-
type OutflowReceiver = NativeOutflowReceiver | ExternalOutflowReceiver | AccountIdentifierOutflowReceiver | IcrcOutflowReceiver;
|
|
659
|
-
/** IC principal destination for a completed outflow. */
|
|
660
|
-
interface NativeOutflowReceiver {
|
|
661
|
-
/** Destination account type reported by the protocol. */
|
|
662
|
-
type: "Native";
|
|
663
|
-
/** Destination principal. */
|
|
664
|
-
account: string;
|
|
665
|
-
}
|
|
666
|
-
/** External-chain destination for a completed outflow. */
|
|
667
|
-
interface ExternalOutflowReceiver {
|
|
668
|
-
/** Destination account type reported by the protocol. */
|
|
669
|
-
type: "External";
|
|
670
|
-
/** External-chain destination address. */
|
|
671
|
-
account: string;
|
|
672
|
-
}
|
|
673
|
-
/** Legacy ICP ledger account identifier destination for a completed outflow. */
|
|
674
|
-
interface AccountIdentifierOutflowReceiver {
|
|
675
|
-
/** Destination account type reported by the protocol. */
|
|
676
|
-
type: "AccountIdentifier";
|
|
677
|
-
/** ICP ledger account identifier text, displayed as the destination address. */
|
|
678
|
-
account: string;
|
|
679
|
-
}
|
|
680
|
-
/** ICRC account destination for a completed outflow. */
|
|
681
|
-
interface IcrcOutflowReceiver {
|
|
682
|
-
/** Destination account type reported by the protocol. */
|
|
683
|
-
type: "Icrc";
|
|
684
|
-
/** ICRC account owner principal text. */
|
|
685
|
-
owner: string;
|
|
686
|
-
/** Optional ICRC subaccount bytes. */
|
|
687
|
-
subaccount?: Uint8Array;
|
|
688
|
-
/** Text-encoded ICRC account for display. */
|
|
689
|
-
account: string;
|
|
690
|
-
}
|
|
691
700
|
/**
|
|
692
701
|
* Receipt for a borrow or withdrawal outflow submitted to the lending canister.
|
|
693
702
|
*
|
|
@@ -706,7 +715,7 @@ interface OutflowDetails {
|
|
|
706
715
|
/** Outflow amount in the pool asset's base units. */
|
|
707
716
|
amount: bigint;
|
|
708
717
|
/** Outflow destination account. */
|
|
709
|
-
receiver:
|
|
718
|
+
receiver: LiquidiumAccount;
|
|
710
719
|
}
|
|
711
720
|
/** Borrow receipt. */
|
|
712
721
|
type BorrowOutflowDetails = OutflowDetails & {
|
|
@@ -720,12 +729,6 @@ type WithdrawOutflowDetails = OutflowDetails & {
|
|
|
720
729
|
/** Shared lifecycle status for the withdraw outflow receipt. */
|
|
721
730
|
status: LiquidiumStatus;
|
|
722
731
|
};
|
|
723
|
-
/** Signature payload for submitting a prepared borrow action. */
|
|
724
|
-
interface BorrowSubmitSignatureInfo extends SignatureInfo {
|
|
725
|
-
}
|
|
726
|
-
/** Signature payload for submitting a prepared withdraw action. */
|
|
727
|
-
interface WithdrawSubmitSignatureInfo extends SignatureInfo {
|
|
728
|
-
}
|
|
729
732
|
/**
|
|
730
733
|
* Fields to build a borrow request. `amount` is in the borrow pool asset's base units
|
|
731
734
|
* (e.g. satoshis, token smallest units).
|
|
@@ -737,8 +740,10 @@ interface CreateBorrowRequest {
|
|
|
737
740
|
poolId: string;
|
|
738
741
|
/** Amount to borrow in the borrow asset's base units. */
|
|
739
742
|
amount: bigint;
|
|
740
|
-
/**
|
|
741
|
-
|
|
743
|
+
/** Chain where borrowed funds should arrive. */
|
|
744
|
+
chain: Chain;
|
|
745
|
+
/** Destination that receives the borrowed asset. */
|
|
746
|
+
receiver: LiquidiumAccountInput;
|
|
742
747
|
/** Wallet address that signs the borrow authorization. */
|
|
743
748
|
signerWalletAddress: string;
|
|
744
749
|
}
|
|
@@ -756,18 +761,21 @@ interface BorrowAction extends SignMessageWalletAction<CreateBorrowData, BorrowO
|
|
|
756
761
|
/** Adapter-facing action type. */
|
|
757
762
|
actionType: typeof WalletActionKind.createBorrow;
|
|
758
763
|
}
|
|
759
|
-
/**
|
|
760
|
-
* Fields to build a withdraw request. `amount` is in the pool asset's base units.
|
|
761
|
-
*/
|
|
764
|
+
/** Fields to build a withdraw request. `amount` is in the pool asset's base units. */
|
|
762
765
|
interface CreateWithdrawRequest {
|
|
763
766
|
/** Liquidium profile principal text. */
|
|
764
767
|
profileId: string;
|
|
765
768
|
/** Pool principal text to withdraw from. */
|
|
766
769
|
poolId: string;
|
|
767
|
-
/**
|
|
770
|
+
/**
|
|
771
|
+
* Amount to withdraw in the pool asset's base units. BTC withdrawals require
|
|
772
|
+
* at least 5,000 sats. USDC and USDT withdrawals require at least 1 token.
|
|
773
|
+
*/
|
|
768
774
|
amount: bigint;
|
|
769
|
-
/**
|
|
770
|
-
|
|
775
|
+
/** Chain where withdrawn funds should arrive. */
|
|
776
|
+
chain: Chain;
|
|
777
|
+
/** Destination that receives the withdrawn asset. */
|
|
778
|
+
receiver: LiquidiumAccountInput;
|
|
771
779
|
/** Wallet address that signs the withdraw authorization. */
|
|
772
780
|
signerWalletAddress: string;
|
|
773
781
|
}
|
|
@@ -792,64 +800,41 @@ declare const SupplyPlanType: {
|
|
|
792
800
|
};
|
|
793
801
|
/** Supply execution plan selected by the SDK. */
|
|
794
802
|
type SupplyPlanType = (typeof SupplyPlanType)[keyof typeof SupplyPlanType];
|
|
795
|
-
/**
|
|
796
|
-
|
|
797
|
-
/** Target discriminator. */
|
|
798
|
-
type: "nativeAddress";
|
|
803
|
+
/** Supply destination returned by `lending.supply(...)`. */
|
|
804
|
+
type SupplyTarget = AssetIdentifier & {
|
|
799
805
|
/** Pool principal text receiving the inflow. */
|
|
800
806
|
poolId: string;
|
|
801
|
-
/** Asset expected by the target. */
|
|
802
|
-
asset: MarketAsset;
|
|
803
|
-
/** Chain where the target address is valid. */
|
|
804
|
-
chain: MarketChain;
|
|
805
807
|
/** Deposit or repayment action for the inflow. */
|
|
806
808
|
action: SupplyAction;
|
|
807
|
-
/**
|
|
809
|
+
/** Address to use for this chain and asset pair. */
|
|
808
810
|
address: string;
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
/** Target discriminator. */
|
|
813
|
-
type: "icrcAccount";
|
|
814
|
-
/** Pool principal text receiving the inflow. */
|
|
815
|
-
poolId: string;
|
|
816
|
-
/** Asset expected by the target. */
|
|
817
|
-
asset: MarketAsset;
|
|
818
|
-
/** Chain associated with the inflow. */
|
|
819
|
-
chain: MarketChain;
|
|
820
|
-
/** Deposit or repayment action for the inflow. */
|
|
821
|
-
action: SupplyAction;
|
|
822
|
-
/** ICRC account owner principal text. */
|
|
823
|
-
owner: string;
|
|
824
|
-
/** ICRC subaccount bytes. */
|
|
825
|
-
subaccount: Uint8Array;
|
|
826
|
-
/** Text-encoded ICRC account. */
|
|
827
|
-
account: string;
|
|
828
|
-
}
|
|
829
|
-
/** Supply destination returned by `lending.supply(...)`. */
|
|
830
|
-
type SupplyTarget = NativeAddressSupplyTarget | IcrcAccountSupplyTarget;
|
|
811
|
+
/** Legacy account identifier for ICP ledger transfers. */
|
|
812
|
+
icpAccountIdentifier?: string;
|
|
813
|
+
};
|
|
831
814
|
interface BaseSupplyFlowRequest {
|
|
832
815
|
profileId: string;
|
|
833
816
|
poolId: string;
|
|
834
817
|
action: SupplyAction;
|
|
818
|
+
/** Transfer chain to use. Pass ICP for ck-ledger transfers. */
|
|
819
|
+
chain: Chain;
|
|
835
820
|
}
|
|
836
821
|
/** Manual transfer-based `lending.supply` request. */
|
|
837
822
|
interface ManualTransferSupplyFlowRequest extends BaseSupplyFlowRequest {
|
|
838
|
-
/**
|
|
839
|
-
mechanism?:
|
|
840
|
-
/**
|
|
823
|
+
/** Transfer supply uses the default mechanism and does not accept this field. */
|
|
824
|
+
mechanism?: never;
|
|
825
|
+
/** Manual supply does not broadcast through a wallet adapter. */
|
|
841
826
|
walletAdapter?: never;
|
|
842
|
-
/**
|
|
827
|
+
/** Manual supply does not accept a sender account. */
|
|
843
828
|
account?: never;
|
|
844
|
-
/**
|
|
829
|
+
/** Manual supply does not accept an execution amount. */
|
|
845
830
|
amount?: never;
|
|
846
831
|
}
|
|
847
832
|
/** Wallet-executed transfer-based `lending.supply` request. */
|
|
848
833
|
interface WalletTransferSupplyFlowRequest extends BaseSupplyFlowRequest {
|
|
849
|
-
/**
|
|
850
|
-
mechanism?:
|
|
834
|
+
/** Transfer supply uses the default mechanism and does not accept this field. */
|
|
835
|
+
mechanism?: never;
|
|
851
836
|
/** Wallet adapter used to broadcast the transfer. */
|
|
852
|
-
walletAdapter: Pick<WalletAdapter, "sendBtcTransaction" | "sendEthTransaction">;
|
|
837
|
+
walletAdapter: Pick<WalletAdapter, "sendBtcTransaction" | "sendEthTransaction" | "sendIcrcTransfer">;
|
|
853
838
|
/** Sender wallet account. */
|
|
854
839
|
account: string;
|
|
855
840
|
/** Transfer amount in the target asset's base units. */
|
|
@@ -861,6 +846,8 @@ type TransferSupplyFlowRequest = ManualTransferSupplyFlowRequest | WalletTransfe
|
|
|
861
846
|
interface ContractInteractionSupplyFlowRequest extends BaseSupplyFlowRequest {
|
|
862
847
|
/** Contract-interaction mechanism discriminator. */
|
|
863
848
|
mechanism: typeof SupplyPlanType.contractInteraction;
|
|
849
|
+
/** Contract interaction is only supported for ETH stablecoin pools. */
|
|
850
|
+
chain: typeof Chain.ETH;
|
|
864
851
|
/** ETH wallet adapter used to approve and deposit ERC-20 assets. */
|
|
865
852
|
walletAdapter: Pick<WalletAdapter, "sendEthTransaction">;
|
|
866
853
|
/** Sender EVM wallet address. */
|
|
@@ -905,7 +892,7 @@ interface SubmitSupplyFlowInflowRequest {
|
|
|
905
892
|
/** Broadcast transaction id or hash. */
|
|
906
893
|
txid: string;
|
|
907
894
|
/** Chain where the transaction was broadcast, when not implied by the flow. */
|
|
908
|
-
chain?: Chain
|
|
895
|
+
chain?: Extract<Chain, "BTC" | "ETH">;
|
|
909
896
|
}
|
|
910
897
|
/** Body for direct `lending.submitInflow`. */
|
|
911
898
|
interface SubmitInflowRequest extends SubmitSupplyFlowInflowRequest {
|
|
@@ -917,13 +904,8 @@ interface SubmitInflowResponse {
|
|
|
917
904
|
/** Transaction id accepted by the SDK API. */
|
|
918
905
|
txid: string;
|
|
919
906
|
}
|
|
920
|
-
/**
|
|
921
|
-
|
|
922
|
-
/** Asset to estimate for. */
|
|
923
|
-
asset: Asset;
|
|
924
|
-
/** Chain to estimate for. */
|
|
925
|
-
chain: Chain;
|
|
926
|
-
}
|
|
907
|
+
/** Chain and asset pair for estimating an inflow target fee. */
|
|
908
|
+
type EstimateInflowFeeRequest = AssetIdentifier;
|
|
927
909
|
/** Request for an ETH stablecoin deposit address. */
|
|
928
910
|
interface GetDepositAddressRequest {
|
|
929
911
|
/** Liquidium profile principal text. */
|
|
@@ -931,7 +913,7 @@ interface GetDepositAddressRequest {
|
|
|
931
913
|
/** Pool principal text receiving the inflow. */
|
|
932
914
|
poolId: string;
|
|
933
915
|
/** ETH stablecoin asset. */
|
|
934
|
-
asset:
|
|
916
|
+
asset: typeof Asset.USDC | typeof Asset.USDT;
|
|
935
917
|
/** Deposit or repayment action for the inflow. */
|
|
936
918
|
action: SupplyAction;
|
|
937
919
|
}
|
|
@@ -1080,12 +1062,14 @@ declare class LendingModule {
|
|
|
1080
1062
|
*
|
|
1081
1063
|
* ETH stablecoin deposit-address estimates are served by the deposit-address
|
|
1082
1064
|
* canister. BTC estimates include the ckBTC minter deposit fee and ledger fee.
|
|
1065
|
+
* ICP-chain estimates return the corresponding ICRC ledger fee.
|
|
1083
1066
|
*
|
|
1084
1067
|
* @param request - Asset and chain pair to estimate for.
|
|
1085
1068
|
* @returns Total fee estimate rounded up in the asset's base units.
|
|
1086
1069
|
*/
|
|
1087
1070
|
estimateInflowFee(request: EstimateInflowFeeRequest): Promise<InflowFeeEstimate>;
|
|
1088
1071
|
private estimateBtcInflowFee;
|
|
1072
|
+
private estimateIcrcLedgerFee;
|
|
1089
1073
|
/**
|
|
1090
1074
|
* Submits an inflow transaction id for faster indexing.
|
|
1091
1075
|
*
|
|
@@ -1103,8 +1087,6 @@ declare class LendingModule {
|
|
|
1103
1087
|
isBorrowingDisabled(): Promise<boolean>;
|
|
1104
1088
|
private requireApi;
|
|
1105
1089
|
private createSupplyFlowExecutor;
|
|
1106
|
-
private getPoolById;
|
|
1107
|
-
private normalizeOutflowReceiverAddress;
|
|
1108
1090
|
}
|
|
1109
1091
|
|
|
1110
1092
|
/** Current protocol metadata and rate state for a lending pool. */
|
|
@@ -1112,9 +1094,9 @@ interface Pool {
|
|
|
1112
1094
|
/** Pool canister principal text. */
|
|
1113
1095
|
id: string;
|
|
1114
1096
|
/** Asset supplied to and borrowed from the pool. */
|
|
1115
|
-
asset:
|
|
1097
|
+
asset: Asset;
|
|
1116
1098
|
/** Chain associated with the pool asset. */
|
|
1117
|
-
chain:
|
|
1099
|
+
chain: Chain;
|
|
1118
1100
|
/** Number of base-unit decimals for pool amounts. */
|
|
1119
1101
|
decimals: bigint;
|
|
1120
1102
|
/** Whether new pool activity is currently frozen. */
|
|
@@ -1166,13 +1148,8 @@ interface Pool {
|
|
|
1166
1148
|
}
|
|
1167
1149
|
/** USD price map keyed by market asset symbol. */
|
|
1168
1150
|
type AssetPrices = Record<string, number>;
|
|
1169
|
-
/**
|
|
1170
|
-
|
|
1171
|
-
/** Asset symbol to match. */
|
|
1172
|
-
asset: MarketAsset;
|
|
1173
|
-
/** Chain name to match. */
|
|
1174
|
-
chain: MarketChain;
|
|
1175
|
-
}
|
|
1151
|
+
/** Supported Chain + Asset identifier used to find its backing lending pool. */
|
|
1152
|
+
type FindPoolQuery = AssetIdentifier;
|
|
1176
1153
|
/** Current borrow, lend, and utilization rates for a pool. */
|
|
1177
1154
|
interface PoolRate {
|
|
1178
1155
|
/** Decimal scale used by rate fields. */
|
|
@@ -1188,8 +1165,7 @@ interface PoolRate {
|
|
|
1188
1165
|
/** Pool metadata, prices, and current rate helpers. */
|
|
1189
1166
|
declare class MarketModule {
|
|
1190
1167
|
private readonly canisterContext;
|
|
1191
|
-
|
|
1192
|
-
constructor(canisterContext: CanisterContext, apiClient: ApiClient | undefined);
|
|
1168
|
+
constructor(canisterContext: CanisterContext);
|
|
1193
1169
|
/**
|
|
1194
1170
|
* Lists SDK-supported pools with their current rates.
|
|
1195
1171
|
*
|
|
@@ -1205,7 +1181,10 @@ declare class MarketModule {
|
|
|
1205
1181
|
*/
|
|
1206
1182
|
getAssetPrices(): Promise<AssetPrices>;
|
|
1207
1183
|
/**
|
|
1208
|
-
* Resolves a single pool for the given
|
|
1184
|
+
* Resolves a single backing pool for the given Chain + Asset identifier.
|
|
1185
|
+
*
|
|
1186
|
+
* Native and chain-key identifiers share a pool. For example, both
|
|
1187
|
+
* `ETH/USDT` and `ICP/USDT` resolve to the USDT lending pool.
|
|
1209
1188
|
*
|
|
1210
1189
|
* @param query - The market asset and chain pair to match.
|
|
1211
1190
|
* @returns The single pool that matches the requested asset and chain.
|
|
@@ -1235,7 +1214,7 @@ interface Position {
|
|
|
1235
1214
|
/** Pool principal text. */
|
|
1236
1215
|
poolId: string;
|
|
1237
1216
|
/** Pool asset symbol. */
|
|
1238
|
-
asset:
|
|
1217
|
+
asset: Asset;
|
|
1239
1218
|
/** Current supplied amount in base units. */
|
|
1240
1219
|
deposited: bigint;
|
|
1241
1220
|
/** Decimal scale for supplied amounts. */
|
|
@@ -1417,115 +1396,127 @@ declare class PositionsModule {
|
|
|
1417
1396
|
declare function createTransferErc20Transaction(params: CreateTransferErc20TransactionParams): EvmContractTransaction;
|
|
1418
1397
|
|
|
1419
1398
|
/** Asset symbols supported by the instant-loans canister. */
|
|
1420
|
-
type InstantLoanAsset = "
|
|
1421
|
-
/**
|
|
1422
|
-
interface
|
|
1399
|
+
type InstantLoanAsset = AssetIdentifier["asset"];
|
|
1400
|
+
/** Collateral leg used when creating an instant loan. */
|
|
1401
|
+
interface CreateInstantLoanCollateral {
|
|
1423
1402
|
/**
|
|
1424
|
-
*
|
|
1403
|
+
* Principal text of the pool that receives the user's collateral deposit.
|
|
1425
1404
|
*
|
|
1426
|
-
*
|
|
1427
|
-
*
|
|
1405
|
+
* This should be the `id` of the collateral `Pool` selected from
|
|
1406
|
+
* `client.market.listPools()`. The pool asset must match `asset`.
|
|
1428
1407
|
*/
|
|
1429
|
-
|
|
1408
|
+
poolId: string;
|
|
1430
1409
|
/**
|
|
1431
|
-
*
|
|
1410
|
+
* Asset the user will deposit as collateral.
|
|
1432
1411
|
*
|
|
1433
|
-
*
|
|
1434
|
-
*
|
|
1412
|
+
* Must match the asset for `poolId`; for example, use `"BTC"` with a BTC
|
|
1413
|
+
* collateral pool.
|
|
1435
1414
|
*/
|
|
1436
|
-
|
|
1415
|
+
asset: InstantLoanAsset;
|
|
1437
1416
|
/**
|
|
1438
|
-
*
|
|
1417
|
+
* Intended credited collateral amount, in base units.
|
|
1439
1418
|
*
|
|
1440
|
-
*
|
|
1441
|
-
*
|
|
1419
|
+
* This is used to validate LTV and initialize the loan record before
|
|
1420
|
+
* deposit/inflow fees are deducted. For BTC, pass satoshis. For token assets,
|
|
1421
|
+
* convert the UI amount using the selected pool's `decimals` value. After
|
|
1422
|
+
* creation, use one of `loan.initialDeposit.targets` as the fee-inclusive
|
|
1423
|
+
* transfer quote and destination.
|
|
1442
1424
|
*/
|
|
1443
|
-
|
|
1444
|
-
}
|
|
1445
|
-
/** IC principal account returned when a canister-native destination is used. */
|
|
1446
|
-
interface NativeAccount {
|
|
1447
|
-
/** Account kind discriminator. */
|
|
1448
|
-
type: "Native";
|
|
1449
|
-
/** Principal text for the canister-native account. */
|
|
1450
|
-
principal: string;
|
|
1451
|
-
}
|
|
1452
|
-
/** Legacy ICP ledger account identifier returned by existing canister state. */
|
|
1453
|
-
interface AccountIdentifierAccount {
|
|
1454
|
-
/** Account kind discriminator. */
|
|
1455
|
-
type: "AccountIdentifier";
|
|
1456
|
-
/** ICP ledger account identifier text, displayed as the destination address. */
|
|
1457
|
-
address: string;
|
|
1458
|
-
}
|
|
1459
|
-
/** ICRC account returned by existing or future canister state. */
|
|
1460
|
-
interface IcrcAccount {
|
|
1461
|
-
/** Account kind discriminator. */
|
|
1462
|
-
type: "Icrc";
|
|
1463
|
-
/** ICRC account owner principal text. */
|
|
1464
|
-
owner: string;
|
|
1465
|
-
/** Optional ICRC subaccount bytes. */
|
|
1466
|
-
subaccount?: Uint8Array;
|
|
1467
|
-
/** Text-encoded ICRC account for display. */
|
|
1468
|
-
address: string;
|
|
1425
|
+
amount: bigint;
|
|
1469
1426
|
}
|
|
1470
|
-
/** Borrow destination or refund account associated with an instant loan. */
|
|
1471
|
-
type InstantLoanAccount = ExternalAccount | NativeAccount | AccountIdentifierAccount | IcrcAccount;
|
|
1472
1427
|
/**
|
|
1473
|
-
*
|
|
1474
|
-
*
|
|
1475
|
-
* Use market data from `client.market.listPools()` to choose the two pool ids,
|
|
1476
|
-
* and use `client.quote.calculateLtv(...)` before creation to validate the
|
|
1477
|
-
* amount pair and choose `ltvMaxBps`.
|
|
1428
|
+
* Borrow leg used when creating an instant loan.
|
|
1478
1429
|
*
|
|
1479
|
-
*
|
|
1480
|
-
*
|
|
1481
|
-
* pool decimals.
|
|
1430
|
+
* `chain` and `asset` form the canonical asset identifier. For example,
|
|
1431
|
+
* `{ chain: "ICP", asset: "USDT" }` means ckUSDT.
|
|
1482
1432
|
*/
|
|
1483
|
-
|
|
1484
|
-
/**
|
|
1485
|
-
* Principal text of the pool that receives the user's collateral deposit.
|
|
1486
|
-
*
|
|
1487
|
-
* This should be the `id` of the collateral `Pool` selected from
|
|
1488
|
-
* `client.market.listPools()`. The pool asset must match `collateralAsset`.
|
|
1489
|
-
*/
|
|
1490
|
-
collateralPoolId: string;
|
|
1433
|
+
type CreateInstantLoanBorrow = AssetIdentifier & {
|
|
1491
1434
|
/**
|
|
1492
1435
|
* Principal text of the pool that funds the borrow.
|
|
1493
1436
|
*
|
|
1494
1437
|
* This should be the `id` of the borrow `Pool` selected from
|
|
1495
|
-
* `client.market.listPools()`. The pool asset must match `
|
|
1496
|
-
*/
|
|
1497
|
-
borrowPoolId: string;
|
|
1498
|
-
/**
|
|
1499
|
-
* Asset the user will deposit as collateral.
|
|
1500
|
-
*
|
|
1501
|
-
* Must match the asset for `collateralPoolId`; for example, use `"BTC"` with
|
|
1502
|
-
* a BTC collateral pool.
|
|
1438
|
+
* `client.market.listPools()`. The pool asset must match `asset`.
|
|
1503
1439
|
*/
|
|
1504
|
-
|
|
1440
|
+
poolId: string;
|
|
1505
1441
|
/**
|
|
1506
|
-
*
|
|
1442
|
+
* Amount to borrow, in the borrow asset's base units.
|
|
1507
1443
|
*
|
|
1508
|
-
*
|
|
1509
|
-
*
|
|
1444
|
+
* For USDC/USDT, convert the UI amount using the selected borrow pool's
|
|
1445
|
+
* `decimals` value before passing it here.
|
|
1510
1446
|
*/
|
|
1511
|
-
|
|
1447
|
+
amount: bigint;
|
|
1512
1448
|
/**
|
|
1513
|
-
*
|
|
1449
|
+
* Destination that receives the borrowed asset after the loan starts.
|
|
1514
1450
|
*
|
|
1515
|
-
*
|
|
1516
|
-
*
|
|
1517
|
-
*
|
|
1518
|
-
*
|
|
1519
|
-
* amount to send to `loan.initialDeposit.target`.
|
|
1451
|
+
* Pass either a string shorthand or a typed destination. For BTC/ETH chain
|
|
1452
|
+
* outflows this is usually the user's chain address. Chain-key assets on ICP
|
|
1453
|
+
* require an `IcPrincipal`; native ICP also accepts `IcpAccountIdentifier`
|
|
1454
|
+
* and `IcrcAccount` destinations.
|
|
1520
1455
|
*/
|
|
1521
|
-
|
|
1456
|
+
destination: InstantLoanDestination;
|
|
1457
|
+
};
|
|
1458
|
+
/** Refund leg used when creating an instant loan. */
|
|
1459
|
+
interface CreateInstantLoanRefund {
|
|
1460
|
+
/** Delivery chain used for collateral refunds and withdrawals. Use ICP for ck-ledger delivery. */
|
|
1461
|
+
chain: Chain;
|
|
1522
1462
|
/**
|
|
1523
|
-
*
|
|
1463
|
+
* Destination that receives collateral refunds or withdrawals.
|
|
1524
1464
|
*
|
|
1525
|
-
*
|
|
1526
|
-
*
|
|
1465
|
+
* Pass either a string shorthand or a typed destination. For BTC/ETH chain
|
|
1466
|
+
* outflows this is usually the user's chain address. Chain-key assets on ICP
|
|
1467
|
+
* require an `IcPrincipal`; native ICP also accepts `IcpAccountIdentifier`
|
|
1468
|
+
* and `IcrcAccount` destinations.
|
|
1527
1469
|
*/
|
|
1528
|
-
|
|
1470
|
+
destination: InstantLoanDestination;
|
|
1471
|
+
}
|
|
1472
|
+
/**
|
|
1473
|
+
* Borrow destination or refund account associated with an instant loan.
|
|
1474
|
+
*
|
|
1475
|
+
* @example
|
|
1476
|
+
* ```ts
|
|
1477
|
+
* const icPrincipalAccount: InstantLoanAccount = {
|
|
1478
|
+
* type: "IcPrincipal",
|
|
1479
|
+
* address: "aaaaa-aa",
|
|
1480
|
+
* };
|
|
1481
|
+
*
|
|
1482
|
+
* const chainAddressAccount: InstantLoanAccount = {
|
|
1483
|
+
* type: "ChainAddress",
|
|
1484
|
+
* address: "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
|
|
1485
|
+
* };
|
|
1486
|
+
*
|
|
1487
|
+
* const accountIdentifierAccount: InstantLoanAccount = {
|
|
1488
|
+
* type: "IcpAccountIdentifier",
|
|
1489
|
+
* address: "e2134f3f176b1429df3f92807b8f0f26a520debc313b2d6ad86a4a2e7f3d8f8d",
|
|
1490
|
+
* };
|
|
1491
|
+
*
|
|
1492
|
+
* const icrcAccount: InstantLoanAccount = {
|
|
1493
|
+
* type: "IcrcAccount",
|
|
1494
|
+
* owner: "aaaaa-aa",
|
|
1495
|
+
* address: "aaaaa-aa",
|
|
1496
|
+
* };
|
|
1497
|
+
* ```
|
|
1498
|
+
*/
|
|
1499
|
+
type InstantLoanAccount = LiquidiumAccount;
|
|
1500
|
+
/** Destination accepted when creating an instant loan. */
|
|
1501
|
+
type InstantLoanDestination = LiquidiumAccountInput;
|
|
1502
|
+
/**
|
|
1503
|
+
* Parameters for creating an accountless instant loan.
|
|
1504
|
+
*
|
|
1505
|
+
* Use market data from `client.market.listPools()` to choose the two pool ids,
|
|
1506
|
+
* and use `client.quote.calculateLtv(...)` before creation to validate the
|
|
1507
|
+
* amount pair and choose `ltvMaxBps`.
|
|
1508
|
+
*
|
|
1509
|
+
* Amount fields are in each asset's smallest/base units. For example, BTC uses
|
|
1510
|
+
* satoshis and ERC-20 assets use token base units according to the selected
|
|
1511
|
+
* pool decimals.
|
|
1512
|
+
*/
|
|
1513
|
+
interface CreateInstantLoanRequest {
|
|
1514
|
+
/** Collateral leg: pool, asset, and amount the user deposits. */
|
|
1515
|
+
collateral: CreateInstantLoanCollateral;
|
|
1516
|
+
/** Borrow leg: pool, asset, amount, delivery chain, and destination. */
|
|
1517
|
+
borrow: CreateInstantLoanBorrow;
|
|
1518
|
+
/** Refund leg: chain and destination for returned collateral. */
|
|
1519
|
+
refund: CreateInstantLoanRefund;
|
|
1529
1520
|
/**
|
|
1530
1521
|
* Maximum allowed loan-to-value ratio in basis points.
|
|
1531
1522
|
*
|
|
@@ -1543,22 +1534,6 @@ interface CreateInstantLoanRequest {
|
|
|
1543
1534
|
* `ltv_timer_s`.
|
|
1544
1535
|
*/
|
|
1545
1536
|
depositWindowSeconds: bigint;
|
|
1546
|
-
/**
|
|
1547
|
-
* External destination that receives the borrowed asset after the loan starts.
|
|
1548
|
-
*
|
|
1549
|
-
* Pass either an address string or `{ type: "External", address }`. This is
|
|
1550
|
-
* usually the user's wallet address on the borrow asset's chain, such as an
|
|
1551
|
-
* EVM address for ETH USDC/USDT outflows.
|
|
1552
|
-
*/
|
|
1553
|
-
borrowDestination: string | ExternalAccount;
|
|
1554
|
-
/**
|
|
1555
|
-
* External destination that receives collateral refunds or withdrawals.
|
|
1556
|
-
*
|
|
1557
|
-
* Pass either an address string or `{ type: "External", address }`. This
|
|
1558
|
-
* should be an address on the collateral asset's chain, such as a BTC address
|
|
1559
|
-
* when `collateralAsset` is `"BTC"`.
|
|
1560
|
-
*/
|
|
1561
|
-
refundDestination: string | ExternalAccount;
|
|
1562
1537
|
}
|
|
1563
1538
|
/** Lookup request for loading an instant loan by numeric canister id. */
|
|
1564
1539
|
interface InstantLoanGetByIdRequest {
|
|
@@ -1707,10 +1682,28 @@ interface InstantLoanDepositTimerStartedEventType {
|
|
|
1707
1682
|
}
|
|
1708
1683
|
/** Direct canister event payload returned by instant-loans event queries. */
|
|
1709
1684
|
type InstantLoanEventType = InstantLoanCreatedEventType | InstantLoanFullLendWithdrawalRequestedEventType | InstantLoanBorrowRequestedEventType | InstantLoanDepositTimerExceededEventType | InstantLoanStuckFundsWithdrawalRequestedEventType | InstantLoanProfileWarmedEventType | InstantLoanRepayCompleteEventType | InstantLoanDepositTimerStartedEventType;
|
|
1710
|
-
/**
|
|
1711
|
-
interface
|
|
1685
|
+
/** Fee-inclusive collateral deposit quote for one transfer target. */
|
|
1686
|
+
interface InstantLoanInitialDepositTargetQuote {
|
|
1687
|
+
/** Full amount to send to the collateral deposit target, including fee. */
|
|
1688
|
+
amount: bigint;
|
|
1689
|
+
/** Inflow fee amount in base units added to the transfer amount. */
|
|
1690
|
+
inflowFeeAmount: bigint;
|
|
1691
|
+
/** Address or ICRC account where the collateral should be sent. */
|
|
1692
|
+
target: SupplyTarget;
|
|
1693
|
+
}
|
|
1694
|
+
/** Fee-inclusive repayment quote for one transfer target. */
|
|
1695
|
+
interface InstantLoanRepaymentTargetQuote {
|
|
1712
1696
|
/** Full amount to send to the repayment target, including fee and interest buffer. */
|
|
1713
1697
|
amount: bigint;
|
|
1698
|
+
/** Inflow fee amount in base units added to the repayment transfer. Falls back to the protocol minimum when live estimation is unavailable. */
|
|
1699
|
+
inflowFeeAmount: bigint;
|
|
1700
|
+
/** Whether `inflowFeeAmount` came from a live fee estimate. */
|
|
1701
|
+
inflowFeeEstimateAvailable: boolean;
|
|
1702
|
+
/** Address or ICRC account where the repayment should be sent. */
|
|
1703
|
+
target: SupplyTarget;
|
|
1704
|
+
}
|
|
1705
|
+
/** Current amount to send to a repayment target to close the debt. */
|
|
1706
|
+
interface InstantLoanRepayment {
|
|
1714
1707
|
/** Decimal scale for `amount`. */
|
|
1715
1708
|
decimals: bigint;
|
|
1716
1709
|
/** Current debt in base units, before fee and interest buffer. */
|
|
@@ -1719,33 +1712,21 @@ interface InstantLoanRepayment {
|
|
|
1719
1712
|
interestBufferAmount: bigint;
|
|
1720
1713
|
/** Seconds of interest accrual included in `interestBufferAmount`. */
|
|
1721
1714
|
interestBufferSeconds: bigint;
|
|
1722
|
-
/** Inflow fee amount in base units added to the repayment transfer. Falls back to the protocol minimum when live estimation is unavailable. */
|
|
1723
|
-
inflowFeeAmount: bigint;
|
|
1724
|
-
/** Whether `inflowFeeAmount` came from a live fee estimate. */
|
|
1725
|
-
inflowFeeEstimateAvailable: boolean;
|
|
1726
1715
|
/** Asset to repay. */
|
|
1727
|
-
asset:
|
|
1728
|
-
/**
|
|
1729
|
-
|
|
1730
|
-
/** Address or ICRC account where the repayment should be sent. */
|
|
1731
|
-
target: SupplyTarget;
|
|
1716
|
+
asset: InstantLoanAsset;
|
|
1717
|
+
/** Available repayment targets keyed by the actual transfer chain. */
|
|
1718
|
+
targets: Partial<Record<Chain, InstantLoanRepaymentTargetQuote>>;
|
|
1732
1719
|
}
|
|
1733
1720
|
/** Initial collateral deposit quote returned when an instant loan is created. */
|
|
1734
1721
|
interface InstantLoanInitialDeposit {
|
|
1735
|
-
/** Full amount to send to the deposit target, including the estimated inflow fee. */
|
|
1736
|
-
amount: bigint;
|
|
1737
1722
|
/** Decimal scale for `amount`, `collateralAmount`, and `inflowFeeAmount`. */
|
|
1738
1723
|
decimals: bigint;
|
|
1739
1724
|
/** Intended credited collateral amount in base units, before inflow fees. */
|
|
1740
1725
|
collateralAmount: bigint;
|
|
1741
|
-
/** Inflow fee amount in base units added to the transfer amount. */
|
|
1742
|
-
inflowFeeAmount: bigint;
|
|
1743
1726
|
/** Collateral asset to deposit. */
|
|
1744
|
-
asset:
|
|
1745
|
-
/**
|
|
1746
|
-
|
|
1747
|
-
/** Address or ICRC account where the collateral should be sent. */
|
|
1748
|
-
target: SupplyTarget;
|
|
1727
|
+
asset: InstantLoanAsset;
|
|
1728
|
+
/** Available collateral deposit targets keyed by the actual transfer chain. */
|
|
1729
|
+
targets: Partial<Record<Chain, InstantLoanInitialDepositTargetQuote>>;
|
|
1749
1730
|
/** Unix timestamp in seconds when the collateral deposit was detected, or null before detection. */
|
|
1750
1731
|
detectedTimestamp: bigint | null;
|
|
1751
1732
|
/** Unix timestamp in seconds when the collateral deposit window expires, or null before detection when unavailable. */
|
|
@@ -1779,30 +1760,24 @@ interface InstantLoanTerms {
|
|
|
1779
1760
|
interface InstantLoanCollateral {
|
|
1780
1761
|
/** Principal text of the collateral pool. */
|
|
1781
1762
|
poolId: string;
|
|
1782
|
-
/**
|
|
1783
|
-
asset:
|
|
1784
|
-
/** Chain used for collateral deposits. */
|
|
1785
|
-
chain: MarketChain;
|
|
1763
|
+
/** Asset deposited as collateral. Transfer rails are exposed by `initialDeposit.targets`. */
|
|
1764
|
+
asset: InstantLoanAsset;
|
|
1786
1765
|
/** Decimal scale for collateral amounts. */
|
|
1787
1766
|
decimals: bigint;
|
|
1788
1767
|
/** Intended credited collateral amount in base units, before inflow fees. */
|
|
1789
1768
|
amount: bigint;
|
|
1790
1769
|
}
|
|
1791
1770
|
/** Borrow leg selected for an instant loan. */
|
|
1792
|
-
|
|
1771
|
+
type InstantLoanBorrow = AssetIdentifier & {
|
|
1793
1772
|
/** Principal text of the borrow pool. */
|
|
1794
1773
|
poolId: string;
|
|
1795
|
-
/** Borrow asset symbol. */
|
|
1796
|
-
asset: MarketAsset;
|
|
1797
|
-
/** Chain used for repayment. */
|
|
1798
|
-
chain: MarketChain;
|
|
1799
1774
|
/** Decimal scale for borrow and debt amounts. */
|
|
1800
1775
|
decimals: bigint;
|
|
1801
1776
|
/** Requested borrow amount in base units. */
|
|
1802
1777
|
amount: bigint;
|
|
1803
1778
|
/** Destination that receives the borrowed asset. */
|
|
1804
1779
|
destination: InstantLoanAccount;
|
|
1805
|
-
}
|
|
1780
|
+
};
|
|
1806
1781
|
/** Hydrated instant-loan state plus generated quote targets. */
|
|
1807
1782
|
interface InstantLoan {
|
|
1808
1783
|
/** Canister-assigned loan id. */
|
|
@@ -1815,7 +1790,7 @@ interface InstantLoan {
|
|
|
1815
1790
|
profileId: string;
|
|
1816
1791
|
/** Immutable loan terms. */
|
|
1817
1792
|
terms: InstantLoanTerms;
|
|
1818
|
-
/** Collateral-side pool, asset,
|
|
1793
|
+
/** Collateral-side pool, asset, decimals, and requested credited amount. */
|
|
1819
1794
|
collateral: InstantLoanCollateral;
|
|
1820
1795
|
/** Borrow-side pool, asset, chain, decimals, requested amount, and destination. */
|
|
1821
1796
|
borrow: InstantLoanBorrow;
|
|
@@ -1829,6 +1804,17 @@ interface InstantLoan {
|
|
|
1829
1804
|
position: InstantLoanPositionSummary;
|
|
1830
1805
|
}
|
|
1831
1806
|
|
|
1807
|
+
/**
|
|
1808
|
+
* A loan was created remotely, but the SDK could not load its enriched state.
|
|
1809
|
+
* Retry with `instantLoans.get({ loanId })`; do not create the loan again.
|
|
1810
|
+
*/
|
|
1811
|
+
declare class InstantLoanCreatedError extends Error {
|
|
1812
|
+
readonly code: "INSTANT_LOAN_HYDRATION_FAILED";
|
|
1813
|
+
readonly loanId: bigint;
|
|
1814
|
+
readonly ref: string;
|
|
1815
|
+
readonly cause: unknown;
|
|
1816
|
+
constructor(loanId: bigint, cause: unknown);
|
|
1817
|
+
}
|
|
1832
1818
|
/** Accountless instant-loan creation, lookup, recovery, and canister query helpers. */
|
|
1833
1819
|
declare class InstantLoansModule {
|
|
1834
1820
|
private readonly canisterContext;
|
|
@@ -1846,12 +1832,12 @@ declare class InstantLoansModule {
|
|
|
1846
1832
|
* selected pool decimals, and call `client.quote.calculateLtv(...)` before
|
|
1847
1833
|
* creation to block invalid LTV input.
|
|
1848
1834
|
*
|
|
1849
|
-
* `
|
|
1850
|
-
* `
|
|
1835
|
+
* `borrow.destination` receives the borrowed asset after the loan starts.
|
|
1836
|
+
* `refund.destination` receives collateral refunds or withdrawals. Use
|
|
1851
1837
|
* `depositWindowSeconds` for the user-facing collateral deposit timeout; the
|
|
1852
1838
|
* SDK maps it to the canister's internal `ltv_timer_s` field.
|
|
1853
1839
|
*
|
|
1854
|
-
* @param request -
|
|
1840
|
+
* @param request - Collateral, borrow, refund, LTV limit, timeout, and inflow options.
|
|
1855
1841
|
* @returns Hydrated loan state plus generated initial-deposit and repayment quote targets.
|
|
1856
1842
|
*/
|
|
1857
1843
|
create(request: CreateInstantLoanRequest): Promise<InstantLoan>;
|
|
@@ -1919,6 +1905,8 @@ declare class InstantLoansModule {
|
|
|
1919
1905
|
private getCollateralAmountHint;
|
|
1920
1906
|
private hydrateLoan;
|
|
1921
1907
|
private createInitialDepositQuote;
|
|
1908
|
+
private resolveInstantLoanInflowTargets;
|
|
1909
|
+
private createRepaymentTargetQuotes;
|
|
1922
1910
|
private estimateRepaymentInflowFee;
|
|
1923
1911
|
private requireApi;
|
|
1924
1912
|
private validateInstantLoanLtvPolicy;
|
|
@@ -2204,6 +2192,20 @@ declare const RATE_SCALE = 1000000000000000000000000000n;
|
|
|
2204
2192
|
/** Number of decimal places represented by {@link RATE_SCALE}. */
|
|
2205
2193
|
declare const RATE_DECIMALS: bigint;
|
|
2206
2194
|
|
|
2195
|
+
/** Minimum withdraw amounts in each asset's base units. */
|
|
2196
|
+
declare const MIN_WITHDRAW_AMOUNTS_BY_ASSET: {
|
|
2197
|
+
readonly BTC: 5000n;
|
|
2198
|
+
readonly USDC: 1000000n;
|
|
2199
|
+
readonly USDT: 1000000n;
|
|
2200
|
+
};
|
|
2201
|
+
type MinimumWithdrawAsset = keyof typeof MIN_WITHDRAW_AMOUNTS_BY_ASSET;
|
|
2202
|
+
/**
|
|
2203
|
+
* Returns the minimum withdraw amount for an asset in base units.
|
|
2204
|
+
*
|
|
2205
|
+
* Assets without a configured product minimum return `0n`.
|
|
2206
|
+
*/
|
|
2207
|
+
declare function getMinimumWithdrawAmount(asset: string): bigint;
|
|
2208
|
+
|
|
2207
2209
|
/**
|
|
2208
2210
|
* Wallet wiring for {@link executeWith}.
|
|
2209
2211
|
*
|
|
@@ -2214,7 +2216,7 @@ interface ExecuteWithOptions {
|
|
|
2214
2216
|
/** Must expose the methods required by the action's `executionKind`. */
|
|
2215
2217
|
walletAdapter: WalletAdapter;
|
|
2216
2218
|
/** Required for `sign-message` actions; forwarded to the adapter and submit payload. */
|
|
2217
|
-
chain?:
|
|
2219
|
+
chain?: SigningChain;
|
|
2218
2220
|
/** Optional signing/sending account override. */
|
|
2219
2221
|
account?: string;
|
|
2220
2222
|
}
|
|
@@ -2222,12 +2224,10 @@ interface ExecuteWithOptions {
|
|
|
2222
2224
|
* Returns an async function that runs a {@link WalletAction} end-to-end.
|
|
2223
2225
|
*
|
|
2224
2226
|
* - `sign-message`: needs `walletAdapter.signMessage` and `options.chain`.
|
|
2225
|
-
* - `sign-psbt`: reserved; no current SDK flow emits this action.
|
|
2226
|
-
* - `send-eth-transaction`: needs `walletAdapter.sendEthTransaction`.
|
|
2227
2227
|
*
|
|
2228
2228
|
* @param options - Adapter and optional chain/account overrides.
|
|
2229
2229
|
* @returns A function that accepts a `WalletAction` and resolves with its submit result.
|
|
2230
2230
|
*/
|
|
2231
2231
|
declare function executeWith(options: ExecuteWithOptions): <TResult>(action: WalletAction<TResult>) => Promise<TResult>;
|
|
2232
2232
|
|
|
2233
|
-
export {
|
|
2233
|
+
export { AccountsModule, ActivitiesModule, type Activity, ActivityFilter, type ActivityStatusFoundResponse, type ActivityStatusNotFoundResponse, type ActivityTopUp, Asset, type AssetIdentifier, type AssetPrices, type BaseGetActivityStatusRequest, type BaseListActivitiesRequest, type BorrowAction, type BorrowOutflowDetails, type BorrowingPower, CK_ETH_DEPOSIT_CONTRACT_ADDRESS, type CalculateLtvRequest, type CanisterIdOverrides, type CanisterIds, Chain, type ChainAddressAccount, type ContractInteractionSupplyFlowRequest, type CreateAccountAction, type CreateAccountData, type CreateAccountRequest, type CreateBorrowData, type CreateBorrowRequest, type CreateInstantLoanBorrow, type CreateInstantLoanCollateral, type CreateInstantLoanRefund, type CreateInstantLoanRequest, type CreateProfileParams, type CreateTransferErc20TransactionParams, type CreateWithdrawData, type CreateWithdrawRequest, Environment, type EstimateInflowFeeRequest, type EthTransactionRequest, type EvmContractTransaction, type EvmReadClient, EvmSupplyApprovalStrategy, type EvmSupplyContext, type ExecuteWithOptions, type FindPoolQuery, type FullWithdrawAmount, type GetActivityStatusByProfileRequest, type GetActivityStatusByShortRefRequest, type GetActivityStatusRequest, type GetActivityStatusResponse, type GetDepositAddressRequest, type GetEvmSupplyContextRequest, type HealthFactor, HistoryModule, type IcPrincipalAccount, type IcpAccountIdentifierAccount, type IcrcAccount, type IcrcTransferDetails, type InflowActivity, type InflowActivityOperation, type InflowActivityStatus, type InflowFeeEstimate, type InflowOperation, type InstantLoan, type InstantLoanAccount, type InstantLoanAsset, type InstantLoanAuthorization, type InstantLoanBorrow, type InstantLoanBorrowRequestedEventType, type InstantLoanCollateral, type InstantLoanConfig, InstantLoanCreatedError, type InstantLoanCreatedEventType, type InstantLoanDepositTimerExceededEventType, type InstantLoanDepositTimerStartedEventType, type InstantLoanDestination, type InstantLoanEvent, type InstantLoanEventType, type InstantLoanFindBorrow, type InstantLoanFindCollateral, type InstantLoanFindResult, type InstantLoanFullLendWithdrawalRequestedEventType, type InstantLoanGetByIdRequest, type InstantLoanGetByRefRequest, type InstantLoanGetRequest, type InstantLoanInitialDeposit, type InstantLoanInitialDepositTargetQuote, type InstantLoanLeg, type InstantLoanListEventsRequest, type InstantLoanPositionSummary, type InstantLoanProfileWarmedEventType, type InstantLoanRepayCompleteEventType, type InstantLoanRepayment, type InstantLoanRepaymentTargetQuote, type InstantLoanStuckFundsWithdrawalRequestedEventType, type InstantLoanTerms, type InstantLoanWarmedProfile, InstantLoansModule, LendingModule, type LiquidiumAccount, type LiquidiumAccountInput, type LiquidiumAccountReference, LiquidiumAccountType, LiquidiumClient, type LiquidiumClientConfig, LiquidiumError, LiquidiumErrorCode, type LiquidiumErrorContext, type LiquidiumOperation, type LiquidiumState, type LiquidiumStatus, type ListActivitiesByProfileRequest, type ListActivitiesByShortRefRequest, type ListActivitiesRequest, type LtvCalculation, MIN_BORROW_AMOUNTS_BY_ASSET, MIN_WITHDRAW_AMOUNTS_BY_ASSET, type ManualTransferSupplyFlowRequest, MarketModule, type MaxRepayAmount, type MinimumBorrowAsset, type MinimumWithdrawAsset, type OutflowActivity, type OutflowActivityOperation, type OutflowActivityStatus, type OutflowDetails, OutflowType, type PaginatedResponse, type Pool, type PoolCanisterIds, type PoolRate, type Position, PositionsModule, type PrepareCreateProfileOptions, QuoteModule, type QuoteRequest, type QuoteResult, type QuoteValidationError, QuoteValidationErrorCode, type QuoteWarning, QuoteWarningCode, RATE_DECIMALS, RATE_SCALE, type SendBtcTransactionRequest, type SendEthTransactionRequest, type SendIcrcTransferRequest, type SignMessageRequest, type SignMessageWalletAction, type SignatureInfo, type SigningChain, type SubmitInflowRequest, type SubmitInflowResponse, type SubmitSupplyFlowInflowRequest, SupplyAction, type SupplyFlow, type SupplyFlowRequest, SupplyPlanType, type SupplyTarget, type TransferSupplyFlowRequest, USDC_CONTRACT_ADDRESS, USDT_CONTRACT_ADDRESS, type UserHistoryEntry, type UserHistoryEntryApiItem, type UserHistoryOperation, type UserHistoryResponse, type UserLiquidationHistoryEntry, type UserLiquidationHistoryFilters, type UserPositionSummary, type UserReserve, type UserStats, type UserTransactionHistoryEntry, type UserTransactionHistoryFilters, type UserTransactionHistoryOperation, type UserTransactionHistoryState, type Wallet, type WalletAction, WalletActionKind, type WalletAdapter, WalletExecutionKind, type WalletExecutionParams, type WalletTransferSupplyFlowRequest, type WithdrawAction, type WithdrawOutflowDetails, createTransferErc20Transaction, executeWith, getMinimumBorrowAmount, getMinimumWithdrawAmount, intFromPublicId, isAssetIdentifier, publicIdFromInt };
|