@t2000/cli 4.2.1 → 4.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.
@@ -75630,122 +75630,6 @@ var require_lib2 = __commonJS({
75630
75630
  } });
75631
75631
  }
75632
75632
  });
75633
- function computeZkLoginAddressFromSeed(addressSeed, iss, legacyAddress) {
75634
- if (legacyAddress === void 0) throw new Error("legacyAddress parameter must be specified");
75635
- const addressSeedBytesBigEndian = legacyAddress ? toBigEndianBytes(addressSeed, 32) : toPaddedBigEndianBytes(addressSeed, 32);
75636
- const addressParamBytes = new TextEncoder().encode(normalizeZkLoginIssuer(iss));
75637
- const tmp = new Uint8Array(2 + addressSeedBytesBigEndian.length + addressParamBytes.length);
75638
- tmp.set([SIGNATURE_SCHEME_TO_FLAG.ZkLogin]);
75639
- tmp.set([addressParamBytes.length], 1);
75640
- tmp.set(addressParamBytes, 2);
75641
- tmp.set(addressSeedBytesBigEndian, 2 + addressParamBytes.length);
75642
- return normalizeSuiAddress(bytesToHex(blake2b(tmp, { dkLen: 32 })).slice(0, SUI_ADDRESS_LENGTH * 2));
75643
- }
75644
- function lengthChecks(jwt2) {
75645
- const [header, payload] = jwt2.split(".");
75646
- if (header.length > MAX_HEADER_LEN_B64) throw new Error(`Header is too long`);
75647
- const L2 = (header.length + 1 + payload.length) * 8;
75648
- const K2 = (960 - (L2 % 512 + 1)) % 512;
75649
- if ((L2 + 1 + K2 + 64) / 8 > MAX_PADDED_UNSIGNED_JWT_LEN) throw new Error(`JWT is too long`);
75650
- }
75651
- function jwtToAddress(jwt2, userSalt, legacyAddress) {
75652
- if (legacyAddress === void 0) throw new Error("legacyAddress parameter must be specified");
75653
- lengthChecks(jwt2);
75654
- const decodedJWT = decodeJwt(jwt2);
75655
- return computeZkLoginAddress({
75656
- userSalt,
75657
- claimName: "sub",
75658
- claimValue: decodedJWT.sub,
75659
- aud: decodedJWT.aud,
75660
- iss: decodedJWT.iss,
75661
- legacyAddress
75662
- });
75663
- }
75664
- function computeZkLoginAddress({ claimName, claimValue, iss, aud, userSalt, legacyAddress }) {
75665
- if (legacyAddress === void 0) throw new Error("legacyAddress parameter must be specified");
75666
- return computeZkLoginAddressFromSeed(genAddressSeed(userSalt, claimName, claimValue, aud), iss, legacyAddress);
75667
- }
75668
- var MAX_HEADER_LEN_B64;
75669
- var MAX_PADDED_UNSIGNED_JWT_LEN;
75670
- var init_address = __esm({
75671
- "../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/zklogin/address.mjs"() {
75672
- init_sui_types();
75673
- init_signature_scheme2();
75674
- init_utils9();
75675
- init_jwt_utils();
75676
- init_blake2();
75677
- init_utils3();
75678
- MAX_HEADER_LEN_B64 = 248;
75679
- MAX_PADDED_UNSIGNED_JWT_LEN = 1600;
75680
- }
75681
- });
75682
- function toBigIntBE(bytes) {
75683
- const hex3 = toHex(bytes);
75684
- if (hex3.length === 0) return BigInt(0);
75685
- return BigInt(`0x${hex3}`);
75686
- }
75687
- function generateRandomness() {
75688
- return String(toBigIntBE(randomBytes(16)));
75689
- }
75690
- function generateNonce(publicKey, maxEpoch, randomness) {
75691
- const publicKeyBytes = toBigIntBE(publicKey.toSuiBytes());
75692
- const Z2 = toPaddedBigEndianBytes(poseidonHash([
75693
- publicKeyBytes / 2n ** 128n,
75694
- publicKeyBytes % 2n ** 128n,
75695
- maxEpoch,
75696
- BigInt(randomness)
75697
- ]), 20);
75698
- const nonce2 = base64urlnopad.encode(Z2);
75699
- if (nonce2.length !== NONCE_LENGTH) throw new Error(`Length of nonce ${nonce2} (${nonce2.length}) is not equal to ${NONCE_LENGTH}`);
75700
- return nonce2;
75701
- }
75702
- var NONCE_LENGTH;
75703
- var init_nonce = __esm({
75704
- "../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/zklogin/nonce.mjs"() {
75705
- init_poseidon();
75706
- init_utils9();
75707
- init_dist2();
75708
- init_utils3();
75709
- init_base();
75710
- NONCE_LENGTH = 27;
75711
- }
75712
- });
75713
- var init_zklogin = __esm({
75714
- "../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/zklogin/index.mjs"() {
75715
- init_poseidon();
75716
- init_utils9();
75717
- init_signature2();
75718
- init_address();
75719
- init_nonce();
75720
- }
75721
- });
75722
- var esm_exports = {};
75723
- __export(esm_exports, {
75724
- computeZkLoginAddress: () => computeZkLoginAddress2,
75725
- genAddressSeed: () => genAddressSeed,
75726
- generateNonce: () => generateNonce,
75727
- generateRandomness: () => generateRandomness,
75728
- getExtendedEphemeralPublicKey: () => getExtendedEphemeralPublicKey,
75729
- getZkLoginSignature: () => getZkLoginSignature,
75730
- hashASCIIStrToField: () => hashASCIIStrToField,
75731
- jwtToAddress: () => jwtToAddress2,
75732
- poseidonHash: () => poseidonHash
75733
- });
75734
- function computeZkLoginAddress2(options) {
75735
- return computeZkLoginAddress({
75736
- ...options,
75737
- legacyAddress: true
75738
- });
75739
- }
75740
- function jwtToAddress2(jwt2, userSalt, legacyAddress = true) {
75741
- return jwtToAddress(jwt2, userSalt, legacyAddress);
75742
- }
75743
- var init_esm2 = __esm({
75744
- "../../node_modules/.pnpm/@mysten+zklogin@0.8.1_typescript@5.9.3/node_modules/@mysten/zklogin/dist/esm/index.js"() {
75745
- init_zklogin();
75746
- init_zklogin();
75747
- }
75748
- });
75749
75633
  var Expires_exports = {};
