@t2000/sdk 0.46.1 → 0.46.2
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 +1 -1
- package/dist/adapters/index.d.ts +1 -1
- package/dist/browser.cjs +121 -2
- 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 +118 -3
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +76 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +71 -26
- package/dist/index.js.map +1 -1
- package/dist/{token-registry-C1UN5EFV.d.ts → token-registry-B4FfUwvm.d.ts} +118 -7
- package/dist/{token-registry-mycv_b90.d.cts → token-registry-_ehntRHs.d.cts} +118 -7
- package/dist/{types-DfwfwsAN.d.cts → types-DIgyNKqV.d.cts} +9 -0
- package/dist/{types-DfwfwsAN.d.ts → types-DIgyNKqV.d.ts} +9 -0
- 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, T as TransactionRecord } from './types-DIgyNKqV.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Abstract signing interface that decouples the SDK from any specific
|
|
@@ -256,6 +256,10 @@ declare function truncateAddress(address: string): string;
|
|
|
256
256
|
* 'transaction'`. Used by the ACI `action` filter on the
|
|
257
257
|
* `transaction_history` tool. STABLE: downstream queries depend on
|
|
258
258
|
* exactly these values.
|
|
259
|
+
*
|
|
260
|
+
* Order matters: more specific buckets first. Lending patterns precede
|
|
261
|
+
* swap patterns so a NAVI `::swap` helper (if one ever existed) would
|
|
262
|
+
* still bucket as lending.
|
|
259
263
|
*/
|
|
260
264
|
declare const KNOWN_TARGETS: readonly [RegExp, string][];
|
|
261
265
|
/**
|
|
@@ -278,14 +282,31 @@ interface ClassifyBalanceChange {
|
|
|
278
282
|
}
|
|
279
283
|
declare function classifyAction(targets: string[], commandTypes: string[]): string;
|
|
280
284
|
/**
|
|
281
|
-
*
|
|
285
|
+
* Last-resort fallback when neither `LABEL_PATTERNS` nor the action
|
|
286
|
+
* bucket produces something useful.
|
|
287
|
+
*
|
|
288
|
+
* Returns the first MoveCall's *module* name (e.g. "navi", "spam") so
|
|
289
|
+
* the card shows something better than the literal word "transaction".
|
|
290
|
+
* When no MoveCall exists, returns 'on-chain'.
|
|
282
291
|
*
|
|
283
|
-
*
|
|
284
|
-
*
|
|
285
|
-
* word "transaction". When no MoveCall exists, returns 'on-chain'
|
|
286
|
-
* instead — strictly more informative than "transaction".
|
|
292
|
+
* Note: callers should prefer `classifyLabel` which now layers
|
|
293
|
+
* pattern-match → coarse action → module name (see commentary there).
|
|
287
294
|
*/
|
|
288
295
|
declare function fallbackLabel(targets: string[]): string;
|
|
296
|
+
/**
|
|
297
|
+
* Three-tier label resolution for the transaction history card:
|
|
298
|
+
* 1. Specific keyword match in `LABEL_PATTERNS` ("deposit",
|
|
299
|
+
* "payment_link", …).
|
|
300
|
+
* 2. Coarse action bucket from `classifyAction` ("swap", "send",
|
|
301
|
+
* "lending") — prevents leaking opaque internal module names like
|
|
302
|
+
* "router" (Cetus aggregator) or "cross_swap" (third-party DEX
|
|
303
|
+
* aggregators) for txs that we already classified as a swap.
|
|
304
|
+
* 3. Module name from the first MoveCall (`fallbackLabel`) — only
|
|
305
|
+
* used when the action bucket itself is the generic "transaction".
|
|
306
|
+
*
|
|
307
|
+
* Pre-v0.46.2 we skipped tier 2, so swaps showed labels like "router",
|
|
308
|
+
* "cross_swap", "scallop_router", etc. instead of the clean "swap".
|
|
309
|
+
*/
|
|
289
310
|
declare function classifyLabel(targets: string[], commandTypes: string[]): string;
|
|
290
311
|
/**
|
|
291
312
|
* Balance-direction tiebreaker for ambiguous lending calls.
|
|
@@ -310,6 +331,96 @@ interface ClassifyResult {
|
|
|
310
331
|
label: string;
|
|
311
332
|
}
|
|
312
333
|
declare function classifyTransaction(moveCallTargets: string[], commandTypes: string[], balanceChanges: ClassifyBalanceChange[], address: string): ClassifyResult;
|
|
334
|
+
/**
|
|
335
|
+
* Direction of the user's net non-gas movement for this transaction.
|
|
336
|
+
*
|
|
337
|
+
* - `'out'` — the user spent the asset (sends, deposits, repays,
|
|
338
|
+
* swap-in, payment-link payouts).
|
|
339
|
+
* - `'in'` — the user received the asset (withdraws, borrows,
|
|
340
|
+
* swap-out, claims, deposits credited from another wallet).
|
|
341
|
+
*
|
|
342
|
+
* Used by the `TransactionHistoryCard` to choose the `+`/`−` sign and
|
|
343
|
+
* color. Direction is computed from the actual on-chain balance change
|
|
344
|
+
* — never from the textual label — so opaque action types (`'router'`,
|
|
345
|
+
* `'cross_swap'`, …) still render the correct sign.
|
|
346
|
+
*/
|
|
347
|
+
type TxDirection = 'in' | 'out';
|
|
348
|
+
interface ExtractedTransfer {
|
|
349
|
+
amount?: number;
|
|
350
|
+
asset?: string;
|
|
351
|
+
recipient?: string;
|
|
352
|
+
direction?: TxDirection;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Extracts the principal amount/asset/direction for a transaction
|
|
356
|
+
* from its `balanceChanges`.
|
|
357
|
+
*
|
|
358
|
+
* Algorithm:
|
|
359
|
+
* 1. Restrict to the user's *own* balance changes.
|
|
360
|
+
* 2. Prefer non-SUI changes (gas-only SUI deltas are noise).
|
|
361
|
+
* 3. Pick the change with the largest absolute value — the "principal".
|
|
362
|
+
* 4. If no non-SUI change exists, fall back to the largest SUI change
|
|
363
|
+
* so pure-SUI transfers (stake/unstake/native send) still render.
|
|
364
|
+
* 5. Direction follows the sign of the principal.
|
|
365
|
+
* 6. Recipient is set only on outflows, by finding a matching inflow
|
|
366
|
+
* on a *non-user* address with the same coinType.
|
|
367
|
+
*
|
|
368
|
+
* Pre-v0.46.2 this function only inspected outflows, so withdraws,
|
|
369
|
+
* borrows, claims, swap-receives and payment-link receives all
|
|
370
|
+
* rendered with no amount on the rich card (and with a wrong sign,
|
|
371
|
+
* because the card guessed direction from the label string).
|
|
372
|
+
*/
|
|
373
|
+
declare function extractTransferDetails(changes: ClassifyBalanceChange[] | undefined, sender: string): ExtractedTransfer;
|
|
374
|
+
|
|
375
|
+
declare function queryHistory(client: SuiJsonRpcClient, address: string, limit?: number): Promise<TransactionRecord[]>;
|
|
376
|
+
declare function queryTransaction(client: SuiJsonRpcClient, digest: string, senderAddress: string): Promise<TransactionRecord | null>;
|
|
377
|
+
/**
|
|
378
|
+
* Shape of a transaction block as returned by `suix_queryTransactionBlocks`
|
|
379
|
+
* with `showEffects | showInput | showBalanceChanges` enabled. Exported so
|
|
380
|
+
* downstream consumers (audric dashboard `/api/history`, `/api/activity`,
|
|
381
|
+
* etc.) can type their RPC calls without redeclaring the structure.
|
|
382
|
+
*/
|
|
383
|
+
interface SuiRpcTxBlock {
|
|
384
|
+
digest: string;
|
|
385
|
+
timestampMs?: string;
|
|
386
|
+
transaction?: unknown;
|
|
387
|
+
effects?: {
|
|
388
|
+
gasUsed?: {
|
|
389
|
+
computationCost: string;
|
|
390
|
+
storageCost: string;
|
|
391
|
+
storageRebate: string;
|
|
392
|
+
};
|
|
393
|
+
};
|
|
394
|
+
balanceChanges?: ClassifyBalanceChange[];
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Convert a single Sui RPC transaction block to a {@link TransactionRecord}
|
|
398
|
+
* using the canonical (shared) classifier and balance-change extractor.
|
|
399
|
+
*
|
|
400
|
+
* This is the single source of truth for transaction parsing across the
|
|
401
|
+
* agent-tool path AND the dashboard-API path. Use it instead of writing
|
|
402
|
+
* a bespoke parser per surface.
|
|
403
|
+
*
|
|
404
|
+
* @param tx Raw RPC tx block (must include `effects`, `input`, `balanceChanges`).
|
|
405
|
+
* @param address Wallet address whose perspective we're parsing from.
|
|
406
|
+
*/
|
|
407
|
+
declare function parseSuiRpcTx(tx: SuiRpcTxBlock, address: string): TransactionRecord;
|
|
408
|
+
/**
|
|
409
|
+
* Extract the sender (signer) address from a raw RPC tx block.
|
|
410
|
+
* Returns `null` if the block shape is unexpected.
|
|
411
|
+
*/
|
|
412
|
+
declare function extractTxSender(txBlock: unknown): string | null;
|
|
413
|
+
/**
|
|
414
|
+
* Extract MoveCall targets (`<pkg>::<module>::<function>`) and the
|
|
415
|
+
* sequence of programmable-transaction command types (e.g. `MoveCall`,
|
|
416
|
+
* `TransferObjects`) from a raw RPC tx block. Tolerates both the
|
|
417
|
+
* legacy `inner.transactions` field and the newer `inner.commands`
|
|
418
|
+
* field.
|
|
419
|
+
*/
|
|
420
|
+
declare function extractTxCommands(txBlock: unknown): {
|
|
421
|
+
moveCallTargets: string[];
|
|
422
|
+
commandTypes: string[];
|
|
423
|
+
};
|
|
313
424
|
|
|
314
425
|
declare function mistToSui(mist: bigint): number;
|
|
315
426
|
declare function suiToMist(sui: number): bigint;
|
|
@@ -439,4 +550,4 @@ declare const IKA_TYPE: string;
|
|
|
439
550
|
declare const LOFI_TYPE: string;
|
|
440
551
|
declare const MANIFEST_TYPE: string;
|
|
441
552
|
|
|
442
|
-
export {
|
|
553
|
+
export { WBTC_TYPE 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, type T2000ErrorData as H, IKA_TYPE as I, TOKEN_MAP as J, KNOWN_TARGETS as K, LABEL_PATTERNS as L, MANIFEST_TYPE as M, NAVX_TYPE as N, OUTBOUND_OPS as O, type ProtocolFeeInfo as P, type TransactionSigner as Q, type TxDirection as R, STABLE_ASSETS as S, T2000Error as T, type TxMetadata as U, USDC_DECIMALS as V, USDC_TYPE as W, USDE_TYPE as X, USDSUI_TYPE as Y, USDT_TYPE as Z, WAL_TYPE as _, type AutoTopUpResult as a, type ZkLoginProof as a0, ZkLoginSigner as a1, addCollectFeeToTx as a2, calculateFee as a3, classifyAction as a4, classifyLabel as a5, classifyTransaction as a6, executeAutoTopUp as a7, executeWithGas as a8, extractTransferDetails as a9, usdcToRaw as aA, validateAddress as aB, SafeguardEnforcer as aC, BORROW_FEE_BPS as aD, CETUS_USDC_SUI_POOL as aE, OPERATION_ASSETS as aF, type Operation as aG, SAVE_FEE_BPS as aH, assertAllowedAsset as aI, isAllowedAsset as aJ, queryHistory as aK, queryTransaction as aL, simulateTransaction as aM, throwIfSimulationFailed as aN, extractTxCommands as aa, extractTxSender as ab, fallbackLabel as ac, formatAssetAmount as ad, formatSui as ae, formatUsd as af, getDecimals as ag, getDecimalsForCoinType as ah, getGasStatus as ai, getTier as aj, isSupported as ak, isTier1 as al, isTier2 as am, mapMoveAbortCode as an, mapWalletError as ao, mistToSui as ap, parseSuiRpcTx as aq, rawToStable as ar, rawToUsdc as as, refineLendingLabel as at, resolveSymbol as au, resolveTokenType as av, shouldAutoTopUp as aw, stableToRaw as ax, suiToMist as ay, truncateAddress as az, COIN_REGISTRY as b, type ClassifyBalanceChange as c, type ClassifyResult as d, type CoinMeta as e, DEFAULT_SAFEGUARD_CONFIG as f, type ExtractedTransfer as g, type GasExecutionResult as h, type GasRequestType as i, type GasSponsorResponse as j, type GasStatusResponse as k, KeypairSigner as l, LOFI_TYPE as m, MIST_PER_SUI as n, SUI_DECIMALS as o, SUI_TYPE as p, SUPPORTED_ASSETS as q, type SafeguardConfig as r, SafeguardError as s, type SafeguardErrorDetails as t, type SafeguardRule as u, type SimulationResult as v, type StableAsset as w, type SuiRpcTxBlock as x, type SupportedAsset as y, type T2000ErrorCode 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, T as TransactionRecord } from './types-DIgyNKqV.cjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Abstract signing interface that decouples the SDK from any specific
|
|
@@ -256,6 +256,10 @@ declare function truncateAddress(address: string): string;
|
|
|
256
256
|
* 'transaction'`. Used by the ACI `action` filter on the
|
|
257
257
|
* `transaction_history` tool. STABLE: downstream queries depend on
|
|
258
258
|
* exactly these values.
|
|
259
|
+
*
|
|
260
|
+
* Order matters: more specific buckets first. Lending patterns precede
|
|
261
|
+
* swap patterns so a NAVI `::swap` helper (if one ever existed) would
|
|
262
|
+
* still bucket as lending.
|
|
259
263
|
*/
|
|
260
264
|
declare const KNOWN_TARGETS: readonly [RegExp, string][];
|
|
261
265
|
/**
|
|
@@ -278,14 +282,31 @@ interface ClassifyBalanceChange {
|
|
|
278
282
|
}
|
|
279
283
|
declare function classifyAction(targets: string[], commandTypes: string[]): string;
|
|
280
284
|
/**
|
|
281
|
-
*
|
|
285
|
+
* Last-resort fallback when neither `LABEL_PATTERNS` nor the action
|
|
286
|
+
* bucket produces something useful.
|
|
287
|
+
*
|
|
288
|
+
* Returns the first MoveCall's *module* name (e.g. "navi", "spam") so
|
|
289
|
+
* the card shows something better than the literal word "transaction".
|
|
290
|
+
* When no MoveCall exists, returns 'on-chain'.
|
|
282
291
|
*
|
|
283
|
-
*
|
|
284
|
-
*
|
|
285
|
-
* word "transaction". When no MoveCall exists, returns 'on-chain'
|
|
286
|
-
* instead — strictly more informative than "transaction".
|
|
292
|
+
* Note: callers should prefer `classifyLabel` which now layers
|
|
293
|
+
* pattern-match → coarse action → module name (see commentary there).
|
|
287
294
|
*/
|
|
288
295
|
declare function fallbackLabel(targets: string[]): string;
|
|
296
|
+
/**
|
|
297
|
+
* Three-tier label resolution for the transaction history card:
|
|
298
|
+
* 1. Specific keyword match in `LABEL_PATTERNS` ("deposit",
|
|
299
|
+
* "payment_link", …).
|
|
300
|
+
* 2. Coarse action bucket from `classifyAction` ("swap", "send",
|
|
301
|
+
* "lending") — prevents leaking opaque internal module names like
|
|
302
|
+
* "router" (Cetus aggregator) or "cross_swap" (third-party DEX
|
|
303
|
+
* aggregators) for txs that we already classified as a swap.
|
|
304
|
+
* 3. Module name from the first MoveCall (`fallbackLabel`) — only
|
|
305
|
+
* used when the action bucket itself is the generic "transaction".
|
|
306
|
+
*
|
|
307
|
+
* Pre-v0.46.2 we skipped tier 2, so swaps showed labels like "router",
|
|
308
|
+
* "cross_swap", "scallop_router", etc. instead of the clean "swap".
|
|
309
|
+
*/
|
|
289
310
|
declare function classifyLabel(targets: string[], commandTypes: string[]): string;
|
|
290
311
|
/**
|
|
291
312
|
* Balance-direction tiebreaker for ambiguous lending calls.
|
|
@@ -310,6 +331,96 @@ interface ClassifyResult {
|
|
|
310
331
|
label: string;
|
|
311
332
|
}
|
|
312
333
|
declare function classifyTransaction(moveCallTargets: string[], commandTypes: string[], balanceChanges: ClassifyBalanceChange[], address: string): ClassifyResult;
|
|
334
|
+
/**
|
|
335
|
+
* Direction of the user's net non-gas movement for this transaction.
|
|
336
|
+
*
|
|
337
|
+
* - `'out'` — the user spent the asset (sends, deposits, repays,
|
|
338
|
+
* swap-in, payment-link payouts).
|
|
339
|
+
* - `'in'` — the user received the asset (withdraws, borrows,
|
|
340
|
+
* swap-out, claims, deposits credited from another wallet).
|
|
341
|
+
*
|
|
342
|
+
* Used by the `TransactionHistoryCard` to choose the `+`/`−` sign and
|
|
343
|
+
* color. Direction is computed from the actual on-chain balance change
|
|
344
|
+
* — never from the textual label — so opaque action types (`'router'`,
|
|
345
|
+
* `'cross_swap'`, …) still render the correct sign.
|
|
346
|
+
*/
|
|
347
|
+
type TxDirection = 'in' | 'out';
|
|
348
|
+
interface ExtractedTransfer {
|
|
349
|
+
amount?: number;
|
|
350
|
+
asset?: string;
|
|
351
|
+
recipient?: string;
|
|
352
|
+
direction?: TxDirection;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Extracts the principal amount/asset/direction for a transaction
|
|
356
|
+
* from its `balanceChanges`.
|
|
357
|
+
*
|
|
358
|
+
* Algorithm:
|
|
359
|
+
* 1. Restrict to the user's *own* balance changes.
|
|
360
|
+
* 2. Prefer non-SUI changes (gas-only SUI deltas are noise).
|
|
361
|
+
* 3. Pick the change with the largest absolute value — the "principal".
|
|
362
|
+
* 4. If no non-SUI change exists, fall back to the largest SUI change
|
|
363
|
+
* so pure-SUI transfers (stake/unstake/native send) still render.
|
|
364
|
+
* 5. Direction follows the sign of the principal.
|
|
365
|
+
* 6. Recipient is set only on outflows, by finding a matching inflow
|
|
366
|
+
* on a *non-user* address with the same coinType.
|
|
367
|
+
*
|
|
368
|
+
* Pre-v0.46.2 this function only inspected outflows, so withdraws,
|
|
369
|
+
* borrows, claims, swap-receives and payment-link receives all
|
|
370
|
+
* rendered with no amount on the rich card (and with a wrong sign,
|
|
371
|
+
* because the card guessed direction from the label string).
|
|
372
|
+
*/
|
|
373
|
+
declare function extractTransferDetails(changes: ClassifyBalanceChange[] | undefined, sender: string): ExtractedTransfer;
|
|
374
|
+
|
|
375
|
+
declare function queryHistory(client: SuiJsonRpcClient, address: string, limit?: number): Promise<TransactionRecord[]>;
|
|
376
|
+
declare function queryTransaction(client: SuiJsonRpcClient, digest: string, senderAddress: string): Promise<TransactionRecord | null>;
|
|
377
|
+
/**
|
|
378
|
+
* Shape of a transaction block as returned by `suix_queryTransactionBlocks`
|
|
379
|
+
* with `showEffects | showInput | showBalanceChanges` enabled. Exported so
|
|
380
|
+
* downstream consumers (audric dashboard `/api/history`, `/api/activity`,
|
|
381
|
+
* etc.) can type their RPC calls without redeclaring the structure.
|
|
382
|
+
*/
|
|
383
|
+
interface SuiRpcTxBlock {
|
|
384
|
+
digest: string;
|
|
385
|
+
timestampMs?: string;
|
|
386
|
+
transaction?: unknown;
|
|
387
|
+
effects?: {
|
|
388
|
+
gasUsed?: {
|
|
389
|
+
computationCost: string;
|
|
390
|
+
storageCost: string;
|
|
391
|
+
storageRebate: string;
|
|
392
|
+
};
|
|
393
|
+
};
|
|
394
|
+
balanceChanges?: ClassifyBalanceChange[];
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Convert a single Sui RPC transaction block to a {@link TransactionRecord}
|
|
398
|
+
* using the canonical (shared) classifier and balance-change extractor.
|
|
399
|
+
*
|
|
400
|
+
* This is the single source of truth for transaction parsing across the
|
|
401
|
+
* agent-tool path AND the dashboard-API path. Use it instead of writing
|
|
402
|
+
* a bespoke parser per surface.
|
|
403
|
+
*
|
|
404
|
+
* @param tx Raw RPC tx block (must include `effects`, `input`, `balanceChanges`).
|
|
405
|
+
* @param address Wallet address whose perspective we're parsing from.
|
|
406
|
+
*/
|
|
407
|
+
declare function parseSuiRpcTx(tx: SuiRpcTxBlock, address: string): TransactionRecord;
|
|
408
|
+
/**
|
|
409
|
+
* Extract the sender (signer) address from a raw RPC tx block.
|
|
410
|
+
* Returns `null` if the block shape is unexpected.
|
|
411
|
+
*/
|
|
412
|
+
declare function extractTxSender(txBlock: unknown): string | null;
|
|
413
|
+
/**
|
|
414
|
+
* Extract MoveCall targets (`<pkg>::<module>::<function>`) and the
|
|
415
|
+
* sequence of programmable-transaction command types (e.g. `MoveCall`,
|
|
416
|
+
* `TransferObjects`) from a raw RPC tx block. Tolerates both the
|
|
417
|
+
* legacy `inner.transactions` field and the newer `inner.commands`
|
|
418
|
+
* field.
|
|
419
|
+
*/
|
|
420
|
+
declare function extractTxCommands(txBlock: unknown): {
|
|
421
|
+
moveCallTargets: string[];
|
|
422
|
+
commandTypes: string[];
|
|
423
|
+
};
|
|
313
424
|
|
|
314
425
|
declare function mistToSui(mist: bigint): number;
|
|
315
426
|
declare function suiToMist(sui: number): bigint;
|
|
@@ -439,4 +550,4 @@ declare const IKA_TYPE: string;
|
|
|
439
550
|
declare const LOFI_TYPE: string;
|
|
440
551
|
declare const MANIFEST_TYPE: string;
|
|
441
552
|
|
|
442
|
-
export {
|
|
553
|
+
export { WBTC_TYPE 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, type T2000ErrorData as H, IKA_TYPE as I, TOKEN_MAP as J, KNOWN_TARGETS as K, LABEL_PATTERNS as L, MANIFEST_TYPE as M, NAVX_TYPE as N, OUTBOUND_OPS as O, type ProtocolFeeInfo as P, type TransactionSigner as Q, type TxDirection as R, STABLE_ASSETS as S, T2000Error as T, type TxMetadata as U, USDC_DECIMALS as V, USDC_TYPE as W, USDE_TYPE as X, USDSUI_TYPE as Y, USDT_TYPE as Z, WAL_TYPE as _, type AutoTopUpResult as a, type ZkLoginProof as a0, ZkLoginSigner as a1, addCollectFeeToTx as a2, calculateFee as a3, classifyAction as a4, classifyLabel as a5, classifyTransaction as a6, executeAutoTopUp as a7, executeWithGas as a8, extractTransferDetails as a9, usdcToRaw as aA, validateAddress as aB, SafeguardEnforcer as aC, BORROW_FEE_BPS as aD, CETUS_USDC_SUI_POOL as aE, OPERATION_ASSETS as aF, type Operation as aG, SAVE_FEE_BPS as aH, assertAllowedAsset as aI, isAllowedAsset as aJ, queryHistory as aK, queryTransaction as aL, simulateTransaction as aM, throwIfSimulationFailed as aN, extractTxCommands as aa, extractTxSender as ab, fallbackLabel as ac, formatAssetAmount as ad, formatSui as ae, formatUsd as af, getDecimals as ag, getDecimalsForCoinType as ah, getGasStatus as ai, getTier as aj, isSupported as ak, isTier1 as al, isTier2 as am, mapMoveAbortCode as an, mapWalletError as ao, mistToSui as ap, parseSuiRpcTx as aq, rawToStable as ar, rawToUsdc as as, refineLendingLabel as at, resolveSymbol as au, resolveTokenType as av, shouldAutoTopUp as aw, stableToRaw as ax, suiToMist as ay, truncateAddress as az, COIN_REGISTRY as b, type ClassifyBalanceChange as c, type ClassifyResult as d, type CoinMeta as e, DEFAULT_SAFEGUARD_CONFIG as f, type ExtractedTransfer as g, type GasExecutionResult as h, type GasRequestType as i, type GasSponsorResponse as j, type GasStatusResponse as k, KeypairSigner as l, LOFI_TYPE as m, MIST_PER_SUI as n, SUI_DECIMALS as o, SUI_TYPE as p, SUPPORTED_ASSETS as q, type SafeguardConfig as r, SafeguardError as s, type SafeguardErrorDetails as t, type SafeguardRule as u, type SimulationResult as v, type StableAsset as w, type SuiRpcTxBlock as x, type SupportedAsset as y, type T2000ErrorCode as z };
|
|
@@ -151,6 +151,15 @@ interface TransactionRecord {
|
|
|
151
151
|
amount?: number;
|
|
152
152
|
asset?: string;
|
|
153
153
|
recipient?: string;
|
|
154
|
+
/**
|
|
155
|
+
* Direction of the user's principal (non-gas) balance movement on
|
|
156
|
+
* this tx — `'out'` if they spent, `'in'` if they received.
|
|
157
|
+
* Computed from on-chain balance changes (NOT from `label`), so the
|
|
158
|
+
* card can render the correct sign even for opaque actions like
|
|
159
|
+
* `swap`/`router`. Undefined when no user balance change is
|
|
160
|
+
* detectable (e.g. pure read-only or admin txs).
|
|
161
|
+
*/
|
|
162
|
+
direction?: 'in' | 'out';
|
|
154
163
|
timestamp: number;
|
|
155
164
|
gasCost?: number;
|
|
156
165
|
gasMethod?: GasMethod;
|
|
@@ -151,6 +151,15 @@ interface TransactionRecord {
|
|
|
151
151
|
amount?: number;
|
|
152
152
|
asset?: string;
|
|
153
153
|
recipient?: string;
|
|
154
|
+
/**
|
|
155
|
+
* Direction of the user's principal (non-gas) balance movement on
|
|
156
|
+
* this tx — `'out'` if they spent, `'in'` if they received.
|
|
157
|
+
* Computed from on-chain balance changes (NOT from `label`), so the
|
|
158
|
+
* card can render the correct sign even for opaque actions like
|
|
159
|
+
* `swap`/`router`. Undefined when no user balance change is
|
|
160
|
+
* detectable (e.g. pure read-only or admin txs).
|
|
161
|
+
*/
|
|
162
|
+
direction?: 'in' | 'out';
|
|
154
163
|
timestamp: number;
|
|
155
164
|
gasCost?: number;
|
|
156
165
|
gasMethod?: GasMethod;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@t2000/sdk",
|
|
3
|
-
"version": "0.46.
|
|
3
|
+
"version": "0.46.2",
|
|
4
4
|
"description": "TypeScript SDK for AI agent bank accounts on Sui — send, save, borrow, swap. NAVI lending + Cetus aggregator routing, sponsored gas, zkLogin compatible.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|