@t2000/sdk 9.5.0 → 9.6.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.
@@ -22,10 +22,22 @@ interface TransactionSigner {
22
22
  signature: string;
23
23
  bytes?: string;
24
24
  }>;
25
+ /**
26
+ * Signature scheme marker. zkLogin personal-message signatures are ZK
27
+ * constructs that only Sui-aware verifiers can check — external x402
28
+ * sellers (the MPP header dialect verifies the payer's personal signature
29
+ * SELLER-side) reject them AFTER the on-chain payment already settled
30
+ * (live finding, JMPR 2026-07-17: charged, no delivery). `payWithMpp`
31
+ * fails closed on `'zklogin'` + header-only 402 BEFORE any money moves.
32
+ * Optional so external signer impls keep compiling; undefined = keypair
33
+ * semantics.
34
+ */
35
+ readonly kind?: 'keypair' | 'zklogin';
25
36
  }
26
37
 
27
38
  declare class KeypairSigner implements TransactionSigner {
28
39
  private readonly keypair;
40
+ readonly kind: "keypair";
29
41
  constructor(keypair: Ed25519Keypair);
30
42
  getAddress(): string;
31
43
  signTransaction(txBytes: Uint8Array): Promise<{
@@ -57,6 +69,7 @@ declare class ZkLoginSigner implements TransactionSigner {
57
69
  private readonly zkProof;
58
70
  private readonly userAddress;
59
71
  private readonly maxEpoch;
72
+ readonly kind: "zklogin";
60
73
  constructor(ephemeralKeypair: Ed25519Keypair, zkProof: ZkLoginProof, userAddress: string, maxEpoch: number);
61
74
  getAddress(): string;
62
75
  signTransaction(txBytes: Uint8Array): Promise<{
@@ -286,7 +299,7 @@ type SponsoredCoinMergeCache = Map<string, {
286
299
  */
287
300
  declare function selectSuiCoin(tx: Transaction, client: SuiCoreClient, owner: string, amountMist: bigint, sponsoredContext: boolean, mergeCache?: SponsoredCoinMergeCache): Promise<SelectAndSplitResult>;
288
301
 
289
- type T2000ErrorCode = 'INSUFFICIENT_BALANCE' | 'ADDRESS_BALANCE_UNSPONSORABLE' | 'INSUFFICIENT_GAS' | 'INVALID_ADDRESS' | 'INVALID_AMOUNT' | 'WALLET_NOT_FOUND' | 'WALLET_LOCKED' | 'WALLET_EXISTS' | 'WALLET_CORRUPT' | 'INVALID_KEY' | 'SIMULATION_FAILED' | 'TRANSACTION_FAILED' | 'ASSET_NOT_SUPPORTED' | 'INVALID_ASSET' | 'PROTOCOL_UNAVAILABLE' | 'RPC_ERROR' | 'RPC_UNREACHABLE' | 'PRICE_EXCEEDS_LIMIT' | 'UNSUPPORTED_NETWORK' | 'PAYMENT_EXPIRED' | 'DUPLICATE_PAYMENT' | 'FACILITATOR_REJECTION' | 'CONTACT_NOT_FOUND' | 'INVALID_CONTACT_NAME' | 'SUINS_NOT_REGISTERED' | 'FACILITATOR_TIMEOUT' | 'SAFEGUARD_BLOCKED' | 'SWAP_NO_ROUTE' | 'SWAP_FAILED' | 'CHAIN_MODE_INVALID' | 'INFERENCE_FAILED' | 'UNKNOWN';
302
+ type T2000ErrorCode = 'INSUFFICIENT_BALANCE' | 'ADDRESS_BALANCE_UNSPONSORABLE' | 'INSUFFICIENT_GAS' | 'INVALID_ADDRESS' | 'INVALID_AMOUNT' | 'WALLET_NOT_FOUND' | 'WALLET_LOCKED' | 'WALLET_EXISTS' | 'WALLET_CORRUPT' | 'INVALID_KEY' | 'SIMULATION_FAILED' | 'TRANSACTION_FAILED' | 'ASSET_NOT_SUPPORTED' | 'INVALID_ASSET' | 'PROTOCOL_UNAVAILABLE' | 'RPC_ERROR' | 'RPC_UNREACHABLE' | 'PRICE_EXCEEDS_LIMIT' | 'UNSUPPORTED_NETWORK' | 'PAYMENT_EXPIRED' | 'DUPLICATE_PAYMENT' | 'FACILITATOR_REJECTION' | 'CONTACT_NOT_FOUND' | 'INVALID_CONTACT_NAME' | 'SUINS_NOT_REGISTERED' | 'FACILITATOR_TIMEOUT' | 'SAFEGUARD_BLOCKED' | 'SWAP_NO_ROUTE' | 'SWAP_FAILED' | 'DIALECT_UNSUPPORTED' | 'CHAIN_MODE_INVALID' | 'INFERENCE_FAILED' | 'UNKNOWN';
290
303
  interface T2000ErrorData {
291
304
  reason?: string;
292
305
  [key: string]: unknown;
@@ -22,10 +22,22 @@ interface TransactionSigner {
22
22
  signature: string;
23
23
  bytes?: string;
24
24
  }>;
25
+ /**
26
+ * Signature scheme marker. zkLogin personal-message signatures are ZK
27
+ * constructs that only Sui-aware verifiers can check — external x402
28
+ * sellers (the MPP header dialect verifies the payer's personal signature
29
+ * SELLER-side) reject them AFTER the on-chain payment already settled
30
+ * (live finding, JMPR 2026-07-17: charged, no delivery). `payWithMpp`
31
+ * fails closed on `'zklogin'` + header-only 402 BEFORE any money moves.
32
+ * Optional so external signer impls keep compiling; undefined = keypair
33
+ * semantics.
34
+ */
35
+ readonly kind?: 'keypair' | 'zklogin';
25
36
  }
26
37
 
27
38
  declare class KeypairSigner implements TransactionSigner {
28
39
  private readonly keypair;
40
+ readonly kind: "keypair";
29
41
  constructor(keypair: Ed25519Keypair);
30
42
  getAddress(): string;
31
43
  signTransaction(txBytes: Uint8Array): Promise<{
@@ -57,6 +69,7 @@ declare class ZkLoginSigner implements TransactionSigner {
57
69
  private readonly zkProof;
58
70
  private readonly userAddress;
59
71
  private readonly maxEpoch;
72
+ readonly kind: "zklogin";
60
73
  constructor(ephemeralKeypair: Ed25519Keypair, zkProof: ZkLoginProof, userAddress: string, maxEpoch: number);
61
74
  getAddress(): string;
62
75
  signTransaction(txBytes: Uint8Array): Promise<{
@@ -286,7 +299,7 @@ type SponsoredCoinMergeCache = Map<string, {
286
299
  */
287
300
  declare function selectSuiCoin(tx: Transaction, client: SuiCoreClient, owner: string, amountMist: bigint, sponsoredContext: boolean, mergeCache?: SponsoredCoinMergeCache): Promise<SelectAndSplitResult>;
288
301
 
289
- type T2000ErrorCode = 'INSUFFICIENT_BALANCE' | 'ADDRESS_BALANCE_UNSPONSORABLE' | 'INSUFFICIENT_GAS' | 'INVALID_ADDRESS' | 'INVALID_AMOUNT' | 'WALLET_NOT_FOUND' | 'WALLET_LOCKED' | 'WALLET_EXISTS' | 'WALLET_CORRUPT' | 'INVALID_KEY' | 'SIMULATION_FAILED' | 'TRANSACTION_FAILED' | 'ASSET_NOT_SUPPORTED' | 'INVALID_ASSET' | 'PROTOCOL_UNAVAILABLE' | 'RPC_ERROR' | 'RPC_UNREACHABLE' | 'PRICE_EXCEEDS_LIMIT' | 'UNSUPPORTED_NETWORK' | 'PAYMENT_EXPIRED' | 'DUPLICATE_PAYMENT' | 'FACILITATOR_REJECTION' | 'CONTACT_NOT_FOUND' | 'INVALID_CONTACT_NAME' | 'SUINS_NOT_REGISTERED' | 'FACILITATOR_TIMEOUT' | 'SAFEGUARD_BLOCKED' | 'SWAP_NO_ROUTE' | 'SWAP_FAILED' | 'CHAIN_MODE_INVALID' | 'INFERENCE_FAILED' | 'UNKNOWN';
302
+ type T2000ErrorCode = 'INSUFFICIENT_BALANCE' | 'ADDRESS_BALANCE_UNSPONSORABLE' | 'INSUFFICIENT_GAS' | 'INVALID_ADDRESS' | 'INVALID_AMOUNT' | 'WALLET_NOT_FOUND' | 'WALLET_LOCKED' | 'WALLET_EXISTS' | 'WALLET_CORRUPT' | 'INVALID_KEY' | 'SIMULATION_FAILED' | 'TRANSACTION_FAILED' | 'ASSET_NOT_SUPPORTED' | 'INVALID_ASSET' | 'PROTOCOL_UNAVAILABLE' | 'RPC_ERROR' | 'RPC_UNREACHABLE' | 'PRICE_EXCEEDS_LIMIT' | 'UNSUPPORTED_NETWORK' | 'PAYMENT_EXPIRED' | 'DUPLICATE_PAYMENT' | 'FACILITATOR_REJECTION' | 'CONTACT_NOT_FOUND' | 'INVALID_CONTACT_NAME' | 'SUINS_NOT_REGISTERED' | 'FACILITATOR_TIMEOUT' | 'SAFEGUARD_BLOCKED' | 'SWAP_NO_ROUTE' | 'SWAP_FAILED' | 'DIALECT_UNSUPPORTED' | 'CHAIN_MODE_INVALID' | 'INFERENCE_FAILED' | 'UNKNOWN';
290
303
  interface T2000ErrorData {
291
304
  reason?: string;
292
305
  [key: string]: unknown;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t2000/sdk",
3
- "version": "9.5.0",
3
+ "version": "9.6.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",