75750
75634
  __export(Expires_exports, {
75751
75635
  days: () => days,
@@ -83404,13 +83288,13 @@ var init_Log = __esm({
83404
83288
  "../../node_modules/.pnpm/ox@0.14.10_typescript@5.9.3_zod@4.4.3/node_modules/ox/_esm/core/Log.js"() {
83405
83289
  }
83406
83290
  });
83407
- var init_esm3 = __esm({
83291
+ var init_esm2 = __esm({
83408
83292
  "../../node_modules/.pnpm/@scure+bip39@1.6.0/node_modules/@scure/bip39/esm/index.js"() {
83409
83293
  }
83410
83294
  });
83411
83295
  var init_Mnemonic = __esm({
83412
83296
  "../../node_modules/.pnpm/ox@0.14.10_typescript@5.9.3_zod@4.4.3/node_modules/ox/_esm/core/Mnemonic.js"() {
83413
- init_esm3();
83297
+ init_esm2();
83414
83298
  }
83415
83299
  });
83416
83300
  var Fp256;
@@ -84528,7 +84412,7 @@ var init_X25519 = __esm({
84528
84412
  "../../node_modules/.pnpm/ox@0.14.10_typescript@5.9.3_zod@4.4.3/node_modules/ox/_esm/core/X25519.js"() {
84529
84413
  }
84530
84414
  });
84531
- var init_esm4 = __esm({
84415
+ var init_esm3 = __esm({
84532
84416
  "../../node_modules/.pnpm/ox@0.14.10_typescript@5.9.3_zod@4.4.3/node_modules/ox/_esm/index.js"() {
84533
84417
  init_Abi();
84534
84418
  init_AbiConstructor();
@@ -84614,7 +84498,7 @@ function serialize(request) {
84614
84498
  }
84615
84499
  var init_PaymentRequest = __esm({
84616
84500
  "../../node_modules/.pnpm/mppx@0.4.9_@modelcontextprotocol+sdk@1.28.0_zod@4.4.3__express@5.2.1_hono@4.12.9_openap_a5bd8709643e33148686c341f103678d/node_modules/mppx/dist/PaymentRequest.js"() {
84617
- init_esm4();
84501
+ init_esm3();
84618
84502
  }
84619
84503
  });
84620
84504
  // @__NO_SIDE_EFFECTS__
@@ -99129,7 +99013,7 @@ function computeId(challenge2, options) {
99129
99013
  var Schema;
99130
99014
  var init_Challenge = __esm({
99131
99015
  "../../node_modules/.pnpm/mppx@0.4.9_@modelcontextprotocol+sdk@1.28.0_zod@4.4.3__express@5.2.1_hono@4.12.9_openap_a5bd8709643e33148686c341f103678d/node_modules/mppx/dist/Challenge.js"() {
99132
- init_esm4();
99016
+ init_esm3();
99133
99017
  init_PaymentRequest();
99134
99018
  init_zod2();
99135
99019
  Schema = /* @__PURE__ */ object4({
@@ -99218,7 +99102,7 @@ function extractPaymentScheme(header) {
99218
99102
  }
99219
99103
  var init_Credential = __esm({
99220
99104
  "../../node_modules/.pnpm/mppx@0.4.9_@modelcontextprotocol+sdk@1.28.0_zod@4.4.3__express@5.2.1_hono@4.12.9_openap_a5bd8709643e33148686c341f103678d/node_modules/mppx/dist/Credential.js"() {
99221
- init_esm4();
99105
+ init_esm3();
99222
99106
  init_Challenge();
99223
99107
  init_PaymentRequest();
99224
99108
  }
@@ -100179,7 +100063,7 @@ var init_toEventSelector = __esm({
100179
100063
  }
100180
100064
  });
100181
100065
  var InvalidAddressError2;
100182
- var init_address2 = __esm({
100066
+ var init_address = __esm({
100183
100067
  "../../node_modules/.pnpm/viem@2.47.5_typescript@5.9.3_zod@4.4.3/node_modules/viem/_esm/errors/address.js"() {
100184
100068
  init_base2();
100185
100069
  InvalidAddressError2 = class extends BaseError4 {
@@ -100257,7 +100141,7 @@ function getAddress(address2, chainId2) {
100257
100141
  var checksumAddressCache;
100258
100142
  var init_getAddress = __esm({
100259
100143
  "../../node_modules/.pnpm/viem@2.47.5_typescript@5.9.3_zod@4.4.3/node_modules/viem/_esm/utils/address/getAddress.js"() {
100260
- init_address2();
100144
+ init_address();
100261
100145
  init_toBytes();
100262
100146
  init_keccak256();
100263
100147
  init_lru2();
@@ -100587,7 +100471,7 @@ function getArrayComponents2(type2) {
100587
100471
  var init_encodeAbiParameters = __esm({
100588
100472
  "../../node_modules/.pnpm/viem@2.47.5_typescript@5.9.3_zod@4.4.3/node_modules/viem/_esm/utils/abi/encodeAbiParameters.js"() {
100589
100473
  init_abi();
100590
- init_address2();
100474
+ init_address();
100591
100475
  init_base2();
100592
100476
  init_encoding();
100593
100477
  init_isAddress();
@@ -103232,7 +103116,7 @@ function serializeStateOverride(parameters) {
103232
103116
  }
103233
103117
  var init_stateOverride2 = __esm({
103234
103118
  "../../node_modules/.pnpm/viem@2.47.5_typescript@5.9.3_zod@4.4.3/node_modules/viem/_esm/utils/stateOverride.js"() {
103235
- init_address2();
103119
+ init_address();
103236
103120
  init_data2();
103237
103121
  init_stateOverride();
103238
103122
  init_isAddress();
@@ -103261,7 +103145,7 @@ var init_assertRequest = __esm({
103261
103145
  "../../node_modules/.pnpm/viem@2.47.5_typescript@5.9.3_zod@4.4.3/node_modules/viem/_esm/utils/transaction/assertRequest.js"() {
103262
103146
  init_parseAccount();
103263
103147
  init_number();
103264
- init_address2();
103148
+ init_address();
103265
103149
  init_node2();
103266
103150
  init_isAddress();
103267
103151
  }
@@ -104261,7 +104145,7 @@ function isAddressEqual(a, b2) {
104261
104145
  }
104262
104146
  var init_isAddressEqual = __esm({
104263
104147
  "../../node_modules/.pnpm/viem@2.47.5_typescript@5.9.3_zod@4.4.3/node_modules/viem/_esm/utils/address/isAddressEqual.js"() {
104264
- init_address2();
104148
+ init_address();
104265
104149
  init_isAddress();
104266
104150
  }
104267
104151
  });
@@ -107583,7 +107467,7 @@ var init_assertTransaction = __esm({
107583
107467
  "../../node_modules/.pnpm/viem@2.47.5_typescript@5.9.3_zod@4.4.3/node_modules/viem/_esm/utils/transaction/assertTransaction.js"() {
107584
107468
  init_kzg();
107585
107469
  init_number();
107586
- init_address2();
107470
+ init_address();
107587
107471
  init_base2();
107588
107472
  init_blob2();
107589
107473
  init_chain();
@@ -107614,7 +107498,7 @@ function serializeAccessList(accessList) {
107614
107498
  }
107615
107499
  var init_serializeAccessList = __esm({
107616
107500
  "../../node_modules/.pnpm/viem@2.47.5_typescript@5.9.3_zod@4.4.3/node_modules/viem/_esm/utils/transaction/serializeAccessList.js"() {
107617
- init_address2();
107501
+ init_address();
107618
107502
  init_transaction2();
107619
107503
  init_isAddress();
107620
107504
  }
@@ -108423,7 +108307,7 @@ function validateReference(type2) {
108423
108307
  var init_typedData2 = __esm({
108424
108308
  "../../node_modules/.pnpm/viem@2.47.5_typescript@5.9.3_zod@4.4.3/node_modules/viem/_esm/utils/typedData.js"() {
108425
108309
  init_abi();
108426
- init_address2();
108310
+ init_address();
108427
108311
  init_typedData();
108428
108312
  init_isAddress();
108429
108313
  init_size();
@@ -110519,7 +110403,7 @@ function parseEIP155Signature(transactionArray) {
110519
110403
  }
110520
110404
  var init_parseTransaction = __esm({
110521
110405
  "../../node_modules/.pnpm/viem@2.47.5_typescript@5.9.3_zod@4.4.3/node_modules/viem/_esm/utils/transaction/parseTransaction.js"() {
110522
- init_address2();
110406
+ init_address();
110523
110407
  init_transaction2();
110524
110408
  init_isAddress();
110525
110409
  init_toBlobSidecars();
@@ -110791,7 +110675,7 @@ var init_multicall = __esm({
110791
110675
  }
110792
110676
  });
110793
110677
  var zeroAddress;
110794
- var init_address3 = __esm({
110678
+ var init_address2 = __esm({
110795
110679
  "../../node_modules/.pnpm/viem@2.47.5_typescript@5.9.3_zod@4.4.3/node_modules/viem/_esm/constants/address.js"() {
110796
110680
  zeroAddress = "0x0000000000000000000000000000000000000000";
110797
110681
  }
@@ -111756,7 +111640,7 @@ var init_http3 = __esm({
111756
111640
  init_createTransport();
111757
111641
  }
111758
111642
  });
111759
- var init_esm5 = __esm({
111643
+ var init_esm4 = __esm({
111760
111644
  "../../node_modules/.pnpm/viem@2.47.5_typescript@5.9.3_zod@4.4.3/node_modules/viem/_esm/index.js"() {
111761
111645
  init_createClient();
111762
111646
  init_http3();
@@ -111769,7 +111653,7 @@ var init_esm5 = __esm({
111769
111653
  var charge;
111770
111654
  var init_Methods = __esm({
111771
111655
  "../../node_modules/.pnpm/mppx@0.4.9_@modelcontextprotocol+sdk@1.28.0_zod@4.4.3__express@5.2.1_hono@4.12.9_openap_a5bd8709643e33148686c341f103678d/node_modules/mppx/dist/stripe/Methods.js"() {
111772
- init_esm5();
111656
+ init_esm4();
111773
111657
  init_Method();
111774
111658
  init_zod2();
111775
111659
  charge = from9({
@@ -116944,7 +116828,7 @@ var init_fee2 = __esm({
116944
116828
  init_watchContractEvent();
116945
116829
  init_writeContract();
116946
116830
  init_writeContractSync();
116947
- init_address3();
116831
+ init_address2();
116948
116832
  init_parseEventLogs();
116949
116833
  init_Abis();
116950
116834
  init_Addresses();
@@ -117067,7 +116951,7 @@ function watchNonceIncremented(client, parameters) {
117067
116951
  strict: true
117068
116952
  });
117069
116953
  }
117070
- var init_nonce2 = __esm({
116954
+ var init_nonce = __esm({
117071
116955
  "../../node_modules/.pnpm/viem@2.47.5_typescript@5.9.3_zod@4.4.3/node_modules/viem/_esm/tempo/actions/nonce.js"() {
117072
116956
  init_readContract();
117073
116957
  init_watchContractEvent();
@@ -119192,7 +119076,7 @@ var init_actions2 = __esm({
119192
119076
  init_dex();
119193
119077
  init_faucet();
119194
119078
  init_fee2();
119195
- init_nonce2();
119079
+ init_nonce();
119196
119080
  init_policy();
119197
119081
  init_reward();
119198
119082
  init_token();
@@ -119345,7 +119229,7 @@ function getResolver2(parameters) {
119345
119229
  }
119346
119230
  var init_Client = __esm({
119347
119231
  "../../node_modules/.pnpm/mppx@0.4.9_@modelcontextprotocol+sdk@1.28.0_zod@4.4.3__express@5.2.1_hono@4.12.9_openap_a5bd8709643e33148686c341f103678d/node_modules/mppx/dist/viem/Client.js"() {
119348
- init_esm5();
119232
+ init_esm4();
119349
119233
  init_tempo3();
119350
119234
  }
119351
119235
  });
@@ -119369,7 +119253,7 @@ var tag2;
119369
119253
  var version7;
119370
119254
  var init_Attribution = __esm({
119371
119255
  "../../node_modules/.pnpm/mppx@0.4.9_@modelcontextprotocol+sdk@1.28.0_zod@4.4.3__express@5.2.1_hono@4.12.9_openap_a5bd8709643e33148686c341f103678d/node_modules/mppx/dist/tempo/Attribution.js"() {
119372
- init_esm4();
119256
+ init_esm3();
119373
119257
  tag2 = Hex_exports.slice(Hash_exports.keccak256(Bytes_exports.fromString("mpp"), { as: "Hex" }), 0, 4);
119374
119258
  version7 = 1;
119375
119259
  }
@@ -119377,7 +119261,7 @@ var init_Attribution = __esm({
119377
119261
  function isEqual6(a, b2) {
119378
119262
  return a.toLowerCase() === b2.toLowerCase();
119379
119263
  }
119380
- var init_address4 = __esm({
119264
+ var init_address3 = __esm({
119381
119265
  "../../node_modules/.pnpm/mppx@0.4.9_@modelcontextprotocol+sdk@1.28.0_zod@4.4.3__express@5.2.1_hono@4.12.9_openap_a5bd8709643e33148686c341f103678d/node_modules/mppx/dist/tempo/internal/address.js"() {
119382
119266
  }
119383
119267
  });
@@ -119479,7 +119363,7 @@ var init_auto_swap = __esm({
119479
119363
  "../../node_modules/.pnpm/mppx@0.4.9_@modelcontextprotocol+sdk@1.28.0_zod@4.4.3__express@5.2.1_hono@4.12.9_openap_a5bd8709643e33148686c341f103678d/node_modules/mppx/dist/tempo/internal/auto-swap.js"() {
119480
119364
  init_actions();
119481
119365
  init_tempo3();
119482
- init_address4();
119366
+ init_address3();
119483
119367
  init_defaults2();
119484
119368
  bps = 10000n;
119485
119369
  defaultCurrencies = [
@@ -119498,7 +119382,7 @@ var charge3;
119498
119382
  var session;
119499
119383
  var init_Methods3 = __esm({
119500
119384
  "../../node_modules/.pnpm/mppx@0.4.9_@modelcontextprotocol+sdk@1.28.0_zod@4.4.3__express@5.2.1_hono@4.12.9_openap_a5bd8709643e33148686c341f103678d/node_modules/mppx/dist/tempo/Methods.js"() {
119501
- init_esm5();
119385
+ init_esm4();
119502
119386
  init_Method();
119503
119387
  init_zod2();
119504
119388
  charge3 = from9({
@@ -120307,7 +120191,7 @@ var DOMAIN_VERSION;
120307
120191
  var voucherTypes;
120308
120192
  var init_Voucher = __esm({
120309
120193
  "../../node_modules/.pnpm/mppx@0.4.9_@modelcontextprotocol+sdk@1.28.0_zod@4.4.3__express@5.2.1_hono@4.12.9_openap_a5bd8709643e33148686c341f103678d/node_modules/mppx/dist/tempo/session/Voucher.js"() {
120310
- init_esm4();
120194
+ init_esm3();
120311
120195
  init_tempo4();
120312
120196
  init_actions();
120313
120197
  DOMAIN_NAME = "Tempo Stream Channel";
@@ -120346,7 +120230,7 @@ function computeId2(parameters) {
120346
120230
  }
120347
120231
  var init_Channel = __esm({
120348
120232
  "../../node_modules/.pnpm/mppx@0.4.9_@modelcontextprotocol+sdk@1.28.0_zod@4.4.3__express@5.2.1_hono@4.12.9_openap_a5bd8709643e33148686c341f103678d/node_modules/mppx/dist/tempo/session/Channel.js"() {
120349
- init_esm4();
120233
+ init_esm3();
120350
120234
  }
120351
120235
  });
120352
120236
  var escrowAbi;
@@ -121123,7 +121007,7 @@ async function getOnChainChannel(client, escrowContract2, channelId) {
121123
121007
  }
121124
121008
  var init_Chain = __esm({
121125
121009
  "../../node_modules/.pnpm/mppx@0.4.9_@modelcontextprotocol+sdk@1.28.0_zod@4.4.3__express@5.2.1_hono@4.12.9_openap_a5bd8709643e33148686c341f103678d/node_modules/mppx/dist/tempo/session/Chain.js"() {
121126
- init_esm5();
121010
+ init_esm4();
121127
121011
  init_actions();
121128
121012
  init_escrow_abi();
121129
121013
  /* @__PURE__ */ toFunctionSelector(getAbiItem({ abi: escrowAbi, name: "open" }));
@@ -121227,8 +121111,8 @@ async function tryRecoverChannel(client, escrowContract2, channelId, chainId2) {
121227
121111
  }
121228
121112
  var init_ChannelOps = __esm({
121229
121113
  "../../node_modules/.pnpm/mppx@0.4.9_@modelcontextprotocol+sdk@1.28.0_zod@4.4.3__express@5.2.1_hono@4.12.9_openap_a5bd8709643e33148686c341f103678d/node_modules/mppx/dist/tempo/client/ChannelOps.js"() {
121114
+ init_esm3();
121230
121115
  init_esm4();
121231
- init_esm5();
121232
121116
  init_actions();
121233
121117
  init_tempo3();
121234
121118
  init_Credential();
@@ -121432,7 +121316,7 @@ function session2(parameters = {}) {
121432
121316
  var sessionContextSchema;
121433
121317
  var init_Session = __esm({
121434
121318
  "../../node_modules/.pnpm/mppx@0.4.9_@modelcontextprotocol+sdk@1.28.0_zod@4.4.3__express@5.2.1_hono@4.12.9_openap_a5bd8709643e33148686c341f103678d/node_modules/mppx/dist/tempo/client/Session.js"() {
121435
- init_esm5();
121319
+ init_esm4();
121436
121320
  init_chains();
121437
121321
  init_Method();
121438
121322
  init_Account2();
@@ -121564,7 +121448,7 @@ function deserializeSessionReceipt(encoded) {
121564
121448
  }
121565
121449
  var init_Receipt = __esm({
121566
121450
  "../../node_modules/.pnpm/mppx@0.4.9_@modelcontextprotocol+sdk@1.28.0_zod@4.4.3__express@5.2.1_hono@4.12.9_openap_a5bd8709643e33148686c341f103678d/node_modules/mppx/dist/tempo/session/Receipt.js"() {
121567
- init_esm4();
121451
+ init_esm3();
121568
121452
  }
121569
121453
  });
121570
121454
  function parseEvent(raw) {
@@ -122126,6 +122010,122 @@ var init_client7 = __esm({
122126
122010
  };
122127
122011
  }
122128
122012
  });
122013
+ function computeZkLoginAddressFromSeed(addressSeed, iss, legacyAddress) {
122014
+ if (legacyAddress === void 0) throw new Error("legacyAddress parameter must be specified");
122015
+ const addressSeedBytesBigEndian = legacyAddress ? toBigEndianBytes(addressSeed, 32) : toPaddedBigEndianBytes(addressSeed, 32);
122016
+ const addressParamBytes = new TextEncoder().encode(normalizeZkLoginIssuer(iss));
122017
+ const tmp = new Uint8Array(2 + addressSeedBytesBigEndian.length + addressParamBytes.length);
122018
+ tmp.set([SIGNATURE_SCHEME_TO_FLAG.ZkLogin]);
122019
+ tmp.set([addressParamBytes.length], 1);
122020
+ tmp.set(addressParamBytes, 2);
122021
+ tmp.set(addressSeedBytesBigEndian, 2 + addressParamBytes.length);
122022
+ return normalizeSuiAddress(bytesToHex(blake2b(tmp, { dkLen: 32 })).slice(0, SUI_ADDRESS_LENGTH * 2));
122023
+ }
122024
+ function lengthChecks(jwt2) {
122025
+ const [header, payload] = jwt2.split(".");
122026
+ if (header.length > MAX_HEADER_LEN_B64) throw new Error(`Header is too long`);
122027
+ const L2 = (header.length + 1 + payload.length) * 8;
122028
+ const K2 = (960 - (L2 % 512 + 1)) % 512;
122029
+ if ((L2 + 1 + K2 + 64) / 8 > MAX_PADDED_UNSIGNED_JWT_LEN) throw new Error(`JWT is too long`);
122030
+ }
122031
+ function jwtToAddress(jwt2, userSalt, legacyAddress) {
122032
+ if (legacyAddress === void 0) throw new Error("legacyAddress parameter must be specified");
122033
+ lengthChecks(jwt2);
122034
+ const decodedJWT = decodeJwt(jwt2);
122035
+ return computeZkLoginAddress({
122036
+ userSalt,
122037
+ claimName: "sub",
122038
+ claimValue: decodedJWT.sub,
122039
+ aud: decodedJWT.aud,
122040
+ iss: decodedJWT.iss,
122041
+ legacyAddress
122042
+ });
122043
+ }
122044
+ function computeZkLoginAddress({ claimName, claimValue, iss, aud, userSalt, legacyAddress }) {
122045
+ if (legacyAddress === void 0) throw new Error("legacyAddress parameter must be specified");
122046
+ return computeZkLoginAddressFromSeed(genAddressSeed(userSalt, claimName, claimValue, aud), iss, legacyAddress);
122047
+ }
122048
+ var MAX_HEADER_LEN_B64;
122049
+ var MAX_PADDED_UNSIGNED_JWT_LEN;
122050
+ var init_address4 = __esm({
122051
+ "../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/zklogin/address.mjs"() {
122052
+ init_sui_types();
122053
+ init_signature_scheme2();
122054
+ init_utils9();
122055
+ init_jwt_utils();
122056
+ init_blake2();
122057
+ init_utils3();
122058
+ MAX_HEADER_LEN_B64 = 248;
122059
+ MAX_PADDED_UNSIGNED_JWT_LEN = 1600;
122060
+ }
122061
+ });
122062
+ function toBigIntBE(bytes) {
122063
+ const hex3 = toHex(bytes);
122064
+ if (hex3.length === 0) return BigInt(0);
122065
+ return BigInt(`0x${hex3}`);
122066
+ }
122067
+ function generateRandomness() {
122068
+ return String(toBigIntBE(randomBytes(16)));
122069
+ }
122070
+ function generateNonce(publicKey, maxEpoch, randomness) {
122071
+ const publicKeyBytes = toBigIntBE(publicKey.toSuiBytes());
122072
+ const Z2 = toPaddedBigEndianBytes(poseidonHash([
122073
+ publicKeyBytes / 2n ** 128n,
122074
+ publicKeyBytes % 2n ** 128n,
122075
+ maxEpoch,
122076
+ BigInt(randomness)
122077
+ ]), 20);
122078
+ const nonce2 = base64urlnopad.encode(Z2);
122079
+ if (nonce2.length !== NONCE_LENGTH) throw new Error(`Length of nonce ${nonce2} (${nonce2.length}) is not equal to ${NONCE_LENGTH}`);
122080
+ return nonce2;
122081
+ }
122082
+ var NONCE_LENGTH;
122083
+ var init_nonce2 = __esm({
122084
+ "../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/zklogin/nonce.mjs"() {
122085
+ init_poseidon();
122086
+ init_utils9();
122087
+ init_dist2();
122088
+ init_utils3();
122089
+ init_base();
122090
+ NONCE_LENGTH = 27;
122091
+ }
122092
+ });
122093
+ var init_zklogin = __esm({
122094
+ "../../node_modules/.pnpm/@mysten+sui@2.17.0_typescript@5.9.3/node_modules/@mysten/sui/dist/zklogin/index.mjs"() {
122095
+ init_poseidon();
122096
+ init_utils9();
122097
+ init_signature2();
122098
+ init_address4();
122099
+ init_nonce2();
122100
+ }
122101
+ });
122102
+ var esm_exports = {};
122103
+ __export(esm_exports, {
122104
+ computeZkLoginAddress: () => computeZkLoginAddress2,
122105
+ genAddressSeed: () => genAddressSeed,
122106
+ generateNonce: () => generateNonce,
122107
+ generateRandomness: () => generateRandomness,
122108
+ getExtendedEphemeralPublicKey: () => getExtendedEphemeralPublicKey,
122109
+ getZkLoginSignature: () => getZkLoginSignature,
122110
+ hashASCIIStrToField: () => hashASCIIStrToField,
122111
+ jwtToAddress: () => jwtToAddress2,
122112
+ poseidonHash: () => poseidonHash
122113
+ });
122114
+ function computeZkLoginAddress2(options) {
122115
+ return computeZkLoginAddress({
122116
+ ...options,
122117
+ legacyAddress: true
122118
+ });
122119
+ }
122120
+ function jwtToAddress2(jwt2, userSalt, legacyAddress = true) {
122121
+ return jwtToAddress(jwt2, userSalt, legacyAddress);
122122
+ }
122123
+ var init_esm5 = __esm({
122124
+ "../../node_modules/.pnpm/@mysten+zklogin@0.8.1_typescript@5.9.3/node_modules/@mysten/zklogin/dist/esm/index.js"() {
122125
+ init_zklogin();
122126
+ init_zklogin();
122127
+ }
122128
+ });
122129
122129
  // @__NO_SIDE_EFFECTS__
122130
122130
  function $constructor(name, initializer4, params) {
122131
122131
  function init(inst, def) {
@@ -134590,7 +134590,15 @@ async function fetchAllCoins(client, owner, coinType) {
134590
134590
  }
134591
134591
  async function selectAndSplitCoin(tx, client, owner, coinType, amount2, options = {}) {
134592
134592
  if (options.sponsoredContext) {
134593
- return selectCoinObjectsOnly(tx, client, owner, coinType, amount2, options.allowSwapAll ?? true);
134593
+ return selectCoinObjectsOnly(
134594
+ tx,
134595
+ client,
134596
+ owner,
134597
+ coinType,
134598
+ amount2,
134599
+ options.allowSwapAll ?? true,
134600
+ options.mergeCache
134601
+ );
134594
134602
  }
134595
134603
  const balanceResp = await client.getBalance({ owner, coinType });
134596
134604
  const totalBalance = BigInt(balanceResp.totalBalance);
@@ -134896,14 +134904,15 @@ async function addSwapToTx(tx, client, address2, input) {
134896
134904
  address2,
134897
134905
  requestedRaw,
134898
134906
  input.sponsoredContext ?? false,
134899
- input.suiMergeCache
134907
+ input.coinMergeCache
134900
134908
  );
134901
134909
  inputCoin = result.coin;
134902
134910
  effectiveRaw = result.effectiveAmount;
134903
134911
  } else {
134904
134912
  const { selectAndSplitCoin: selectAndSplitCoin2 } = await Promise.resolve().then(() => (init_coinSelection(), coinSelection_exports));
134905
134913
  const result = await selectAndSplitCoin2(tx, client, address2, fromType, requestedRaw, {
134906
- sponsoredContext: input.sponsoredContext ?? false
134914
+ sponsoredContext: input.sponsoredContext ?? false,
134915
+ mergeCache: input.coinMergeCache
134907
134916
  });
134908
134917
  inputCoin = result.coin;
134909
134918
  effectiveRaw = result.effectiveAmount;
@@ -135254,11 +135263,88 @@ var KeypairSigner = class {
135254
135263
  return this.keypair;
135255
135264
  }
135256
135265
  };
135266
+ async function executeTx(client, signer, buildTx, options = {}) {
135267
+ const tx = await buildTx();
135268
+ tx.setSender(signer.getAddress());
135269
+ const txBytes = await tx.build({ client: options.buildClient ?? client });
135270
+ const { signature: signature2 } = await signer.signTransaction(txBytes);
135271
+ const result = await client.executeTransactionBlock({
135272
+ transactionBlock: txBytes,
135273
+ signature: signature2,
135274
+ options: { showEffects: true }
135275
+ });
135276
+ await client.waitForTransaction({ digest: result.digest });
135277
+ const gasUsed = result.effects?.gasUsed;
135278
+ let gasCostSui = 0;
135279
+ if (gasUsed) {
135280
+ const total = BigInt(gasUsed.computationCost) + BigInt(gasUsed.storageCost) - BigInt(gasUsed.storageRebate);
135281
+ gasCostSui = Number(total) / 1e9;
135282
+ }
135283
+ return { digest: result.digest, gasCostSui, effects: result.effects ?? void 0 };
135284
+ }
135257
135285
  function parseChallengeAmount(challenge2) {
135258
135286
  const raw = challenge2?.request?.amount;
135259
135287
  const n = typeof raw === "string" ? Number(raw) : typeof raw === "number" ? raw : Number.NaN;
135260
135288
  return Number.isFinite(n) ? n : void 0;
135261
135289
  }
135290
+ async function payWithMpp(args) {
135291
+ const { signer, client, options } = args;
135292
+ const { Mppx } = await Promise.resolve().then(() => (init_client6(), client_exports));
135293
+ const { sui: sui2, USDC: USDC2 } = await Promise.resolve().then(() => (init_client7(), client_exports2));
135294
+ const { SuiGrpcClient: SuiGrpcClient2 } = await Promise.resolve().then(() => (init_grpc(), grpc_exports));
135295
+ const signerAddress = signer.getAddress();
135296
+ let paymentDigest;
135297
+ let gasCostSui = 0;
135298
+ let chargedAmount;
135299
+ const network = client.network === "testnet" ? "testnet" : "mainnet";
135300
+ const grpcBaseUrl = network === "testnet" ? "https://fullnode.testnet.sui.io" : "https://fullnode.mainnet.sui.io";
135301
+ const grpcClient = new SuiGrpcClient2({ baseUrl: grpcBaseUrl, network });
135302
+ const mppx = Mppx.create({
135303
+ polyfill: false,
135304
+ onChallenge: async (challenge2) => {
135305
+ const parsed = parseChallengeAmount(challenge2);
135306
+ if (parsed !== void 0) chargedAmount = parsed;
135307
+ return void 0;
135308
+ },
135309
+ methods: [sui2({
135310
+ client,
135311
+ currency: USDC2,
135312
+ signer: {
135313
+ toSuiAddress: () => signerAddress,
135314
+ signPersonalMessage: (bytes) => signer.signPersonalMessage(bytes)
135315
+ },
135316
+ execute: async (tx) => {
135317
+ const result = await executeTx(client, signer, () => tx, { buildClient: grpcClient });
135318
+ paymentDigest = result.digest;
135319
+ gasCostSui = result.gasCostSui;
135320
+ return { digest: result.digest };
135321
+ }
135322
+ })]
135323
+ });
135324
+ const method = (options.method ?? "GET").toUpperCase();
135325
+ const canHaveBody = method !== "GET" && method !== "HEAD";
135326
+ const response = await mppx.fetch(options.url, {
135327
+ method,
135328
+ headers: options.headers,
135329
+ body: canHaveBody ? options.body : void 0
135330
+ });
135331
+ const contentType = response.headers.get("content-type") ?? "";
135332
+ let body;
135333
+ try {
135334
+ body = contentType.includes("application/json") ? await response.json() : await response.text();
135335
+ } catch {
135336
+ body = null;
135337
+ }
135338
+ const paid = !!paymentDigest;
135339
+ return {
135340
+ status: response.status,
135341
+ body,
135342
+ paid,
135343
+ cost: paid ? chargedAmount ?? options.maxPrice ?? void 0 : void 0,
135344
+ gasCostSui: paid ? gasCostSui : void 0,
135345
+ receipt: paymentDigest ? { reference: paymentDigest, timestamp: (/* @__PURE__ */ new Date()).toISOString() } : void 0
135346
+ };
135347
+ }
135262
135348
  var ZkLoginSigner = class {
135263
135349
  constructor(ephemeralKeypair, zkProof, userAddress, maxEpoch) {
135264
135350
  this.ephemeralKeypair = ephemeralKeypair;
@@ -135270,7 +135356,7 @@ var ZkLoginSigner = class {
135270
135356
  return this.userAddress;
135271
135357
  }
135272
135358
  async signTransaction(txBytes) {
135273
- const { getZkLoginSignature: getZkLoginSignature2 } = await Promise.resolve().then(() => (init_esm2(), esm_exports));
135359
+ const { getZkLoginSignature: getZkLoginSignature2 } = await Promise.resolve().then(() => (init_esm5(), esm_exports));
135274
135360
  const ephSig = await this.ephemeralKeypair.signTransaction(txBytes);
135275
135361
  return {
135276
135362
  signature: getZkLoginSignature2({
@@ -135280,8 +135366,17 @@ var ZkLoginSigner = class {
135280
135366
  })
135281
135367
  };
135282
135368
  }
135283
- async signPersonalMessage(_messageBytes) {
135284
- throw new Error("ZkLoginSigner.signPersonalMessage is not yet implemented. Use KeypairSigner for sdk.pay() until grief-protection signing is wired for zkLogin.");
135369
+ async signPersonalMessage(messageBytes) {
135370
+ const { getZkLoginSignature: getZkLoginSignature2 } = await Promise.resolve().then(() => (init_esm5(), esm_exports));
135371
+ const { signature: ephSig, bytes } = await this.ephemeralKeypair.signPersonalMessage(messageBytes);
135372
+ return {
135373
+ signature: getZkLoginSignature2({
135374
+ inputs: this.zkProof,
135375
+ maxEpoch: this.maxEpoch,
135376
+ userSignature: ephSig
135377
+ }),
135378
+ bytes
135379
+ };
135285
135380
  }
135286
135381
  isExpired(currentEpoch) {
135287
135382
  return currentEpoch >= this.maxEpoch;
@@ -140153,25 +140248,6 @@ var ContactManager = class {
140153
140248
  }
140154
140249
  };
140155
140250
  var DEFAULT_CONFIG_DIR = join$1(homedir(), ".t2000");
140156
- async function executeTx(client, signer, buildTx, options = {}) {
140157
- const tx = await buildTx();
140158
- tx.setSender(signer.getAddress());
140159
- const txBytes = await tx.build({ client: options.buildClient ?? client });
140160
- const { signature: signature2 } = await signer.signTransaction(txBytes);
140161
- const result = await client.executeTransactionBlock({
140162
- transactionBlock: txBytes,
140163
- signature: signature2,
140164
- options: { showEffects: true }
140165
- });
140166
- await client.waitForTransaction({ digest: result.digest });
140167
- const gasUsed = result.effects?.gasUsed;
140168
- let gasCostSui = 0;
140169
- if (gasUsed) {
140170
- const total = BigInt(gasUsed.computationCost) + BigInt(gasUsed.storageCost) - BigInt(gasUsed.storageRebate);
140171
- gasCostSui = Number(total) / 1e9;
140172
- }
140173
- return { digest: result.digest, gasCostSui, effects: result.effects ?? void 0 };
140174
- }
140175
140251
  var T2000 = class _T2000 extends import_index2.default {
140176
140252
  _signer;
140177
140253
  _keypair;
@@ -140251,66 +140327,11 @@ var T2000 = class _T2000 extends import_index2.default {
140251
140327
  async pay(options) {
140252
140328
  this.enforcer.assertNotLocked();
140253
140329
  this.enforcer.check({ operation: "pay", amount: options.maxPrice ?? 1 });
140254
- const { Mppx } = await Promise.resolve().then(() => (init_client6(), client_exports));
140255
- const { sui: sui2, USDC: USDC2 } = await Promise.resolve().then(() => (init_client7(), client_exports2));
140256
- const { SuiGrpcClient: SuiGrpcClient2 } = await Promise.resolve().then(() => (init_grpc(), grpc_exports));
140257
- const client = this.client;
140258
- const signer = this._signer;
140259
- const signerAddress = signer.getAddress();
140260
- let paymentDigest;
140261
- let gasCostSui = 0;
140262
- let chargedAmount;
140263
- const network = client.network === "testnet" ? "testnet" : "mainnet";
140264
- const grpcBaseUrl = network === "testnet" ? "https://fullnode.testnet.sui.io" : "https://fullnode.mainnet.sui.io";
140265
- const grpcClient = new SuiGrpcClient2({ baseUrl: grpcBaseUrl, network });
140266
- const mppx = Mppx.create({
140267
- polyfill: false,
140268
- onChallenge: async (challenge2) => {
140269
- const parsed = parseChallengeAmount(challenge2);
140270
- if (parsed !== void 0) chargedAmount = parsed;
140271
- return void 0;
140272
- },
140273
- methods: [sui2({
140274
- client,
140275
- currency: USDC2,
140276
- signer: {
140277
- toSuiAddress: () => signerAddress,
140278
- signPersonalMessage: (bytes) => signer.signPersonalMessage(bytes)
140279
- },
140280
- execute: async (tx) => {
140281
- const result = await executeTx(client, signer, () => tx, { buildClient: grpcClient });
140282
- paymentDigest = result.digest;
140283
- gasCostSui = result.gasCostSui;
140284
- return { digest: result.digest };
140285
- }
140286
- })]
140287
- });
140288
- const method = (options.method ?? "GET").toUpperCase();
140289
- const canHaveBody = method !== "GET" && method !== "HEAD";
140290
- const response = await mppx.fetch(options.url, {
140291
- method,
140292
- headers: options.headers,
140293
- body: canHaveBody ? options.body : void 0
140294
- });
140295
- const contentType = response.headers.get("content-type") ?? "";
140296
- let body;
140297
- try {
140298
- body = contentType.includes("application/json") ? await response.json() : await response.text();
140299
- } catch {
140300
- body = null;
140301
- }
140302
- const paid = !!paymentDigest;
140303
- if (paid) {
140304
- this.enforcer.recordUsage(chargedAmount ?? options.maxPrice ?? 1);
140330
+ const result = await payWithMpp({ signer: this._signer, client: this.client, options });
140331
+ if (result.paid) {
140332
+ this.enforcer.recordUsage(result.cost ?? options.maxPrice ?? 1);
140305
140333
  }
140306
- return {
140307
- status: response.status,
140308
- body,
140309
- paid,
140310
- cost: paid ? chargedAmount ?? options.maxPrice ?? void 0 : void 0,
140311
- gasCostSui: paid ? gasCostSui : void 0,
140312
- receipt: paymentDigest ? { reference: paymentDigest, timestamp: (/* @__PURE__ */ new Date()).toISOString() } : void 0
140313
- };
140334
+ return result;
140314
140335
  }
140315
140336
  // [S.323 / 2026-05-25] VOLO vSUI staking surfaces removed (full cut).
140316
140337
  // Engine cut Volo in S.277; SDK + CLI + MCP followed in S.323 because the
@@ -141760,7 +141781,7 @@ Through this wallet you can reach essentially any major external API, billed to
141760
141781
  CRITICAL: When the user asks to use any external or paid API, names a provider (e.g. "via fal.ai", "with ElevenLabs"), or requests a capability one of the services above provides, DO NOT say you cannot reach that service, that it isn't on an allowlist, or that there's no connector \u2014 and do NOT fall back to writing a script for the user to run. You CAN do it directly through this wallet. Use t2000_services to discover the endpoint and request shape, then t2000_pay to execute, then show the user the result (display image/audio URLs returned in the response).
141761
141782
 
141762
141783
  Spending is the user's own USDC and every t2000_pay call is bounded by maxPrice. For larger or multi-step spends, state the estimated cost first and proceed once the user is happy. Use t2000_balance to check funds. The v4 wallet is payments-only; savings / lending live on audric.ai.`;
141763
- var PKG_VERSION = "4.2.1";
141784
+ var PKG_VERSION = "4.3.0";
141764
141785
  console.log = (...args) => console.error("[log]", ...args);
141765
141786
  console.warn = (...args) => console.error("[warn]", ...args);
141766
141787
  async function startMcpServer(opts) {
@@ -141847,4 +141868,4 @@ axios/dist/node/axios.cjs:
141847
141868
  @scure/bip39/index.js:
141848
141869
  (*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
141849
141870
  */
141850
- //# sourceMappingURL=dist-EQH4IESE.js.map
141871
+ //# sourceMappingURL=dist-ELFUROC5.js.map