@t2000/sdk 0.22.3 → 0.23.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/dist/adapters/index.cjs +3 -3
- package/dist/adapters/index.cjs.map +1 -1
- package/dist/adapters/index.d.cts +1 -1
- package/dist/adapters/index.d.ts +1 -1
- package/dist/adapters/index.js +3 -3
- package/dist/adapters/index.js.map +1 -1
- package/dist/browser.cjs +3 -3
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +2 -2
- package/dist/browser.d.ts +2 -2
- package/dist/browser.js +3 -3
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +273 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +111 -6
- package/dist/index.d.ts +111 -6
- package/dist/index.js +253 -5
- package/dist/index.js.map +1 -1
- package/dist/{token-registry-DLEKjV8I.d.ts → token-registry-Bv1I9qeU.d.ts} +13 -2
- package/dist/{token-registry-bf_caDsv.d.cts → token-registry-DDy743E6.d.cts} +13 -2
- package/dist/{types-XWEUAS-X.d.cts → types-DT-3gVTX.d.cts} +63 -1
- package/dist/{types-XWEUAS-X.d.ts → types-DT-3gVTX.d.ts} +63 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
2
2
|
import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
|
|
3
3
|
import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
|
|
4
|
-
import { G as GasMethod } from './types-
|
|
4
|
+
import { G as GasMethod } from './types-DT-3gVTX.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Abstract signing interface that decouples the SDK from any specific
|
|
@@ -235,6 +235,17 @@ declare function assertAllowedAsset(op: Operation, asset: string | undefined): v
|
|
|
235
235
|
declare const DEFAULT_NETWORK: "mainnet";
|
|
236
236
|
declare const CETUS_USDC_SUI_POOL = "0x51e883ba7c0b566a26cbc8a94cd33eb0abd418a77cc1e60ad22fd9b1f29cd2ab";
|
|
237
237
|
declare const GAS_RESERVE_MIN = 0.05;
|
|
238
|
+
declare const ALLOWANCE_FEATURES: {
|
|
239
|
+
readonly BRIEFING: 0;
|
|
240
|
+
readonly YIELD_ALERT: 1;
|
|
241
|
+
readonly PAYMENT_ALERT: 2;
|
|
242
|
+
readonly ACTION_REMIND: 3;
|
|
243
|
+
readonly SESSION: 4;
|
|
244
|
+
readonly AUTO_COMPOUND: 5;
|
|
245
|
+
readonly DCA: 6;
|
|
246
|
+
readonly HF_ALERT: 7;
|
|
247
|
+
};
|
|
248
|
+
type AllowanceFeature = typeof ALLOWANCE_FEATURES[keyof typeof ALLOWANCE_FEATURES];
|
|
238
249
|
|
|
239
250
|
declare function validateAddress(address: string): string;
|
|
240
251
|
declare function truncateAddress(address: string): string;
|
|
@@ -367,4 +378,4 @@ declare const IKA_TYPE: string;
|
|
|
367
378
|
declare const LOFI_TYPE: string;
|
|
368
379
|
declare const MANIFEST_TYPE: string;
|
|
369
380
|
|
|
370
|
-
export { formatAssetAmount as $, ALL_NAVI_ASSETS as A, BPS_DENOMINATOR as B, CLOCK_ID as C, DEFAULT_NETWORK as D, ETH_TYPE as E, type FeeOperation as F, GAS_RESERVE_MIN as G, USDSUI_TYPE as H, IKA_TYPE as I, USDT_TYPE as J, KeypairSigner as K, LOFI_TYPE as L, MANIFEST_TYPE as M, NAVX_TYPE as N, OUTBOUND_OPS as O, type ProtocolFeeInfo as P, WBTC_TYPE as Q, ZkLoginSigner as R, STABLE_ASSETS as S, T2000Error as T, USDC_DECIMALS as U, addCollectFeeToTx as V, WAL_TYPE as W, calculateFee as X, executeAutoTopUp as Y, type ZkLoginProof as Z, executeWithGas as _, type AutoTopUpResult as a, formatSui as a0, formatUsd as a1, getDecimals as a2, getDecimalsForCoinType as a3, getGasStatus as a4, getTier as a5, isSupported as a6, isTier1 as a7, isTier2 as a8, mapMoveAbortCode as a9, mapWalletError as aa, mistToSui as ab, rawToStable as ac, rawToUsdc as ad, resolveSymbol as ae, resolveTokenType as af, shouldAutoTopUp as ag, stableToRaw as ah, suiToMist as ai, truncateAddress as aj, usdcToRaw as ak, validateAddress as al, SafeguardEnforcer as am,
|
|
381
|
+
export { formatAssetAmount as $, ALL_NAVI_ASSETS as A, BPS_DENOMINATOR as B, CLOCK_ID as C, DEFAULT_NETWORK as D, ETH_TYPE as E, type FeeOperation as F, GAS_RESERVE_MIN as G, USDSUI_TYPE as H, IKA_TYPE as I, USDT_TYPE as J, KeypairSigner as K, LOFI_TYPE as L, MANIFEST_TYPE as M, NAVX_TYPE as N, OUTBOUND_OPS as O, type ProtocolFeeInfo as P, WBTC_TYPE as Q, ZkLoginSigner as R, STABLE_ASSETS as S, T2000Error as T, USDC_DECIMALS as U, addCollectFeeToTx as V, WAL_TYPE as W, calculateFee as X, executeAutoTopUp as Y, type ZkLoginProof as Z, executeWithGas as _, type AutoTopUpResult as a, formatSui as a0, formatUsd as a1, getDecimals as a2, getDecimalsForCoinType as a3, getGasStatus as a4, getTier as a5, isSupported as a6, isTier1 as a7, isTier2 as a8, mapMoveAbortCode as a9, mapWalletError as aa, mistToSui as ab, rawToStable as ac, rawToUsdc as ad, resolveSymbol as ae, resolveTokenType as af, shouldAutoTopUp as ag, stableToRaw as ah, suiToMist as ai, truncateAddress as aj, usdcToRaw as ak, validateAddress as al, SafeguardEnforcer as am, type AllowanceFeature as an, ALLOWANCE_FEATURES as ao, CETUS_USDC_SUI_POOL as ap, OPERATION_ASSETS as aq, type Operation as ar, assertAllowedAsset as as, isAllowedAsset as at, simulateTransaction as au, throwIfSimulationFailed as av, COIN_REGISTRY as b, type CoinMeta as c, DEFAULT_SAFEGUARD_CONFIG as d, type GasExecutionResult as e, type GasRequestType as f, type GasSponsorResponse as g, type GasStatusResponse as h, MIST_PER_SUI as i, SUI_DECIMALS as j, SUI_TYPE as k, SUPPORTED_ASSETS as l, type SafeguardConfig as m, SafeguardError as n, type SafeguardErrorDetails as o, type SafeguardRule as p, type SimulationResult as q, type StableAsset as r, type SupportedAsset as s, type T2000ErrorCode as t, type T2000ErrorData as u, TOKEN_MAP as v, type TransactionSigner as w, type TxMetadata as x, USDC_TYPE as y, USDE_TYPE as z };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
2
2
|
import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
|
|
3
3
|
import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
|
|
4
|
-
import { G as GasMethod } from './types-
|
|
4
|
+
import { G as GasMethod } from './types-DT-3gVTX.cjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Abstract signing interface that decouples the SDK from any specific
|
|
@@ -235,6 +235,17 @@ declare function assertAllowedAsset(op: Operation, asset: string | undefined): v
|
|
|
235
235
|
declare const DEFAULT_NETWORK: "mainnet";
|
|
236
236
|
declare const CETUS_USDC_SUI_POOL = "0x51e883ba7c0b566a26cbc8a94cd33eb0abd418a77cc1e60ad22fd9b1f29cd2ab";
|
|
237
237
|
declare const GAS_RESERVE_MIN = 0.05;
|
|
238
|
+
declare const ALLOWANCE_FEATURES: {
|
|
239
|
+
readonly BRIEFING: 0;
|
|
240
|
+
readonly YIELD_ALERT: 1;
|
|
241
|
+
readonly PAYMENT_ALERT: 2;
|
|
242
|
+
readonly ACTION_REMIND: 3;
|
|
243
|
+
readonly SESSION: 4;
|
|
244
|
+
readonly AUTO_COMPOUND: 5;
|
|
245
|
+
readonly DCA: 6;
|
|
246
|
+
readonly HF_ALERT: 7;
|
|
247
|
+
};
|
|
248
|
+
type AllowanceFeature = typeof ALLOWANCE_FEATURES[keyof typeof ALLOWANCE_FEATURES];
|
|
238
249
|
|
|
239
250
|
declare function validateAddress(address: string): string;
|
|
240
251
|
declare function truncateAddress(address: string): string;
|
|
@@ -367,4 +378,4 @@ declare const IKA_TYPE: string;
|
|
|
367
378
|
declare const LOFI_TYPE: string;
|
|
368
379
|
declare const MANIFEST_TYPE: string;
|
|
369
380
|
|
|
370
|
-
export { formatAssetAmount as $, ALL_NAVI_ASSETS as A, BPS_DENOMINATOR as B, CLOCK_ID as C, DEFAULT_NETWORK as D, ETH_TYPE as E, type FeeOperation as F, GAS_RESERVE_MIN as G, USDSUI_TYPE as H, IKA_TYPE as I, USDT_TYPE as J, KeypairSigner as K, LOFI_TYPE as L, MANIFEST_TYPE as M, NAVX_TYPE as N, OUTBOUND_OPS as O, type ProtocolFeeInfo as P, WBTC_TYPE as Q, ZkLoginSigner as R, STABLE_ASSETS as S, T2000Error as T, USDC_DECIMALS as U, addCollectFeeToTx as V, WAL_TYPE as W, calculateFee as X, executeAutoTopUp as Y, type ZkLoginProof as Z, executeWithGas as _, type AutoTopUpResult as a, formatSui as a0, formatUsd as a1, getDecimals as a2, getDecimalsForCoinType as a3, getGasStatus as a4, getTier as a5, isSupported as a6, isTier1 as a7, isTier2 as a8, mapMoveAbortCode as a9, mapWalletError as aa, mistToSui as ab, rawToStable as ac, rawToUsdc as ad, resolveSymbol as ae, resolveTokenType as af, shouldAutoTopUp as ag, stableToRaw as ah, suiToMist as ai, truncateAddress as aj, usdcToRaw as ak, validateAddress as al, SafeguardEnforcer as am,
|
|
381
|
+
export { formatAssetAmount as $, ALL_NAVI_ASSETS as A, BPS_DENOMINATOR as B, CLOCK_ID as C, DEFAULT_NETWORK as D, ETH_TYPE as E, type FeeOperation as F, GAS_RESERVE_MIN as G, USDSUI_TYPE as H, IKA_TYPE as I, USDT_TYPE as J, KeypairSigner as K, LOFI_TYPE as L, MANIFEST_TYPE as M, NAVX_TYPE as N, OUTBOUND_OPS as O, type ProtocolFeeInfo as P, WBTC_TYPE as Q, ZkLoginSigner as R, STABLE_ASSETS as S, T2000Error as T, USDC_DECIMALS as U, addCollectFeeToTx as V, WAL_TYPE as W, calculateFee as X, executeAutoTopUp as Y, type ZkLoginProof as Z, executeWithGas as _, type AutoTopUpResult as a, formatSui as a0, formatUsd as a1, getDecimals as a2, getDecimalsForCoinType as a3, getGasStatus as a4, getTier as a5, isSupported as a6, isTier1 as a7, isTier2 as a8, mapMoveAbortCode as a9, mapWalletError as aa, mistToSui as ab, rawToStable as ac, rawToUsdc as ad, resolveSymbol as ae, resolveTokenType as af, shouldAutoTopUp as ag, stableToRaw as ah, suiToMist as ai, truncateAddress as aj, usdcToRaw as ak, validateAddress as al, SafeguardEnforcer as am, type AllowanceFeature as an, ALLOWANCE_FEATURES as ao, CETUS_USDC_SUI_POOL as ap, OPERATION_ASSETS as aq, type Operation as ar, assertAllowedAsset as as, isAllowedAsset as at, simulateTransaction as au, throwIfSimulationFailed as av, COIN_REGISTRY as b, type CoinMeta as c, DEFAULT_SAFEGUARD_CONFIG as d, type GasExecutionResult as e, type GasRequestType as f, type GasSponsorResponse as g, type GasStatusResponse as h, MIST_PER_SUI as i, SUI_DECIMALS as j, SUI_TYPE as k, SUPPORTED_ASSETS as l, type SafeguardConfig as m, SafeguardError as n, type SafeguardErrorDetails as o, type SafeguardRule as p, type SimulationResult as q, type StableAsset as r, type SupportedAsset as s, type T2000ErrorCode as t, type T2000ErrorData as u, TOKEN_MAP as v, type TransactionSigner as w, type TxMetadata as x, USDC_TYPE as y, USDE_TYPE as z };
|
|
@@ -203,5 +203,67 @@ interface PayResult {
|
|
|
203
203
|
timestamp: string;
|
|
204
204
|
};
|
|
205
205
|
}
|
|
206
|
+
interface AllowanceInfo {
|
|
207
|
+
id: string;
|
|
208
|
+
owner: string;
|
|
209
|
+
balance: bigint;
|
|
210
|
+
totalDeposited: bigint;
|
|
211
|
+
totalSpent: bigint;
|
|
212
|
+
createdAt: number;
|
|
213
|
+
coinType: string;
|
|
214
|
+
permittedFeatures: bigint;
|
|
215
|
+
expiresAt: number;
|
|
216
|
+
dailyLimit: bigint;
|
|
217
|
+
dailySpent: bigint;
|
|
218
|
+
windowStart: number;
|
|
219
|
+
}
|
|
220
|
+
interface AllowanceCreateResult {
|
|
221
|
+
success: boolean;
|
|
222
|
+
tx: string;
|
|
223
|
+
allowanceId: string;
|
|
224
|
+
gasCost: number;
|
|
225
|
+
gasMethod: GasMethod;
|
|
226
|
+
}
|
|
227
|
+
interface AllowanceDepositResult {
|
|
228
|
+
success: boolean;
|
|
229
|
+
tx: string;
|
|
230
|
+
amount: number;
|
|
231
|
+
newBalance: bigint;
|
|
232
|
+
gasCost: number;
|
|
233
|
+
gasMethod: GasMethod;
|
|
234
|
+
}
|
|
235
|
+
interface AllowanceWithdrawResult {
|
|
236
|
+
success: boolean;
|
|
237
|
+
tx: string;
|
|
238
|
+
amount: number;
|
|
239
|
+
gasCost: number;
|
|
240
|
+
gasMethod: GasMethod;
|
|
241
|
+
}
|
|
242
|
+
interface AllowanceDeductResult {
|
|
243
|
+
success: boolean;
|
|
244
|
+
tx: string;
|
|
245
|
+
amount: number;
|
|
246
|
+
feature: number;
|
|
247
|
+
remaining: bigint;
|
|
248
|
+
gasCost: number;
|
|
249
|
+
gasMethod: GasMethod;
|
|
250
|
+
}
|
|
251
|
+
type HFAlertLevel = 'none' | 'warn' | 'critical';
|
|
252
|
+
interface FinancialSummary {
|
|
253
|
+
walletAddress: string;
|
|
254
|
+
usdcAvailable: number;
|
|
255
|
+
savingsBalance: number;
|
|
256
|
+
debtBalance: number;
|
|
257
|
+
idleUsdc: number;
|
|
258
|
+
healthFactor: number;
|
|
259
|
+
hfAlertLevel: HFAlertLevel;
|
|
260
|
+
saveApy: number;
|
|
261
|
+
borrowApy: number;
|
|
262
|
+
dailyYield: number;
|
|
263
|
+
gasReserveSui: number;
|
|
264
|
+
gasReserveUsd: number;
|
|
265
|
+
allowanceBalance: bigint | null;
|
|
266
|
+
fetchedAt: number;
|
|
267
|
+
}
|
|
206
268
|
|
|
207
|
-
export type { AssetRates as A, BalanceResponse as B, ClaimRewardsResult as C, DepositInfo as D, EarningsResult as E, FundStatusResult as F, GasMethod as G, HealthFactorResult as H, MaxBorrowResult as M, PayOptions as P, RatesResult as R, SaveResult as S, TransactionRecord as T, UnstakeVSuiResult as U, WithdrawResult as W, BorrowResult as a, GasReserve as b, MaxWithdrawResult as c, PayResult as d, PendingReward as e, PositionEntry as f, PositionsResult as g, RepayResult as h, SendResult as i, T2000Options as j, StakeVSuiResult as k, SwapResult as l, SwapQuoteResult as m };
|
|
269
|
+
export type { AssetRates as A, BalanceResponse as B, ClaimRewardsResult as C, DepositInfo as D, EarningsResult as E, FundStatusResult as F, GasMethod as G, HealthFactorResult as H, MaxBorrowResult as M, PayOptions as P, RatesResult as R, SaveResult as S, TransactionRecord as T, UnstakeVSuiResult as U, WithdrawResult as W, BorrowResult as a, GasReserve as b, MaxWithdrawResult as c, PayResult as d, PendingReward as e, PositionEntry as f, PositionsResult as g, RepayResult as h, SendResult as i, T2000Options as j, StakeVSuiResult as k, SwapResult as l, SwapQuoteResult as m, AllowanceInfo as n, FinancialSummary as o, AllowanceCreateResult as p, AllowanceDeductResult as q, AllowanceDepositResult as r, AllowanceWithdrawResult as s, HFAlertLevel as t };
|
|
@@ -203,5 +203,67 @@ interface PayResult {
|
|
|
203
203
|
timestamp: string;
|
|
204
204
|
};
|
|
205
205
|
}
|
|
206
|
+
interface AllowanceInfo {
|
|
207
|
+
id: string;
|
|
208
|
+
owner: string;
|
|
209
|
+
balance: bigint;
|
|
210
|
+
totalDeposited: bigint;
|
|
211
|
+
totalSpent: bigint;
|
|
212
|
+
createdAt: number;
|
|
213
|
+
coinType: string;
|
|
214
|
+
permittedFeatures: bigint;
|
|
215
|
+
expiresAt: number;
|
|
216
|
+
dailyLimit: bigint;
|
|
217
|
+
dailySpent: bigint;
|
|
218
|
+
windowStart: number;
|
|
219
|
+
}
|
|
220
|
+
interface AllowanceCreateResult {
|
|
221
|
+
success: boolean;
|
|
222
|
+
tx: string;
|
|
223
|
+
allowanceId: string;
|
|
224
|
+
gasCost: number;
|
|
225
|
+
gasMethod: GasMethod;
|
|
226
|
+
}
|
|
227
|
+
interface AllowanceDepositResult {
|
|
228
|
+
success: boolean;
|
|
229
|
+
tx: string;
|
|
230
|
+
amount: number;
|
|
231
|
+
newBalance: bigint;
|
|
232
|
+
gasCost: number;
|
|
233
|
+
gasMethod: GasMethod;
|
|
234
|
+
}
|
|
235
|
+
interface AllowanceWithdrawResult {
|
|
236
|
+
success: boolean;
|
|
237
|
+
tx: string;
|
|
238
|
+
amount: number;
|
|
239
|
+
gasCost: number;
|
|
240
|
+
gasMethod: GasMethod;
|
|
241
|
+
}
|
|
242
|
+
interface AllowanceDeductResult {
|
|
243
|
+
success: boolean;
|
|
244
|
+
tx: string;
|
|
245
|
+
amount: number;
|
|
246
|
+
feature: number;
|
|
247
|
+
remaining: bigint;
|
|
248
|
+
gasCost: number;
|
|
249
|
+
gasMethod: GasMethod;
|
|
250
|
+
}
|
|
251
|
+
type HFAlertLevel = 'none' | 'warn' | 'critical';
|
|
252
|
+
interface FinancialSummary {
|
|
253
|
+
walletAddress: string;
|
|
254
|
+
usdcAvailable: number;
|
|
255
|
+
savingsBalance: number;
|
|
256
|
+
debtBalance: number;
|
|
257
|
+
idleUsdc: number;
|
|
258
|
+
healthFactor: number;
|
|
259
|
+
hfAlertLevel: HFAlertLevel;
|
|
260
|
+
saveApy: number;
|
|
261
|
+
borrowApy: number;
|
|
262
|
+
dailyYield: number;
|
|
263
|
+
gasReserveSui: number;
|
|
264
|
+
gasReserveUsd: number;
|
|
265
|
+
allowanceBalance: bigint | null;
|
|
266
|
+
fetchedAt: number;
|
|
267
|
+
}
|
|
206
268
|
|
|
207
|
-
export type { AssetRates as A, BalanceResponse as B, ClaimRewardsResult as C, DepositInfo as D, EarningsResult as E, FundStatusResult as F, GasMethod as G, HealthFactorResult as H, MaxBorrowResult as M, PayOptions as P, RatesResult as R, SaveResult as S, TransactionRecord as T, UnstakeVSuiResult as U, WithdrawResult as W, BorrowResult as a, GasReserve as b, MaxWithdrawResult as c, PayResult as d, PendingReward as e, PositionEntry as f, PositionsResult as g, RepayResult as h, SendResult as i, T2000Options as j, StakeVSuiResult as k, SwapResult as l, SwapQuoteResult as m };
|
|
269
|
+
export type { AssetRates as A, BalanceResponse as B, ClaimRewardsResult as C, DepositInfo as D, EarningsResult as E, FundStatusResult as F, GasMethod as G, HealthFactorResult as H, MaxBorrowResult as M, PayOptions as P, RatesResult as R, SaveResult as S, TransactionRecord as T, UnstakeVSuiResult as U, WithdrawResult as W, BorrowResult as a, GasReserve as b, MaxWithdrawResult as c, PayResult as d, PendingReward as e, PositionEntry as f, PositionsResult as g, RepayResult as h, SendResult as i, T2000Options as j, StakeVSuiResult as k, SwapResult as l, SwapQuoteResult as m, AllowanceInfo as n, FinancialSummary as o, AllowanceCreateResult as p, AllowanceDeductResult as q, AllowanceDepositResult as r, AllowanceWithdrawResult as s, HFAlertLevel as t };
|