@t2000/sdk 9.1.0 → 9.3.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/browser.cjs +106 -7
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +106 -8
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +108 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +108 -8
- package/dist/index.js.map +1 -1
- package/dist/{send-CUUOLK_H.d.cts → send-DEK6aOGe.d.cts} +14 -1
- package/dist/{send-CUUOLK_H.d.ts → send-DEK6aOGe.d.ts} +14 -1
- package/package.json +3 -2
|
@@ -924,6 +924,19 @@ declare function payWithMpp(args: {
|
|
|
924
924
|
client: SuiGrpcClient;
|
|
925
925
|
options: PayOptions;
|
|
926
926
|
}): Promise<PayResult>;
|
|
927
|
+
/**
|
|
928
|
+
* Parse the MPP header dialect from a 402 response: the
|
|
929
|
+
* `WWW-Authenticate: Payment …` challenge(s), looking for `method="sui"`.
|
|
930
|
+
* Returns the decoded `{ amount, currency, recipient }` request (amount is a
|
|
931
|
+
* decimal string, e.g. "0.02") or `undefined` when the response carries no
|
|
932
|
+
* sui challenge. Exported for the CLI's `t2 pay --estimate`.
|
|
933
|
+
*/
|
|
934
|
+
declare function parseMppSuiChallenge(response: Response): Promise<{
|
|
935
|
+
amount: string;
|
|
936
|
+
currency: string;
|
|
937
|
+
recipient: string;
|
|
938
|
+
description?: string;
|
|
939
|
+
} | undefined>;
|
|
927
940
|
|
|
928
941
|
type SuiTransactionEffects = SuiClientTypes.TransactionEffects;
|
|
929
942
|
type BuildClient = NonNullable<Parameters<Transaction['build']>[0]>['client'];
|
|
@@ -1343,4 +1356,4 @@ declare function buildSendTx({ client, address, to, amount, asset, }: {
|
|
|
1343
1356
|
*/
|
|
1344
1357
|
declare function addSendToTx(tx: Transaction, coin: TransactionObjectArgument, recipient: string): void;
|
|
1345
1358
|
|
|
1346
|
-
export { type ZkLoginProof as $, T2000_OVERLAY_FEE_WALLET as A, type BalanceResponse as B, CLOCK_ID as C, DEFAULT_NETWORK as D, ETH_TYPE as E, TOKEN_MAP as F, GAS_RESERVE_MIN as G, type TransactionLeg as H, IKA_TYPE as I, type TransactionRecord as J, KNOWN_TARGETS as K, LABEL_PATTERNS as L, MANIFEST_TYPE as M, NAVX_TYPE as N, OVERLAY_FEE_RATE as O, PREFLIGHT_MAX_AMOUNT as P, type TransactionSigner as Q, type TxDirection as R, STABLE_ASSETS as S, T2000Error as T, USDC_DECIMALS as U, USDC_TYPE as V, USDE_TYPE as W, USDSUI_TYPE as X, USDT_TYPE as Y, WAL_TYPE as Z, WBTC_TYPE as _, COIN_REGISTRY as a,
|
|
1359
|
+
export { type ZkLoginProof as $, T2000_OVERLAY_FEE_WALLET as A, type BalanceResponse as B, CLOCK_ID as C, DEFAULT_NETWORK as D, ETH_TYPE as E, TOKEN_MAP as F, GAS_RESERVE_MIN as G, type TransactionLeg as H, IKA_TYPE as I, type TransactionRecord as J, KNOWN_TARGETS as K, LABEL_PATTERNS as L, MANIFEST_TYPE as M, NAVX_TYPE as N, OVERLAY_FEE_RATE as O, PREFLIGHT_MAX_AMOUNT as P, type TransactionSigner as Q, type TxDirection as R, STABLE_ASSETS as S, T2000Error as T, USDC_DECIMALS as U, USDC_TYPE as V, USDE_TYPE as W, USDSUI_TYPE as X, USDT_TYPE as Y, WAL_TYPE as Z, WBTC_TYPE as _, COIN_REGISTRY as a, fetchAllCoins as a$, ZkLoginSigner as a0, buildSendTx as a1, buildSwapTx as a2, checkPositiveAmount as a3, checkSuiAddress as a4, classifyAction as a5, classifyLabel as a6, classifyTransaction as a7, executeTx as a8, extractAllUserLegs as a9, suiToMist as aA, truncateAddress as aB, usdcToRaw as aC, validateAddress as aD, type T2000Options as aE, type SwapResult as aF, type SwapQuoteResult as aG, type PaymentRequest as aH, type SuiCoreClient as aI, type SponsoredCoinMergeCache as aJ, type SendableAsset as aK, CETUS_USDC_SUI_POOL as aL, type CoinPage as aM, DEFAULT_GRPC_URL as aN, GASLESS_MIN_STABLE_AMOUNT as aO, GASLESS_STABLE_TYPES as aP, OPERATION_ASSETS as aQ, type Operation as aR, SENDABLE_ASSETS as aS, type SelectAndSplitResult as aT, type SerializedCetusRoute as aU, type SerializedCetusRoutePath as aV, type SerializedRouterDataV3 as aW, addSendToTx as aX, addSwapToTx as aY, assertAllowedAsset as aZ, deserializeCetusRoute as a_, extractTransferDetails as aa, extractTxCommands as ab, extractTxSender as ac, fallbackLabel as ad, findSwapRoute as ae, formatAssetAmount as af, formatSui as ag, formatUsd as ah, getDecimals as ai, getDecimalsForCoinType as aj, mapMoveAbortCode as ak, mapWalletError as al, mistToSui as am, parseMppSuiChallenge as an, parseSuiRpcTx as ao, payWithMpp as ap, preflightFail as aq, preflightPay as ar, preflightSend as as, preflightSwap as at, rawToStable as au, rawToUsdc as av, refineLendingLabel as aw, resolveSymbol as ax, resolveTokenType as ay, stableToRaw as az, type ClassifyBalanceChange as b, getCoinMeta as b0, getSuiClient as b1, getSuiGrpcClient as b2, isAllowedAsset as b3, isCetusRouteFresh as b4, isInRegistry as b5, normalizeAsset as b6, normalizeCoinType as b7, queryHistory as b8, queryTransaction as b9, selectAndSplitCoin as ba, selectSuiCoin as bb, serializeCetusRoute as bc, simulateTransaction as bd, throwIfSimulationFailed as be, verifyCetusRouteCoinMatch as bf, type ClassifyResult as c, type CoinMeta as d, type DepositInfo as e, type ExtractedTransfer as f, KeypairSigner as g, LOFI_TYPE as h, MIST_PER_SUI as i, type OverlayFeeConfig as j, PREFLIGHT_OK as k, type PayOptions as l, type PayResult as m, type PreflightResult as n, SUI_DECIMALS as o, SUI_TYPE as p, SUPPORTED_ASSETS as q, type SendResult as r, type SimulationResult as s, type StableAsset as t, type SuiHolding as u, type SuiRpcTxBlock as v, type SupportedAsset as w, type SwapRouteResult as x, type T2000ErrorCode as y, type T2000ErrorData as z };
|
|
@@ -924,6 +924,19 @@ declare function payWithMpp(args: {
|
|
|
924
924
|
client: SuiGrpcClient;
|
|
925
925
|
options: PayOptions;
|
|
926
926
|
}): Promise<PayResult>;
|
|
927
|
+
/**
|
|
928
|
+
* Parse the MPP header dialect from a 402 response: the
|
|
929
|
+
* `WWW-Authenticate: Payment …` challenge(s), looking for `method="sui"`.
|
|
930
|
+
* Returns the decoded `{ amount, currency, recipient }` request (amount is a
|
|
931
|
+
* decimal string, e.g. "0.02") or `undefined` when the response carries no
|
|
932
|
+
* sui challenge. Exported for the CLI's `t2 pay --estimate`.
|
|
933
|
+
*/
|
|
934
|
+
declare function parseMppSuiChallenge(response: Response): Promise<{
|
|
935
|
+
amount: string;
|
|
936
|
+
currency: string;
|
|
937
|
+
recipient: string;
|
|
938
|
+
description?: string;
|
|
939
|
+
} | undefined>;
|
|
927
940
|
|
|
928
941
|
type SuiTransactionEffects = SuiClientTypes.TransactionEffects;
|
|
929
942
|
type BuildClient = NonNullable<Parameters<Transaction['build']>[0]>['client'];
|
|
@@ -1343,4 +1356,4 @@ declare function buildSendTx({ client, address, to, amount, asset, }: {
|
|
|
1343
1356
|
*/
|
|
1344
1357
|
declare function addSendToTx(tx: Transaction, coin: TransactionObjectArgument, recipient: string): void;
|
|
1345
1358
|
|
|
1346
|
-
export { type ZkLoginProof as $, T2000_OVERLAY_FEE_WALLET as A, type BalanceResponse as B, CLOCK_ID as C, DEFAULT_NETWORK as D, ETH_TYPE as E, TOKEN_MAP as F, GAS_RESERVE_MIN as G, type TransactionLeg as H, IKA_TYPE as I, type TransactionRecord as J, KNOWN_TARGETS as K, LABEL_PATTERNS as L, MANIFEST_TYPE as M, NAVX_TYPE as N, OVERLAY_FEE_RATE as O, PREFLIGHT_MAX_AMOUNT as P, type TransactionSigner as Q, type TxDirection as R, STABLE_ASSETS as S, T2000Error as T, USDC_DECIMALS as U, USDC_TYPE as V, USDE_TYPE as W, USDSUI_TYPE as X, USDT_TYPE as Y, WAL_TYPE as Z, WBTC_TYPE as _, COIN_REGISTRY as a,
|
|
1359
|
+
export { type ZkLoginProof as $, T2000_OVERLAY_FEE_WALLET as A, type BalanceResponse as B, CLOCK_ID as C, DEFAULT_NETWORK as D, ETH_TYPE as E, TOKEN_MAP as F, GAS_RESERVE_MIN as G, type TransactionLeg as H, IKA_TYPE as I, type TransactionRecord as J, KNOWN_TARGETS as K, LABEL_PATTERNS as L, MANIFEST_TYPE as M, NAVX_TYPE as N, OVERLAY_FEE_RATE as O, PREFLIGHT_MAX_AMOUNT as P, type TransactionSigner as Q, type TxDirection as R, STABLE_ASSETS as S, T2000Error as T, USDC_DECIMALS as U, USDC_TYPE as V, USDE_TYPE as W, USDSUI_TYPE as X, USDT_TYPE as Y, WAL_TYPE as Z, WBTC_TYPE as _, COIN_REGISTRY as a, fetchAllCoins as a$, ZkLoginSigner as a0, buildSendTx as a1, buildSwapTx as a2, checkPositiveAmount as a3, checkSuiAddress as a4, classifyAction as a5, classifyLabel as a6, classifyTransaction as a7, executeTx as a8, extractAllUserLegs as a9, suiToMist as aA, truncateAddress as aB, usdcToRaw as aC, validateAddress as aD, type T2000Options as aE, type SwapResult as aF, type SwapQuoteResult as aG, type PaymentRequest as aH, type SuiCoreClient as aI, type SponsoredCoinMergeCache as aJ, type SendableAsset as aK, CETUS_USDC_SUI_POOL as aL, type CoinPage as aM, DEFAULT_GRPC_URL as aN, GASLESS_MIN_STABLE_AMOUNT as aO, GASLESS_STABLE_TYPES as aP, OPERATION_ASSETS as aQ, type Operation as aR, SENDABLE_ASSETS as aS, type SelectAndSplitResult as aT, type SerializedCetusRoute as aU, type SerializedCetusRoutePath as aV, type SerializedRouterDataV3 as aW, addSendToTx as aX, addSwapToTx as aY, assertAllowedAsset as aZ, deserializeCetusRoute as a_, extractTransferDetails as aa, extractTxCommands as ab, extractTxSender as ac, fallbackLabel as ad, findSwapRoute as ae, formatAssetAmount as af, formatSui as ag, formatUsd as ah, getDecimals as ai, getDecimalsForCoinType as aj, mapMoveAbortCode as ak, mapWalletError as al, mistToSui as am, parseMppSuiChallenge as an, parseSuiRpcTx as ao, payWithMpp as ap, preflightFail as aq, preflightPay as ar, preflightSend as as, preflightSwap as at, rawToStable as au, rawToUsdc as av, refineLendingLabel as aw, resolveSymbol as ax, resolveTokenType as ay, stableToRaw as az, type ClassifyBalanceChange as b, getCoinMeta as b0, getSuiClient as b1, getSuiGrpcClient as b2, isAllowedAsset as b3, isCetusRouteFresh as b4, isInRegistry as b5, normalizeAsset as b6, normalizeCoinType as b7, queryHistory as b8, queryTransaction as b9, selectAndSplitCoin as ba, selectSuiCoin as bb, serializeCetusRoute as bc, simulateTransaction as bd, throwIfSimulationFailed as be, verifyCetusRouteCoinMatch as bf, type ClassifyResult as c, type CoinMeta as d, type DepositInfo as e, type ExtractedTransfer as f, KeypairSigner as g, LOFI_TYPE as h, MIST_PER_SUI as i, type OverlayFeeConfig as j, PREFLIGHT_OK as k, type PayOptions as l, type PayResult as m, type PreflightResult as n, SUI_DECIMALS as o, SUI_TYPE as p, SUPPORTED_ASSETS as q, type SendResult as r, type SimulationResult as s, type StableAsset as t, type SuiHolding as u, type SuiRpcTxBlock as v, type SupportedAsset as w, type SwapRouteResult as x, type T2000ErrorCode as y, type T2000ErrorData as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@t2000/sdk",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.3.0",
|
|
4
4
|
"description": "TypeScript SDK for Agent Wallets on Sui — gasless USDC + USDsui transfers, Cetus swap routing, NAVI lending (programmatic), MPP paid API access, zkLogin compatible.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -52,7 +52,8 @@
|
|
|
52
52
|
"@phala/dcap-qvl": "^0.5.2",
|
|
53
53
|
"@suimpp/mpp": "^0.8.1",
|
|
54
54
|
"bn.js": "^5.2.1",
|
|
55
|
-
"eventemitter3": "^5"
|
|
55
|
+
"eventemitter3": "^5",
|
|
56
|
+
"mppx": "^0.4.9"
|
|
56
57
|
},
|
|
57
58
|
"devDependencies": {
|
|
58
59
|
"@types/bn.js": "^5.1.5",
|