@t2000/sdk 1.24.14 → 1.25.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.d.cts +2 -1
- package/dist/adapters/index.d.ts +2 -1
- package/dist/browser.cjs +1 -0
- 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 +1 -0
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +135 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -4
- package/dist/index.d.ts +13 -4
- package/dist/index.js +128 -14
- package/dist/index.js.map +1 -1
- package/dist/types-BaYOyGKJ.d.cts +509 -0
- package/dist/types-BaYOyGKJ.d.ts +509 -0
- package/dist/{types-D1-rO-J4.d.ts → types-Bheg9UZP.d.ts} +84 -228
- package/dist/{types-DvNhsBbN.d.cts → types-Cv9ZQ7KK.d.cts} +84 -228
- package/package.json +3 -1
- package/dist/types-jAD-e7Pq.d.cts +0 -254
- package/dist/types-jAD-e7Pq.d.ts +0 -254
package/dist/types-jAD-e7Pq.d.ts
DELETED
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
interface T2000Options {
|
|
2
|
-
keyPath?: string;
|
|
3
|
-
/** PIN to decrypt the key file. Accepts any string (4+ chars). */
|
|
4
|
-
pin?: string;
|
|
5
|
-
/** @deprecated Use `pin` instead. */
|
|
6
|
-
passphrase?: string;
|
|
7
|
-
network?: 'mainnet' | 'testnet';
|
|
8
|
-
rpcUrl?: string;
|
|
9
|
-
}
|
|
10
|
-
interface GasReserve {
|
|
11
|
-
sui: number;
|
|
12
|
-
usdEquiv: number;
|
|
13
|
-
}
|
|
14
|
-
interface BalanceResponse {
|
|
15
|
-
available: number;
|
|
16
|
-
savings: number;
|
|
17
|
-
debt: number;
|
|
18
|
-
pendingRewards: number;
|
|
19
|
-
gasReserve: GasReserve;
|
|
20
|
-
total: number;
|
|
21
|
-
stables: Record<string, number>;
|
|
22
|
-
}
|
|
23
|
-
interface SendResult {
|
|
24
|
-
success: boolean;
|
|
25
|
-
tx: string;
|
|
26
|
-
amount: number;
|
|
27
|
-
to: string;
|
|
28
|
-
contactName?: string;
|
|
29
|
-
gasCost: number;
|
|
30
|
-
gasCostUnit: string;
|
|
31
|
-
balance: BalanceResponse;
|
|
32
|
-
}
|
|
33
|
-
interface SaveResult {
|
|
34
|
-
success: boolean;
|
|
35
|
-
tx: string;
|
|
36
|
-
amount: number;
|
|
37
|
-
apy: number;
|
|
38
|
-
fee: number;
|
|
39
|
-
gasCost: number;
|
|
40
|
-
savingsBalance: number;
|
|
41
|
-
}
|
|
42
|
-
interface WithdrawResult {
|
|
43
|
-
success: boolean;
|
|
44
|
-
tx: string;
|
|
45
|
-
amount: number;
|
|
46
|
-
asset?: string;
|
|
47
|
-
gasCost: number;
|
|
48
|
-
}
|
|
49
|
-
interface BorrowResult {
|
|
50
|
-
success: boolean;
|
|
51
|
-
tx: string;
|
|
52
|
-
amount: number;
|
|
53
|
-
/** [v0.51.0] Asset borrowed — 'USDC' or 'USDsui'. Optional for backward compat. */
|
|
54
|
-
asset?: string;
|
|
55
|
-
fee: number;
|
|
56
|
-
healthFactor: number;
|
|
57
|
-
gasCost: number;
|
|
58
|
-
}
|
|
59
|
-
interface RepayResult {
|
|
60
|
-
success: boolean;
|
|
61
|
-
tx: string;
|
|
62
|
-
amount: number;
|
|
63
|
-
/** [v0.51.1] Asset repaid — 'USDC' or 'USDsui'. Optional for backward compat. */
|
|
64
|
-
asset?: string;
|
|
65
|
-
remainingDebt: number;
|
|
66
|
-
gasCost: number;
|
|
67
|
-
}
|
|
68
|
-
interface HealthFactorResult {
|
|
69
|
-
healthFactor: number;
|
|
70
|
-
supplied: number;
|
|
71
|
-
borrowed: number;
|
|
72
|
-
maxBorrow: number;
|
|
73
|
-
liquidationThreshold: number;
|
|
74
|
-
}
|
|
75
|
-
interface MaxWithdrawResult {
|
|
76
|
-
maxAmount: number;
|
|
77
|
-
healthFactorAfter: number;
|
|
78
|
-
currentHF: number;
|
|
79
|
-
}
|
|
80
|
-
interface MaxBorrowResult {
|
|
81
|
-
maxAmount: number;
|
|
82
|
-
healthFactorAfter: number;
|
|
83
|
-
currentHF: number;
|
|
84
|
-
}
|
|
85
|
-
interface AssetRates {
|
|
86
|
-
saveApy: number;
|
|
87
|
-
borrowApy: number;
|
|
88
|
-
}
|
|
89
|
-
interface RatesResult {
|
|
90
|
-
[asset: string]: AssetRates;
|
|
91
|
-
}
|
|
92
|
-
interface PositionEntry {
|
|
93
|
-
protocol: string;
|
|
94
|
-
asset: string;
|
|
95
|
-
type: 'save' | 'borrow';
|
|
96
|
-
amount: number;
|
|
97
|
-
amountUsd?: number;
|
|
98
|
-
apy: number;
|
|
99
|
-
}
|
|
100
|
-
interface PositionsResult {
|
|
101
|
-
positions: PositionEntry[];
|
|
102
|
-
}
|
|
103
|
-
interface EarningsResult {
|
|
104
|
-
totalYieldEarned: number;
|
|
105
|
-
currentApy: number;
|
|
106
|
-
dailyEarning: number;
|
|
107
|
-
supplied: number;
|
|
108
|
-
}
|
|
109
|
-
interface FundStatusResult {
|
|
110
|
-
supplied: number;
|
|
111
|
-
apy: number;
|
|
112
|
-
earnedToday: number;
|
|
113
|
-
earnedAllTime: number;
|
|
114
|
-
projectedMonthly: number;
|
|
115
|
-
}
|
|
116
|
-
interface DepositInfo {
|
|
117
|
-
address: string;
|
|
118
|
-
network: string;
|
|
119
|
-
supportedAssets: string[];
|
|
120
|
-
instructions: string;
|
|
121
|
-
}
|
|
122
|
-
interface PaymentRequest {
|
|
123
|
-
address: string;
|
|
124
|
-
network: string;
|
|
125
|
-
amount: number | null;
|
|
126
|
-
currency: string;
|
|
127
|
-
memo: string | null;
|
|
128
|
-
label: string | null;
|
|
129
|
-
/** Unique payment identifier (UUID) for Payment Kit registry */
|
|
130
|
-
nonce: string;
|
|
131
|
-
/** Payment Kit URI (sui:pay?...) for QR codes and wallet deep links */
|
|
132
|
-
qrUri: string;
|
|
133
|
-
/** Human-readable summary */
|
|
134
|
-
displayText: string;
|
|
135
|
-
}
|
|
136
|
-
interface TransactionRecord {
|
|
137
|
-
digest: string;
|
|
138
|
-
/** Coarse bucket — `'send' | 'lending' | 'swap' | 'transaction'`. STABLE. */
|
|
139
|
-
action: string;
|
|
140
|
-
/**
|
|
141
|
-
* Finer-grained display label derived from the Move-call function
|
|
142
|
-
* name (e.g. `'deposit'`, `'withdraw'`, `'payment_link'`,
|
|
143
|
-
* `'on-chain'`). Optional — frontends should fall back to `action`
|
|
144
|
-
* when missing. Never used by ACI filters.
|
|
145
|
-
*/
|
|
146
|
-
label?: string;
|
|
147
|
-
amount?: number;
|
|
148
|
-
asset?: string;
|
|
149
|
-
recipient?: string;
|
|
150
|
-
/**
|
|
151
|
-
* Direction of the user's principal (non-gas) balance movement on
|
|
152
|
-
* this tx — `'out'` if they spent, `'in'` if they received.
|
|
153
|
-
* Computed from on-chain balance changes (NOT from `label`), so the
|
|
154
|
-
* card can render the correct sign even for opaque actions like
|
|
155
|
-
* `swap`/`router`. Undefined when no user balance change is
|
|
156
|
-
* detectable (e.g. pure read-only or admin txs).
|
|
157
|
-
*/
|
|
158
|
-
direction?: 'in' | 'out';
|
|
159
|
-
timestamp: number;
|
|
160
|
-
gasCost?: number;
|
|
161
|
-
}
|
|
162
|
-
interface PendingReward {
|
|
163
|
-
protocol: string;
|
|
164
|
-
asset: string;
|
|
165
|
-
coinType: string;
|
|
166
|
-
symbol: string;
|
|
167
|
-
amount: number;
|
|
168
|
-
estimatedValueUsd: number;
|
|
169
|
-
}
|
|
170
|
-
interface ClaimRewardsResult {
|
|
171
|
-
success: boolean;
|
|
172
|
-
tx: string;
|
|
173
|
-
rewards: PendingReward[];
|
|
174
|
-
totalValueUsd: number;
|
|
175
|
-
gasCost: number;
|
|
176
|
-
}
|
|
177
|
-
interface CompoundRewardsResult {
|
|
178
|
-
success: boolean;
|
|
179
|
-
claimTx: string;
|
|
180
|
-
swapTxs: string[];
|
|
181
|
-
depositTx: string;
|
|
182
|
-
rewards: PendingReward[];
|
|
183
|
-
totalCompoundedUsdc: number;
|
|
184
|
-
totalGasCost: number;
|
|
185
|
-
}
|
|
186
|
-
interface StakeVSuiResult {
|
|
187
|
-
success: boolean;
|
|
188
|
-
tx: string;
|
|
189
|
-
amountSui: number;
|
|
190
|
-
vSuiReceived: number;
|
|
191
|
-
apy: number;
|
|
192
|
-
gasCost: number;
|
|
193
|
-
}
|
|
194
|
-
interface UnstakeVSuiResult {
|
|
195
|
-
success: boolean;
|
|
196
|
-
tx: string;
|
|
197
|
-
vSuiAmount: number;
|
|
198
|
-
suiReceived: number;
|
|
199
|
-
gasCost: number;
|
|
200
|
-
}
|
|
201
|
-
interface SwapResult {
|
|
202
|
-
success: boolean;
|
|
203
|
-
tx: string;
|
|
204
|
-
fromToken: string;
|
|
205
|
-
toToken: string;
|
|
206
|
-
fromAmount: number;
|
|
207
|
-
toAmount: number;
|
|
208
|
-
priceImpact: number;
|
|
209
|
-
route: string;
|
|
210
|
-
gasCost: number;
|
|
211
|
-
}
|
|
212
|
-
interface SwapQuoteResult {
|
|
213
|
-
fromToken: string;
|
|
214
|
-
toToken: string;
|
|
215
|
-
fromAmount: number;
|
|
216
|
-
toAmount: number;
|
|
217
|
-
priceImpact: number;
|
|
218
|
-
route: string;
|
|
219
|
-
}
|
|
220
|
-
interface PayOptions {
|
|
221
|
-
url: string;
|
|
222
|
-
method?: string;
|
|
223
|
-
body?: string;
|
|
224
|
-
headers?: Record<string, string>;
|
|
225
|
-
maxPrice?: number;
|
|
226
|
-
}
|
|
227
|
-
interface PayResult {
|
|
228
|
-
status: number;
|
|
229
|
-
body: unknown;
|
|
230
|
-
paid: boolean;
|
|
231
|
-
cost?: number;
|
|
232
|
-
receipt?: {
|
|
233
|
-
reference: string;
|
|
234
|
-
timestamp: string;
|
|
235
|
-
};
|
|
236
|
-
}
|
|
237
|
-
type HFAlertLevel = 'none' | 'warn' | 'critical';
|
|
238
|
-
interface FinancialSummary {
|
|
239
|
-
walletAddress: string;
|
|
240
|
-
usdcAvailable: number;
|
|
241
|
-
savingsBalance: number;
|
|
242
|
-
debtBalance: number;
|
|
243
|
-
idleUsdc: number;
|
|
244
|
-
healthFactor: number;
|
|
245
|
-
hfAlertLevel: HFAlertLevel;
|
|
246
|
-
saveApy: number;
|
|
247
|
-
borrowApy: number;
|
|
248
|
-
dailyYield: number;
|
|
249
|
-
gasReserveSui: number;
|
|
250
|
-
gasReserveUsd: number;
|
|
251
|
-
fetchedAt: number;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
export type { AssetRates as A, BalanceResponse as B, ClaimRewardsResult as C, DepositInfo as D, EarningsResult as E, FundStatusResult as F, GasReserve 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, MaxWithdrawResult as b, PayResult as c, PendingReward as d, PositionEntry as e, PositionsResult as f, RepayResult as g, SendResult as h, T2000Options as i, StakeVSuiResult as j, SwapResult as k, SwapQuoteResult as l, PaymentRequest as m, CompoundRewardsResult as n, FinancialSummary as o, HFAlertLevel as p };
|