@lucid-agents/taskmarket 1.50.0 → 1.51.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/index.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  listWorkerSubmissions,
15
15
  submitTaskFiles,
16
16
  taskRequirementsOf
17
- } from "./chunk-MY5CD4PT.js";
17
+ } from "./chunk-HZ6KGGNX.js";
18
18
  import {
19
19
  ComputeCreditError,
20
20
  applyComputeCreditSetup,
@@ -43,14 +43,14 @@ import {
43
43
  withSelectedChain,
44
44
  x402FeePost,
45
45
  x402PaymentProtocol
46
- } from "./chunk-V5S4LCIE.js";
46
+ } from "./chunk-O56EUZVG.js";
47
47
  import {
48
48
  signReadAuth
49
- } from "./chunk-EYHXTVYK.js";
49
+ } from "./chunk-VQ6X6FME.js";
50
50
  import {
51
51
  saveTaskAccessGrant,
52
52
  taskAccessGrantHeaders
53
- } from "./chunk-M5WTLXDY.js";
53
+ } from "./chunk-7OC73WUN.js";
54
54
  import {
55
55
  MPP_TEMPO_DEFAULT_VALIDITY_SECONDS,
56
56
  X402PayError,
@@ -69,7 +69,7 @@ import {
69
69
  setX402PolicyRuleEnabled,
70
70
  signSponsoredTempoTransfer,
71
71
  signTaskmarketFeePayment
72
- } from "./chunk-C7557KRB.js";
72
+ } from "./chunk-5EUSU7QA.js";
73
73
  import {
74
74
  ALL_NETWORKS,
75
75
  ApiError,
@@ -135,7 +135,7 @@ import {
135
135
  withErrorContext,
136
136
  withIdempotentWrite,
137
137
  withTapSignature
138
- } from "./chunk-EVCG557X.js";
138
+ } from "./chunk-DE5YYAHJ.js";
139
139
  import {
140
140
  AGENT_AVATAR_MAX_BYTES,
141
141
  AGENT_HIRES_ROLES,
@@ -154,6 +154,7 @@ import {
154
154
  AgentListingSchema,
155
155
  AgentMessageEnvelopeSchema,
156
156
  AgentServiceRecordsResponseSchema,
157
+ AgentShopfrontPublicSchema,
157
158
  AgentTimeSeriesInputSchema,
158
159
  AgentUserSkillArchiveWriteSchema,
159
160
  AgentUserSkillBundleWriteSchema,
@@ -234,12 +235,16 @@ import {
234
235
  RejectOutcome,
235
236
  RelayBridgeFundingConfigOutputSchema,
236
237
  RelayBridgeRouteIdSchema,
238
+ SERVICE_HIRE_ACCEPT_POLICIES,
239
+ SHOP_HANDLE_REGEX,
237
240
  SOLANA_CHAIN_IDS,
238
241
  SPONSORED_VAULT_7702,
239
242
  STANDARD_X402_ACTION_AMOUNT,
240
243
  SUGGESTION_PROPOSAL_STATUSES,
241
244
  SUGGESTION_SCHEDULE_MAX_TASKS_PER_RUN,
245
+ ServiceHireAcceptPolicySchema,
242
246
  SetMarketEventPreferenceInputSchema,
247
+ ShopHandleResolveResultSchema,
243
248
  SponsoredTaskRewardStateSchema,
244
249
  SponsoredTaskWorkerRewardClaimStatusSchema,
245
250
  SubmissionReviewAssessmentInputSchema,
@@ -370,6 +375,7 @@ import {
370
375
  matchesAnyGlob,
371
376
  needsYouKindForIntent,
372
377
  normalizeReferenceCode,
378
+ normalizeShopHandle,
373
379
  normalizeWorkflowTemplateTags,
374
380
  parseIsoDurationSeconds,
375
381
  parseScheduleCadence,
@@ -409,7 +415,7 @@ import {
409
415
  vaultCallGasLimit7702,
410
416
  verifiersUnsupportedOnChain,
411
417
  viemChainFor
412
- } from "./chunk-EJ7KUYME.js";
418
+ } from "./chunk-LC5VE4EQ.js";
413
419
  import "./chunk-S7SJMJ2I.js";
414
420
 
415
421
  // src/index.ts
@@ -668,16 +674,16 @@ function recoverableFailure(message, status) {
668
674
  const quoted = /"amount":"(\d+)"/.exec(message)?.[1];
669
675
  const required = quoted !== void 0 ? BigInt(quoted) : void 0;
670
676
  const chainId = selectedNetworkOrUndefined()?.chainId;
671
- let address2;
677
+ let address3;
672
678
  try {
673
679
  const keystore = JSON.parse(fs2.readFileSync(getKeystorePath(), "utf8"));
674
- if (typeof keystore.walletAddress === "string") address2 = keystore.walletAddress;
680
+ if (typeof keystore.walletAddress === "string") address3 = keystore.walletAddress;
675
681
  } catch {
676
682
  }
677
683
  return {
678
684
  code: "insufficient_funds",
679
685
  next: nextForInsufficientFunds(
680
- address2 !== void 0 && chainId !== void 0 ? { address: address2, chainId } : void 0,
686
+ address3 !== void 0 && chainId !== void 0 ? { address: address3, chainId } : void 0,
681
687
  required
682
688
  ),
683
689
  ...quoted !== void 0 ? { required: { baseUnits: quoted } } : {}
@@ -771,10 +777,10 @@ function agentIdForChain(keystore, chainId) {
771
777
  function withAgentIdForChain(keystore, chainId, agentId) {
772
778
  return { ...keystore, agentIds: { ...keystore.agentIds, [String(chainId)]: agentId } };
773
779
  }
774
- async function lookupAgentId(address2, chainId = selectedNetwork().chainId) {
780
+ async function lookupAgentId(address3, chainId = selectedNetwork().chainId) {
775
781
  try {
776
782
  const res = await fetch(
777
- `${apiUrl()}/api/identity/status?address=${address2}&chainId=${chainId}`
783
+ `${apiUrl()}/api/identity/status?address=${address3}&chainId=${chainId}`
778
784
  );
779
785
  if (!res.ok) return null;
780
786
  const data = await res.json();
@@ -783,12 +789,12 @@ async function lookupAgentId(address2, chainId = selectedNetwork().chainId) {
783
789
  return null;
784
790
  }
785
791
  }
786
- async function pollAgentId(address2, maxWaitMs = 6e4) {
792
+ async function pollAgentId(address3, maxWaitMs = 6e4) {
787
793
  const interval = 3e3;
788
794
  const deadline = Date.now() + maxWaitMs;
789
795
  while (Date.now() < deadline) {
790
796
  await new Promise((r) => setTimeout(r, interval));
791
- const agentId = await lookupAgentId(address2);
797
+ const agentId = await lookupAgentId(address3);
792
798
  if (agentId) return agentId;
793
799
  }
794
800
  return null;
@@ -1867,11 +1873,11 @@ function getErrorMessage(code, context = {}) {
1867
1873
  return `${decodingAdviceMessage}\``;
1868
1874
  }
1869
1875
  }
1870
- function isSolanaError(e4, code) {
1871
- const isSolanaError2 = e4 instanceof Error && e4.name === "SolanaError";
1872
- if (isSolanaError2) {
1876
+ function isSolanaError(e5, code) {
1877
+ const isSolanaError22 = e5 instanceof Error && e5.name === "SolanaError";
1878
+ if (isSolanaError22) {
1873
1879
  if (code !== void 0) {
1874
- return e4.context.__code === code;
1880
+ return e5.context.__code === code;
1875
1881
  }
1876
1882
  return true;
1877
1883
  }
@@ -2428,10 +2434,10 @@ function decodeAccount(encodedAccount, decoder) {
2428
2434
  });
2429
2435
  }
2430
2436
  }
2431
- function parseBase64RpcAccount(address2, rpcAccount) {
2432
- if (!rpcAccount) return Object.freeze({ address: address2, exists: false });
2437
+ function parseBase64RpcAccount(address3, rpcAccount) {
2438
+ if (!rpcAccount) return Object.freeze({ address: address3, exists: false });
2433
2439
  const data = getBase64Encoder().encode(rpcAccount.data[0]);
2434
- return Object.freeze({ ...parseBaseAccount(rpcAccount), address: address2, data, exists: true });
2440
+ return Object.freeze({ ...parseBaseAccount(rpcAccount), address: address3, data, exists: true });
2435
2441
  }
2436
2442
  function parseBaseAccount(rpcAccount) {
2437
2443
  return Object.freeze({
@@ -2441,10 +2447,10 @@ function parseBaseAccount(rpcAccount) {
2441
2447
  space: rpcAccount.space
2442
2448
  });
2443
2449
  }
2444
- async function fetchEncodedAccount(rpc, address2, config = {}) {
2450
+ async function fetchEncodedAccount(rpc, address3, config = {}) {
2445
2451
  const { abortSignal, ...rpcConfig } = config;
2446
- const response = await rpc.getAccountInfo(address2, { ...rpcConfig, encoding: "base64" }).send({ abortSignal });
2447
- return parseBase64RpcAccount(address2, response.value);
2452
+ const response = await rpc.getAccountInfo(address3, { ...rpcConfig, encoding: "base64" }).send({ abortSignal });
2453
+ return parseBase64RpcAccount(address3, response.value);
2448
2454
  }
2449
2455
 
2450
2456
  // ../../node_modules/.pnpm/@solana+assertions@8.4.0_typescript@5.7.3/node_modules/@solana/assertions/dist/index.node.mjs
@@ -2694,16 +2700,16 @@ async function getProgramDerivedAddress({
2694
2700
  let bumpSeed = 255;
2695
2701
  while (bumpSeed > 0) {
2696
2702
  try {
2697
- const address2 = await createProgramDerivedAddress({
2703
+ const address22 = await createProgramDerivedAddress({
2698
2704
  programAddress,
2699
2705
  seeds: [...seeds, new Uint8Array([bumpSeed])]
2700
2706
  });
2701
- return [address2, bumpSeed];
2702
- } catch (e4) {
2703
- if (isSolanaError(e4, SOLANA_ERROR__ADDRESSES__INVALID_SEEDS_POINT_ON_CURVE)) {
2707
+ return [address22, bumpSeed];
2708
+ } catch (e5) {
2709
+ if (isSolanaError(e5, SOLANA_ERROR__ADDRESSES__INVALID_SEEDS_POINT_ON_CURVE)) {
2704
2710
  bumpSeed--;
2705
2711
  } else {
2706
- throw e4;
2712
+ throw e5;
2707
2713
  }
2708
2714
  }
2709
2715
  }
@@ -3224,16 +3230,16 @@ function pipe(init, ...fns) {
3224
3230
  }
3225
3231
 
3226
3232
  // ../../node_modules/.pnpm/@solana+instructions@8.4.0_typescript@5.7.3/node_modules/@solana/instructions/dist/index.node.mjs
3227
- var AccountRole = /* @__PURE__ */ ((AccountRole2) => {
3228
- AccountRole2[AccountRole2["WRITABLE_SIGNER"] = /* 3 */
3233
+ var AccountRole = /* @__PURE__ */ ((AccountRole22) => {
3234
+ AccountRole22[AccountRole22["WRITABLE_SIGNER"] = /* 3 */
3229
3235
  3] = "WRITABLE_SIGNER";
3230
- AccountRole2[AccountRole2["READONLY_SIGNER"] = /* 2 */
3236
+ AccountRole22[AccountRole22["READONLY_SIGNER"] = /* 2 */
3231
3237
  2] = "READONLY_SIGNER";
3232
- AccountRole2[AccountRole2["WRITABLE"] = /* 1 */
3238
+ AccountRole22[AccountRole22["WRITABLE"] = /* 1 */
3233
3239
  1] = "WRITABLE";
3234
- AccountRole2[AccountRole2["READONLY"] = /* 0 */
3240
+ AccountRole22[AccountRole22["READONLY"] = /* 0 */
3235
3241
  0] = "READONLY";
3236
- return AccountRole2;
3242
+ return AccountRole22;
3237
3243
  })(AccountRole || {});
3238
3244
  var IS_SIGNER_BITMASK = 2;
3239
3245
  var IS_WRITABLE_BITMASK = 1;
@@ -3523,8 +3529,8 @@ function getCompiledTransactionMessageEncoder() {
3523
3529
  }
3524
3530
  );
3525
3531
  }
3526
- function upsert(addressMap, address2, update) {
3527
- addressMap[address2] = update(addressMap[address2] ?? { role: AccountRole.READONLY });
3532
+ function upsert(addressMap, address3, update) {
3533
+ addressMap[address3] = update(addressMap[address3] ?? { role: AccountRole.READONLY });
3528
3534
  }
3529
3535
  var TYPE2 = /* @__PURE__ */ Symbol("AddressMapTypeProperty");
3530
3536
  function getAddressMapFromInstructions(feePayer, instructions) {
@@ -3638,8 +3644,8 @@ function getOrderedAccountsFromAddressMap(addressMap) {
3638
3644
  }
3639
3645
  addressComparator ||= getAddressComparator();
3640
3646
  return addressComparator(leftAddress, rightAddress);
3641
- }).map(([address2, addressMeta]) => ({
3642
- address: address2,
3647
+ }).map(([address3, addressMeta]) => ({
3648
+ address: address3,
3643
3649
  ...addressMeta
3644
3650
  }));
3645
3651
  return orderedAccounts;
@@ -3680,7 +3686,7 @@ function getCompiledInstructions(instructions, orderedAccounts) {
3680
3686
  return instructions.map(({ accounts, data, programAddress }) => {
3681
3687
  return {
3682
3688
  programAddressIndex: accountIndex[programAddress],
3683
- ...accounts ? { accountIndices: accounts.map(({ address: address2 }) => accountIndex[address2]) } : null,
3689
+ ...accounts ? { accountIndices: accounts.map(({ address: address3 }) => accountIndex[address3]) } : null,
3684
3690
  ...data ? { data } : null
3685
3691
  };
3686
3692
  });
@@ -3737,8 +3743,8 @@ function compileTransactionMessage(transactionMessage) {
3737
3743
  version: transactionMessage.version
3738
3744
  };
3739
3745
  }
3740
- function upsert2(addressMap, address2, update) {
3741
- addressMap[address2] = update(addressMap[address2] ?? { role: AccountRole.READONLY });
3746
+ function upsert2(addressMap, address3, update) {
3747
+ addressMap[address3] = update(addressMap[address3] ?? { role: AccountRole.READONLY });
3742
3748
  }
3743
3749
  var TYPE22 = /* @__PURE__ */ Symbol("AddressMapTypeProperty");
3744
3750
  function getAddressMapFromInstructions2(feePayer, instructions) {
@@ -3906,8 +3912,8 @@ function getOrderedAccountsFromAddressMap2(addressMap) {
3906
3912
  } else {
3907
3913
  return addressComparator(leftAddress, rightAddress);
3908
3914
  }
3909
- }).map(([address2, addressMeta]) => ({
3910
- address: address2,
3915
+ }).map(([address3, addressMeta]) => ({
3916
+ address: address3,
3911
3917
  ...addressMeta
3912
3918
  }));
3913
3919
  return orderedAccounts;
@@ -3945,7 +3951,7 @@ function getCompiledInstructions2(instructions, orderedAccounts) {
3945
3951
  return instructions.map(({ accounts, data, programAddress }) => {
3946
3952
  return {
3947
3953
  programAddressIndex: accountIndex[programAddress],
3948
- ...accounts ? { accountIndices: accounts.map(({ address: address2 }) => accountIndex[address2]) } : null,
3954
+ ...accounts ? { accountIndices: accounts.map(({ address: address3 }) => accountIndex[address3]) } : null,
3949
3955
  ...data ? { data } : null
3950
3956
  };
3951
3957
  });
@@ -3953,7 +3959,7 @@ function getCompiledInstructions2(instructions, orderedAccounts) {
3953
3959
  function getCompiledStaticAccounts(orderedAccounts) {
3954
3960
  const firstLookupTableAccountIndex = orderedAccounts.findIndex((account) => "lookupTableAddress" in account);
3955
3961
  const orderedStaticAccounts = firstLookupTableAccountIndex === -1 ? orderedAccounts : orderedAccounts.slice(0, firstLookupTableAccountIndex);
3956
- return orderedStaticAccounts.map(({ address: address2 }) => address2);
3962
+ return orderedStaticAccounts.map(({ address: address3 }) => address3);
3957
3963
  }
3958
3964
  function compileTransactionMessage2(transactionMessage) {
3959
3965
  const addressMap = getAddressMapFromInstructions2(
@@ -4036,7 +4042,7 @@ function getInstructionHeader(instruction, accountIndex) {
4036
4042
  }
4037
4043
  function getInstructionPayload(instruction, accountIndex) {
4038
4044
  return {
4039
- instructionAccountIndices: instruction.accounts?.map(({ address: address2 }) => accountIndex[address2]) ?? [],
4045
+ instructionAccountIndices: instruction.accounts?.map(({ address: address3 }) => accountIndex[address3]) ?? [],
4040
4046
  instructionData: instruction.data ?? new Uint8Array()
4041
4047
  };
4042
4048
  }
@@ -4486,11 +4492,11 @@ async function partiallySignTransaction(keyPairs, transaction) {
4486
4492
  let unexpectedSigners;
4487
4493
  await Promise.all(
4488
4494
  keyPairs.map(async (keyPair) => {
4489
- const address2 = await getAddressFromPublicKey(keyPair.publicKey);
4490
- const existingSignature = transaction.signatures[address2];
4495
+ const address3 = await getAddressFromPublicKey(keyPair.publicKey);
4496
+ const existingSignature = transaction.signatures[address3];
4491
4497
  if (existingSignature === void 0) {
4492
4498
  unexpectedSigners ||= /* @__PURE__ */ new Set();
4493
- unexpectedSigners.add(address2);
4499
+ unexpectedSigners.add(address3);
4494
4500
  return;
4495
4501
  }
4496
4502
  if (unexpectedSigners) {
@@ -4501,7 +4507,7 @@ async function partiallySignTransaction(keyPairs, transaction) {
4501
4507
  return;
4502
4508
  }
4503
4509
  newSignatures ||= {};
4504
- newSignatures[address2] = newSignature;
4510
+ newSignatures[address3] = newSignature;
4505
4511
  })
4506
4512
  );
4507
4513
  if (unexpectedSigners && unexpectedSigners.size > 0) {
@@ -4524,9 +4530,9 @@ async function partiallySignTransaction(keyPairs, transaction) {
4524
4530
  }
4525
4531
  function assertIsFullySignedTransaction(transaction) {
4526
4532
  const missingSigs = [];
4527
- Object.entries(transaction.signatures).forEach(([address2, signatureBytes2]) => {
4533
+ Object.entries(transaction.signatures).forEach(([address3, signatureBytes2]) => {
4528
4534
  if (!signatureBytes2) {
4529
- missingSigs.push(address2);
4535
+ missingSigs.push(address3);
4530
4536
  }
4531
4537
  });
4532
4538
  if (missingSigs.length > 0) {
@@ -5727,19 +5733,19 @@ function setTransactionMessageFeePayerSigner(feePayer, transactionMessage) {
5727
5733
  return out;
5728
5734
  }
5729
5735
  async function createSignerFromKeyPair(keyPair) {
5730
- const address2 = await getAddressFromPublicKey(keyPair.publicKey);
5736
+ const address3 = await getAddressFromPublicKey(keyPair.publicKey);
5731
5737
  const out = {
5732
- address: address2,
5738
+ address: address3,
5733
5739
  keyPair,
5734
5740
  signMessages: (messages) => Promise.all(
5735
5741
  messages.map(
5736
- async (message) => Object.freeze({ [address2]: await signBytes(keyPair.privateKey, message.content) })
5742
+ async (message) => Object.freeze({ [address3]: await signBytes(keyPair.privateKey, message.content) })
5737
5743
  )
5738
5744
  ),
5739
5745
  signTransactions: (transactions) => Promise.all(
5740
5746
  transactions.map(async (transaction) => {
5741
5747
  const signedTransaction = await partiallySignTransaction([keyPair], transaction);
5742
- return Object.freeze({ [address2]: signedTransaction.signatures[address2] });
5748
+ return Object.freeze({ [address3]: signedTransaction.signatures[address3] });
5743
5749
  })
5744
5750
  )
5745
5751
  };
@@ -5751,9 +5757,9 @@ async function createKeyPairSignerFromBytes(bytes, extractable) {
5751
5757
  async function createKeyPairSignerFromPrivateKeyBytes(bytes, extractable) {
5752
5758
  return await createSignerFromKeyPair(await createKeyPairFromPrivateKeyBytes(bytes, extractable));
5753
5759
  }
5754
- function createNoopSigner(address2) {
5760
+ function createNoopSigner(address3) {
5755
5761
  const out = {
5756
- address: address2,
5762
+ address: address3,
5757
5763
  signMessages: (messages) => Promise.resolve(messages.map(() => Object.freeze({}))),
5758
5764
  signTransactions: (transactions) => Promise.resolve(transactions.map(() => Object.freeze({})))
5759
5765
  };
@@ -5834,10 +5840,1366 @@ async function signModifyingAndPartialTransactionSigners(transaction, modifyingS
5834
5840
  }
5835
5841
  var o2 = globalThis.TextEncoder;
5836
5842
 
5837
- // ../../node_modules/.pnpm/@solana+program-client-core@8.4.0_typescript@5.7.3/node_modules/@solana/program-client-core/dist/index.node.mjs
5843
+ // ../../node_modules/.pnpm/@solana+errors@8.4.0_typescript@6.0.3/node_modules/@solana/errors/dist/index.node.mjs
5844
+ var SOLANA_ERROR__BLOCK_HEIGHT_EXCEEDED2 = 1;
5845
+ var SOLANA_ERROR__INVALID_NONCE2 = 2;
5846
+ var SOLANA_ERROR__NONCE_ACCOUNT_NOT_FOUND2 = 3;
5847
+ var SOLANA_ERROR__BLOCKHASH_STRING_LENGTH_OUT_OF_RANGE2 = 4;
5848
+ var SOLANA_ERROR__INVALID_BLOCKHASH_BYTE_LENGTH2 = 5;
5849
+ var SOLANA_ERROR__LAMPORTS_OUT_OF_RANGE2 = 6;
5850
+ var SOLANA_ERROR__MALFORMED_BIGINT_STRING2 = 7;
5851
+ var SOLANA_ERROR__MALFORMED_NUMBER_STRING2 = 8;
5852
+ var SOLANA_ERROR__TIMESTAMP_OUT_OF_RANGE2 = 9;
5853
+ var SOLANA_ERROR__MALFORMED_JSON_RPC_ERROR2 = 10;
5854
+ var SOLANA_ERROR__FAILED_TO_SEND_TRANSACTION2 = 11;
5855
+ var SOLANA_ERROR__FAILED_TO_SEND_TRANSACTIONS2 = 12;
5856
+ var SOLANA_ERROR__FAILED_TO_SIGN_TRANSACTION2 = 13;
5857
+ var SOLANA_ERROR__FAILED_TO_SIGN_TRANSACTIONS2 = 14;
5858
+ var SOLANA_ERROR__JSON_RPC__PARSE_ERROR2 = -32700;
5859
+ var SOLANA_ERROR__JSON_RPC__INTERNAL_ERROR2 = -32603;
5860
+ var SOLANA_ERROR__JSON_RPC__INVALID_PARAMS2 = -32602;
5861
+ var SOLANA_ERROR__JSON_RPC__METHOD_NOT_FOUND2 = -32601;
5862
+ var SOLANA_ERROR__JSON_RPC__INVALID_REQUEST2 = -32600;
5863
+ var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_NO_SLOT_HISTORY2 = -32021;
5864
+ var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_FILTER_TRANSACTION_NOT_FOUND2 = -32020;
5865
+ var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_LONG_TERM_STORAGE_UNREACHABLE2 = -32019;
5866
+ var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SLOT_NOT_EPOCH_BOUNDARY2 = -32018;
5867
+ var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_EPOCH_REWARDS_PERIOD_ACTIVE2 = -32017;
5868
+ var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED2 = -32016;
5869
+ var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION2 = -32015;
5870
+ var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET2 = -32014;
5871
+ var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH2 = -32013;
5872
+ var SOLANA_ERROR__JSON_RPC__SCAN_ERROR2 = -32012;
5873
+ var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE2 = -32011;
5874
+ var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX2 = -32010;
5875
+ var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED2 = -32009;
5876
+ var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_NO_SNAPSHOT2 = -32008;
5877
+ var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SLOT_SKIPPED2 = -32007;
5878
+ var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE2 = -32006;
5879
+ var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_NODE_UNHEALTHY2 = -32005;
5880
+ var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_NOT_AVAILABLE2 = -32004;
5881
+ var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE2 = -32003;
5882
+ var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE2 = -32002;
5883
+ var SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_CLEANED_UP2 = -32001;
5884
+ var SOLANA_ERROR__ADDRESSES__INVALID_BYTE_LENGTH2 = 28e5;
5885
+ var SOLANA_ERROR__ADDRESSES__STRING_LENGTH_OUT_OF_RANGE2 = 2800001;
5886
+ var SOLANA_ERROR__ADDRESSES__INVALID_BASE58_ENCODED_ADDRESS2 = 2800002;
5887
+ var SOLANA_ERROR__ADDRESSES__INVALID_ED25519_PUBLIC_KEY2 = 2800003;
5888
+ var SOLANA_ERROR__ADDRESSES__MALFORMED_PDA2 = 2800004;
5889
+ var SOLANA_ERROR__ADDRESSES__PDA_BUMP_SEED_OUT_OF_RANGE2 = 2800005;
5890
+ var SOLANA_ERROR__ADDRESSES__MAX_NUMBER_OF_PDA_SEEDS_EXCEEDED2 = 2800006;
5891
+ var SOLANA_ERROR__ADDRESSES__MAX_PDA_SEED_LENGTH_EXCEEDED2 = 2800007;
5892
+ var SOLANA_ERROR__ADDRESSES__INVALID_SEEDS_POINT_ON_CURVE2 = 2800008;
5893
+ var SOLANA_ERROR__ADDRESSES__FAILED_TO_FIND_VIABLE_PDA_BUMP_SEED2 = 2800009;
5894
+ var SOLANA_ERROR__ADDRESSES__PDA_ENDS_WITH_PDA_MARKER2 = 2800010;
5895
+ var SOLANA_ERROR__ADDRESSES__INVALID_OFF_CURVE_ADDRESS2 = 2800011;
5896
+ var SOLANA_ERROR__ACCOUNTS__ACCOUNT_NOT_FOUND2 = 323e4;
5897
+ var SOLANA_ERROR__ACCOUNTS__ONE_OR_MORE_ACCOUNTS_NOT_FOUND2 = 32300001;
5898
+ var SOLANA_ERROR__ACCOUNTS__FAILED_TO_DECODE_ACCOUNT2 = 3230002;
5899
+ var SOLANA_ERROR__ACCOUNTS__EXPECTED_DECODED_ACCOUNT2 = 3230003;
5900
+ var SOLANA_ERROR__ACCOUNTS__EXPECTED_ALL_ACCOUNTS_TO_BE_DECODED2 = 3230004;
5901
+ var SOLANA_ERROR__SUBTLE_CRYPTO__DISALLOWED_IN_INSECURE_CONTEXT2 = 361e4;
5902
+ var SOLANA_ERROR__SUBTLE_CRYPTO__DIGEST_UNIMPLEMENTED2 = 3610001;
5903
+ var SOLANA_ERROR__SUBTLE_CRYPTO__ED25519_ALGORITHM_UNIMPLEMENTED2 = 3610002;
5904
+ var SOLANA_ERROR__SUBTLE_CRYPTO__EXPORT_FUNCTION_UNIMPLEMENTED2 = 3610003;
5905
+ var SOLANA_ERROR__SUBTLE_CRYPTO__GENERATE_FUNCTION_UNIMPLEMENTED2 = 3610004;
5906
+ var SOLANA_ERROR__SUBTLE_CRYPTO__SIGN_FUNCTION_UNIMPLEMENTED2 = 3610005;
5907
+ var SOLANA_ERROR__SUBTLE_CRYPTO__VERIFY_FUNCTION_UNIMPLEMENTED2 = 3610006;
5908
+ var SOLANA_ERROR__SUBTLE_CRYPTO__CANNOT_EXPORT_NON_EXTRACTABLE_KEY2 = 3610007;
5909
+ var SOLANA_ERROR__CRYPTO__RANDOM_VALUES_FUNCTION_UNIMPLEMENTED2 = 3611e3;
5910
+ var SOLANA_ERROR__KEYS__INVALID_KEY_PAIR_BYTE_LENGTH2 = 3704e3;
5911
+ var SOLANA_ERROR__KEYS__INVALID_PRIVATE_KEY_BYTE_LENGTH2 = 3704001;
5912
+ var SOLANA_ERROR__KEYS__INVALID_SIGNATURE_BYTE_LENGTH2 = 3704002;
5913
+ var SOLANA_ERROR__KEYS__SIGNATURE_STRING_LENGTH_OUT_OF_RANGE2 = 3704003;
5914
+ var SOLANA_ERROR__KEYS__PUBLIC_KEY_MUST_MATCH_PRIVATE_KEY2 = 3704004;
5915
+ var SOLANA_ERROR__KEYS__INVALID_BASE58_IN_GRIND_REGEX2 = 3704005;
5916
+ var SOLANA_ERROR__KEYS__WRITE_KEY_PAIR_UNSUPPORTED_ENVIRONMENT2 = 3704006;
5917
+ var SOLANA_ERROR__FS__UNSUPPORTED_ENVIRONMENT2 = 3712e3;
5918
+ var SOLANA_ERROR__INSTRUCTION__EXPECTED_TO_HAVE_ACCOUNTS2 = 4128e3;
5919
+ var SOLANA_ERROR__INSTRUCTION__EXPECTED_TO_HAVE_DATA2 = 4128001;
5920
+ var SOLANA_ERROR__INSTRUCTION__PROGRAM_ID_MISMATCH2 = 4128002;
5921
+ var SOLANA_ERROR__INSTRUCTION_ERROR__UNKNOWN2 = 4615e3;
5922
+ var SOLANA_ERROR__INSTRUCTION_ERROR__GENERIC_ERROR2 = 4615001;
5923
+ var SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_ARGUMENT2 = 4615002;
5924
+ var SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_INSTRUCTION_DATA2 = 4615003;
5925
+ var SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_ACCOUNT_DATA2 = 4615004;
5926
+ var SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_DATA_TOO_SMALL2 = 4615005;
5927
+ var SOLANA_ERROR__INSTRUCTION_ERROR__INSUFFICIENT_FUNDS2 = 4615006;
5928
+ var SOLANA_ERROR__INSTRUCTION_ERROR__INCORRECT_PROGRAM_ID2 = 4615007;
5929
+ var SOLANA_ERROR__INSTRUCTION_ERROR__MISSING_REQUIRED_SIGNATURE2 = 4615008;
5930
+ var SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_ALREADY_INITIALIZED2 = 4615009;
5931
+ var SOLANA_ERROR__INSTRUCTION_ERROR__UNINITIALIZED_ACCOUNT2 = 4615010;
5932
+ var SOLANA_ERROR__INSTRUCTION_ERROR__UNBALANCED_INSTRUCTION2 = 4615011;
5933
+ var SOLANA_ERROR__INSTRUCTION_ERROR__MODIFIED_PROGRAM_ID2 = 4615012;
5934
+ var SOLANA_ERROR__INSTRUCTION_ERROR__EXTERNAL_ACCOUNT_LAMPORT_SPEND2 = 4615013;
5935
+ var SOLANA_ERROR__INSTRUCTION_ERROR__EXTERNAL_ACCOUNT_DATA_MODIFIED2 = 4615014;
5936
+ var SOLANA_ERROR__INSTRUCTION_ERROR__READONLY_LAMPORT_CHANGE2 = 4615015;
5937
+ var SOLANA_ERROR__INSTRUCTION_ERROR__READONLY_DATA_MODIFIED2 = 4615016;
5938
+ var SOLANA_ERROR__INSTRUCTION_ERROR__DUPLICATE_ACCOUNT_INDEX2 = 4615017;
5939
+ var SOLANA_ERROR__INSTRUCTION_ERROR__EXECUTABLE_MODIFIED2 = 4615018;
5940
+ var SOLANA_ERROR__INSTRUCTION_ERROR__RENT_EPOCH_MODIFIED2 = 4615019;
5941
+ var SOLANA_ERROR__INSTRUCTION_ERROR__NOT_ENOUGH_ACCOUNT_KEYS2 = 4615020;
5942
+ var SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_DATA_SIZE_CHANGED2 = 4615021;
5943
+ var SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_NOT_EXECUTABLE2 = 4615022;
5944
+ var SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_BORROW_FAILED2 = 4615023;
5945
+ var SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_BORROW_OUTSTANDING2 = 4615024;
5946
+ var SOLANA_ERROR__INSTRUCTION_ERROR__DUPLICATE_ACCOUNT_OUT_OF_SYNC2 = 4615025;
5947
+ var SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM2 = 4615026;
5948
+ var SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_ERROR2 = 4615027;
5949
+ var SOLANA_ERROR__INSTRUCTION_ERROR__EXECUTABLE_DATA_MODIFIED2 = 4615028;
5950
+ var SOLANA_ERROR__INSTRUCTION_ERROR__EXECUTABLE_LAMPORT_CHANGE2 = 4615029;
5951
+ var SOLANA_ERROR__INSTRUCTION_ERROR__EXECUTABLE_ACCOUNT_NOT_RENT_EXEMPT2 = 4615030;
5952
+ var SOLANA_ERROR__INSTRUCTION_ERROR__UNSUPPORTED_PROGRAM_ID2 = 4615031;
5953
+ var SOLANA_ERROR__INSTRUCTION_ERROR__CALL_DEPTH2 = 4615032;
5954
+ var SOLANA_ERROR__INSTRUCTION_ERROR__MISSING_ACCOUNT2 = 4615033;
5955
+ var SOLANA_ERROR__INSTRUCTION_ERROR__REENTRANCY_NOT_ALLOWED2 = 4615034;
5956
+ var SOLANA_ERROR__INSTRUCTION_ERROR__MAX_SEED_LENGTH_EXCEEDED2 = 4615035;
5957
+ var SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_SEEDS2 = 4615036;
5958
+ var SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_REALLOC2 = 4615037;
5959
+ var SOLANA_ERROR__INSTRUCTION_ERROR__COMPUTATIONAL_BUDGET_EXCEEDED2 = 4615038;
5960
+ var SOLANA_ERROR__INSTRUCTION_ERROR__PRIVILEGE_ESCALATION2 = 4615039;
5961
+ var SOLANA_ERROR__INSTRUCTION_ERROR__PROGRAM_ENVIRONMENT_SETUP_FAILURE2 = 4615040;
5962
+ var SOLANA_ERROR__INSTRUCTION_ERROR__PROGRAM_FAILED_TO_COMPLETE2 = 4615041;
5963
+ var SOLANA_ERROR__INSTRUCTION_ERROR__PROGRAM_FAILED_TO_COMPILE2 = 4615042;
5964
+ var SOLANA_ERROR__INSTRUCTION_ERROR__IMMUTABLE2 = 4615043;
5965
+ var SOLANA_ERROR__INSTRUCTION_ERROR__INCORRECT_AUTHORITY2 = 4615044;
5966
+ var SOLANA_ERROR__INSTRUCTION_ERROR__BORSH_IO_ERROR2 = 4615045;
5967
+ var SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_NOT_RENT_EXEMPT2 = 4615046;
5968
+ var SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_ACCOUNT_OWNER2 = 4615047;
5969
+ var SOLANA_ERROR__INSTRUCTION_ERROR__ARITHMETIC_OVERFLOW2 = 4615048;
5970
+ var SOLANA_ERROR__INSTRUCTION_ERROR__UNSUPPORTED_SYSVAR2 = 4615049;
5971
+ var SOLANA_ERROR__INSTRUCTION_ERROR__ILLEGAL_OWNER2 = 4615050;
5972
+ var SOLANA_ERROR__INSTRUCTION_ERROR__MAX_ACCOUNTS_DATA_ALLOCATIONS_EXCEEDED2 = 4615051;
5973
+ var SOLANA_ERROR__INSTRUCTION_ERROR__MAX_ACCOUNTS_EXCEEDED2 = 4615052;
5974
+ var SOLANA_ERROR__INSTRUCTION_ERROR__MAX_INSTRUCTION_TRACE_LENGTH_EXCEEDED2 = 4615053;
5975
+ var SOLANA_ERROR__INSTRUCTION_ERROR__BUILTIN_PROGRAMS_MUST_CONSUME_COMPUTE_UNITS2 = 4615054;
5976
+ var SOLANA_ERROR__SIGNER__ADDRESS_CANNOT_HAVE_MULTIPLE_SIGNERS2 = 5508e3;
5977
+ var SOLANA_ERROR__SIGNER__EXPECTED_KEY_PAIR_SIGNER2 = 5508001;
5978
+ var SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_SIGNER2 = 5508002;
5979
+ var SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_MODIFYING_SIGNER2 = 5508003;
5980
+ var SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_PARTIAL_SIGNER2 = 5508004;
5981
+ var SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_SIGNER2 = 5508005;
5982
+ var SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_MODIFYING_SIGNER2 = 5508006;
5983
+ var SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_PARTIAL_SIGNER2 = 5508007;
5984
+ var SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_SENDING_SIGNER2 = 5508008;
5985
+ var SOLANA_ERROR__SIGNER__TRANSACTION_CANNOT_HAVE_MULTIPLE_SENDING_SIGNERS2 = 5508009;
5986
+ var SOLANA_ERROR__SIGNER__TRANSACTION_SENDING_SIGNER_MISSING2 = 5508010;
5987
+ var SOLANA_ERROR__SIGNER__WALLET_MULTISIGN_UNIMPLEMENTED2 = 5508011;
5988
+ var SOLANA_ERROR__SIGNER__WALLET_ACCOUNT_CANNOT_SIGN_TRANSACTION2 = 5508012;
5989
+ var SOLANA_ERROR__OFFCHAIN_MESSAGE__MAXIMUM_LENGTH_EXCEEDED2 = 5607e3;
5990
+ var SOLANA_ERROR__OFFCHAIN_MESSAGE__RESTRICTED_ASCII_BODY_CHARACTER_OUT_OF_RANGE2 = 5607001;
5991
+ var SOLANA_ERROR__OFFCHAIN_MESSAGE__APPLICATION_DOMAIN_STRING_LENGTH_OUT_OF_RANGE2 = 5607002;
5992
+ var SOLANA_ERROR__OFFCHAIN_MESSAGE__INVALID_APPLICATION_DOMAIN_BYTE_LENGTH2 = 5607003;
5993
+ var SOLANA_ERROR__OFFCHAIN_MESSAGE__NUM_SIGNATURES_MISMATCH2 = 5607004;
5994
+ var SOLANA_ERROR__OFFCHAIN_MESSAGE__NUM_REQUIRED_SIGNERS_CANNOT_BE_ZERO2 = 5607005;
5995
+ var SOLANA_ERROR__OFFCHAIN_MESSAGE__VERSION_NUMBER_NOT_SUPPORTED2 = 5607006;
5996
+ var SOLANA_ERROR__OFFCHAIN_MESSAGE__MESSAGE_FORMAT_MISMATCH2 = 5607007;
5997
+ var SOLANA_ERROR__OFFCHAIN_MESSAGE__MESSAGE_LENGTH_MISMATCH2 = 5607008;
5998
+ var SOLANA_ERROR__OFFCHAIN_MESSAGE__MESSAGE_MUST_BE_NON_EMPTY2 = 5607009;
5999
+ var SOLANA_ERROR__OFFCHAIN_MESSAGE__NUM_ENVELOPE_SIGNATURES_CANNOT_BE_ZERO2 = 5607010;
6000
+ var SOLANA_ERROR__OFFCHAIN_MESSAGE__SIGNATURES_MISSING2 = 5607011;
6001
+ var SOLANA_ERROR__OFFCHAIN_MESSAGE__ENVELOPE_SIGNERS_MISMATCH2 = 5607012;
6002
+ var SOLANA_ERROR__OFFCHAIN_MESSAGE__ADDRESSES_CANNOT_SIGN_OFFCHAIN_MESSAGE2 = 5607013;
6003
+ var SOLANA_ERROR__OFFCHAIN_MESSAGE__UNEXPECTED_VERSION2 = 5607014;
6004
+ var SOLANA_ERROR__OFFCHAIN_MESSAGE__SIGNATORIES_MUST_BE_SORTED2 = 5607015;
6005
+ var SOLANA_ERROR__OFFCHAIN_MESSAGE__SIGNATORIES_MUST_BE_UNIQUE2 = 5607016;
6006
+ var SOLANA_ERROR__OFFCHAIN_MESSAGE__SIGNATURE_VERIFICATION_FAILURE2 = 5607017;
6007
+ var SOLANA_ERROR__OFFCHAIN_MESSAGE__CONTENT_DOES_NOT_MATCH_EXPECTED2 = 5607018;
6008
+ var SOLANA_ERROR__OFFCHAIN_MESSAGE__REQUIRED_SIGNATORIES_DO_NOT_MATCH_EXPECTED2 = 5607019;
6009
+ var SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_CANNOT_PAY_FEES2 = 5663e3;
6010
+ var SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_MUST_NOT_BE_WRITABLE2 = 5663001;
6011
+ var SOLANA_ERROR__TRANSACTION__EXPECTED_BLOCKHASH_LIFETIME2 = 5663002;
6012
+ var SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME2 = 5663003;
6013
+ var SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_OUT_OF_RANGE2 = 5663004;
6014
+ var SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_ADDRESS_LOOKUP_TABLE_CONTENTS_MISSING2 = 5663005;
6015
+ var SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_ADDRESS_LOOKUP_TABLE_INDEX_OUT_OF_RANGE2 = 5663006;
6016
+ var SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_INSTRUCTION_PROGRAM_ADDRESS_NOT_FOUND2 = 5663007;
6017
+ var SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_FEE_PAYER_MISSING2 = 5663008;
6018
+ var SOLANA_ERROR__TRANSACTION__SIGNATURES_MISSING2 = 5663009;
6019
+ var SOLANA_ERROR__TRANSACTION__ADDRESS_MISSING2 = 5663010;
6020
+ var SOLANA_ERROR__TRANSACTION__FEE_PAYER_MISSING2 = 5663011;
6021
+ var SOLANA_ERROR__TRANSACTION__FEE_PAYER_SIGNATURE_MISSING2 = 5663012;
6022
+ var SOLANA_ERROR__TRANSACTION__INVALID_NONCE_TRANSACTION_INSTRUCTIONS_MISSING2 = 5663013;
6023
+ var SOLANA_ERROR__TRANSACTION__INVALID_NONCE_TRANSACTION_FIRST_INSTRUCTION_MUST_BE_ADVANCE_NONCE2 = 5663014;
6024
+ var SOLANA_ERROR__TRANSACTION__ADDRESSES_CANNOT_SIGN_TRANSACTION2 = 5663015;
6025
+ var SOLANA_ERROR__TRANSACTION__CANNOT_ENCODE_WITH_EMPTY_SIGNATURES2 = 5663016;
6026
+ var SOLANA_ERROR__TRANSACTION__MESSAGE_SIGNATURES_MISMATCH2 = 5663017;
6027
+ var SOLANA_ERROR__TRANSACTION__FAILED_TO_ESTIMATE_COMPUTE_LIMIT2 = 5663018;
6028
+ var SOLANA_ERROR__TRANSACTION__FAILED_WHEN_SIMULATING_TO_ESTIMATE_COMPUTE_LIMIT2 = 5663019;
6029
+ var SOLANA_ERROR__TRANSACTION__EXCEEDS_SIZE_LIMIT2 = 5663020;
6030
+ var SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_NOT_SUPPORTED2 = 5663021;
6031
+ var SOLANA_ERROR__TRANSACTION__NONCE_ACCOUNT_CANNOT_BE_IN_LOOKUP_TABLE2 = 5663022;
6032
+ var SOLANA_ERROR__TRANSACTION__MALFORMED_MESSAGE_BYTES2 = 5663023;
6033
+ var SOLANA_ERROR__TRANSACTION__CANNOT_ENCODE_WITH_EMPTY_MESSAGE_BYTES2 = 5663024;
6034
+ var SOLANA_ERROR__TRANSACTION__CANNOT_DECODE_EMPTY_TRANSACTION_BYTES2 = 5663025;
6035
+ var SOLANA_ERROR__TRANSACTION__VERSION_ZERO_MUST_BE_ENCODED_WITH_SIGNATURES_FIRST2 = 5663026;
6036
+ var SOLANA_ERROR__TRANSACTION__SIGNATURE_COUNT_TOO_HIGH_FOR_TRANSACTION_BYTES2 = 5663027;
6037
+ var SOLANA_ERROR__TRANSACTION__INVALID_CONFIG_MASK_PRIORITY_FEE_BITS2 = 5663028;
6038
+ var SOLANA_ERROR__TRANSACTION__INVALID_NONCE_ACCOUNT_INDEX2 = 5663029;
6039
+ var SOLANA_ERROR__TRANSACTION__INVALID_CONFIG_VALUE_KIND2 = 5663030;
6040
+ var SOLANA_ERROR__TRANSACTION__INSTRUCTION_HEADERS_PAYLOADS_MISMATCH2 = 5663031;
6041
+ var SOLANA_ERROR__TRANSACTION__TOO_MANY_SIGNER_ADDRESSES2 = 5663032;
6042
+ var SOLANA_ERROR__TRANSACTION__TOO_MANY_ACCOUNT_ADDRESSES2 = 5663033;
6043
+ var SOLANA_ERROR__TRANSACTION__TOO_MANY_INSTRUCTIONS2 = 5663034;
6044
+ var SOLANA_ERROR__TRANSACTION__TOO_MANY_ACCOUNTS_IN_INSTRUCTION2 = 5663035;
6045
+ var SOLANA_ERROR__TRANSACTION__FAILED_TO_ESTIMATE_LOADED_ACCOUNTS_DATA_SIZE_LIMIT2 = 5663036;
6046
+ var SOLANA_ERROR__TRANSACTION__FAILED_WHEN_SIMULATING_TO_ESTIMATE_RESOURCE_LIMITS2 = 5663037;
6047
+ var SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_INSTRUCTION_ACCOUNT_INDEX_OUT_OF_RANGE2 = 5663038;
6048
+ var SOLANA_ERROR__TRANSACTION__COMPUTE_UNIT_LIMIT_OUT_OF_RANGE2 = 5663039;
6049
+ var SOLANA_ERROR__TRANSACTION__INVALID_HEAP_SIZE2 = 5663040;
6050
+ var SOLANA_ERROR__TRANSACTION_INTROSPECTION__CANNOT_DECODE_JSON_PARSED_TRANSACTION2 = 5664e3;
6051
+ var SOLANA_ERROR__TRANSACTION_INTROSPECTION__UNRECOGNIZED_GET_TRANSACTION_RESPONSE2 = 5664001;
6052
+ var SOLANA_ERROR__TRANSACTION_ERROR__UNKNOWN2 = 705e4;
6053
+ var SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_IN_USE2 = 7050001;
6054
+ var SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_LOADED_TWICE2 = 7050002;
6055
+ var SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_NOT_FOUND2 = 7050003;
6056
+ var SOLANA_ERROR__TRANSACTION_ERROR__PROGRAM_ACCOUNT_NOT_FOUND2 = 7050004;
6057
+ var SOLANA_ERROR__TRANSACTION_ERROR__INSUFFICIENT_FUNDS_FOR_FEE2 = 7050005;
6058
+ var SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ACCOUNT_FOR_FEE2 = 7050006;
6059
+ var SOLANA_ERROR__TRANSACTION_ERROR__ALREADY_PROCESSED2 = 7050007;
6060
+ var SOLANA_ERROR__TRANSACTION_ERROR__BLOCKHASH_NOT_FOUND2 = 7050008;
6061
+ var SOLANA_ERROR__TRANSACTION_ERROR__CALL_CHAIN_TOO_DEEP2 = 7050009;
6062
+ var SOLANA_ERROR__TRANSACTION_ERROR__MISSING_SIGNATURE_FOR_FEE2 = 7050010;
6063
+ var SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ACCOUNT_INDEX2 = 7050011;
6064
+ var SOLANA_ERROR__TRANSACTION_ERROR__SIGNATURE_FAILURE2 = 7050012;
6065
+ var SOLANA_ERROR__TRANSACTION_ERROR__INVALID_PROGRAM_FOR_EXECUTION2 = 7050013;
6066
+ var SOLANA_ERROR__TRANSACTION_ERROR__SANITIZE_FAILURE2 = 7050014;
6067
+ var SOLANA_ERROR__TRANSACTION_ERROR__CLUSTER_MAINTENANCE2 = 7050015;
6068
+ var SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_BORROW_OUTSTANDING2 = 7050016;
6069
+ var SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_MAX_BLOCK_COST_LIMIT2 = 7050017;
6070
+ var SOLANA_ERROR__TRANSACTION_ERROR__UNSUPPORTED_VERSION2 = 7050018;
6071
+ var SOLANA_ERROR__TRANSACTION_ERROR__INVALID_WRITABLE_ACCOUNT2 = 7050019;
6072
+ var SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_MAX_ACCOUNT_COST_LIMIT2 = 7050020;
6073
+ var SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_ACCOUNT_DATA_BLOCK_LIMIT2 = 7050021;
6074
+ var SOLANA_ERROR__TRANSACTION_ERROR__TOO_MANY_ACCOUNT_LOCKS2 = 7050022;
6075
+ var SOLANA_ERROR__TRANSACTION_ERROR__ADDRESS_LOOKUP_TABLE_NOT_FOUND2 = 7050023;
6076
+ var SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ADDRESS_LOOKUP_TABLE_OWNER2 = 7050024;
6077
+ var SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ADDRESS_LOOKUP_TABLE_DATA2 = 7050025;
6078
+ var SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ADDRESS_LOOKUP_TABLE_INDEX2 = 7050026;
6079
+ var SOLANA_ERROR__TRANSACTION_ERROR__INVALID_RENT_PAYING_ACCOUNT2 = 7050027;
6080
+ var SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_MAX_VOTE_COST_LIMIT2 = 7050028;
6081
+ var SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_ACCOUNT_DATA_TOTAL_LIMIT2 = 7050029;
6082
+ var SOLANA_ERROR__TRANSACTION_ERROR__DUPLICATE_INSTRUCTION2 = 7050030;
6083
+ var SOLANA_ERROR__TRANSACTION_ERROR__INSUFFICIENT_FUNDS_FOR_RENT2 = 7050031;
6084
+ var SOLANA_ERROR__TRANSACTION_ERROR__MAX_LOADED_ACCOUNTS_DATA_SIZE_EXCEEDED2 = 7050032;
6085
+ var SOLANA_ERROR__TRANSACTION_ERROR__INVALID_LOADED_ACCOUNTS_DATA_SIZE_LIMIT2 = 7050033;
6086
+ var SOLANA_ERROR__TRANSACTION_ERROR__RESANITIZATION_NEEDED2 = 7050034;
6087
+ var SOLANA_ERROR__TRANSACTION_ERROR__PROGRAM_EXECUTION_TEMPORARILY_RESTRICTED2 = 7050035;
6088
+ var SOLANA_ERROR__TRANSACTION_ERROR__UNBALANCED_TRANSACTION2 = 7050036;
6089
+ var SOLANA_ERROR__INSTRUCTION_PLANS__MESSAGE_CANNOT_ACCOMMODATE_PLAN2 = 7618e3;
6090
+ var SOLANA_ERROR__INSTRUCTION_PLANS__MESSAGE_PACKER_ALREADY_COMPLETE2 = 7618001;
6091
+ var SOLANA_ERROR__INSTRUCTION_PLANS__EMPTY_INSTRUCTION_PLAN2 = 7618002;
6092
+ var SOLANA_ERROR__INSTRUCTION_PLANS__FAILED_TO_EXECUTE_TRANSACTION_PLAN2 = 7618003;
6093
+ var SOLANA_ERROR__INSTRUCTION_PLANS__NON_DIVISIBLE_TRANSACTION_PLANS_NOT_SUPPORTED2 = 7618004;
6094
+ var SOLANA_ERROR__INSTRUCTION_PLANS__FAILED_SINGLE_TRANSACTION_PLAN_RESULT_NOT_FOUND2 = 7618005;
6095
+ var SOLANA_ERROR__INSTRUCTION_PLANS__UNEXPECTED_INSTRUCTION_PLAN2 = 7618006;
6096
+ var SOLANA_ERROR__INSTRUCTION_PLANS__UNEXPECTED_TRANSACTION_PLAN2 = 7618007;
6097
+ var SOLANA_ERROR__INSTRUCTION_PLANS__UNEXPECTED_TRANSACTION_PLAN_RESULT2 = 7618008;
6098
+ var SOLANA_ERROR__INSTRUCTION_PLANS__EXPECTED_SUCCESSFUL_TRANSACTION_PLAN_RESULT2 = 7618009;
6099
+ var SOLANA_ERROR__INSTRUCTION_PLANS__MAX_INSTRUCTIONS_PER_TRANSACTION_EXCEEDED2 = 7618010;
6100
+ var SOLANA_ERROR__INSTRUCTION_PLANS__INVALID_MAX_INSTRUCTIONS_PER_TRANSACTION2 = 7618011;
6101
+ var SOLANA_ERROR__INSTRUCTION_PLANS__MESSAGE_REJECTED_BY_PACKER2 = 7618012;
6102
+ var SOLANA_ERROR__CODECS__CANNOT_DECODE_EMPTY_BYTE_ARRAY2 = 8078e3;
6103
+ var SOLANA_ERROR__CODECS__INVALID_BYTE_LENGTH2 = 8078001;
6104
+ var SOLANA_ERROR__CODECS__EXPECTED_FIXED_LENGTH2 = 8078002;
6105
+ var SOLANA_ERROR__CODECS__EXPECTED_VARIABLE_LENGTH2 = 8078003;
6106
+ var SOLANA_ERROR__CODECS__ENCODER_DECODER_SIZE_COMPATIBILITY_MISMATCH2 = 8078004;
6107
+ var SOLANA_ERROR__CODECS__ENCODER_DECODER_FIXED_SIZE_MISMATCH2 = 8078005;
6108
+ var SOLANA_ERROR__CODECS__ENCODER_DECODER_MAX_SIZE_MISMATCH2 = 8078006;
6109
+ var SOLANA_ERROR__CODECS__INVALID_NUMBER_OF_ITEMS2 = 8078007;
6110
+ var SOLANA_ERROR__CODECS__ENUM_DISCRIMINATOR_OUT_OF_RANGE2 = 8078008;
6111
+ var SOLANA_ERROR__CODECS__INVALID_DISCRIMINATED_UNION_VARIANT2 = 8078009;
6112
+ var SOLANA_ERROR__CODECS__INVALID_ENUM_VARIANT2 = 8078010;
6113
+ var SOLANA_ERROR__CODECS__NUMBER_OUT_OF_RANGE2 = 8078011;
6114
+ var SOLANA_ERROR__CODECS__INVALID_STRING_FOR_BASE2 = 8078012;
6115
+ var SOLANA_ERROR__CODECS__EXPECTED_POSITIVE_BYTE_LENGTH2 = 8078013;
6116
+ var SOLANA_ERROR__CODECS__OFFSET_OUT_OF_RANGE2 = 8078014;
6117
+ var SOLANA_ERROR__CODECS__INVALID_LITERAL_UNION_VARIANT2 = 8078015;
6118
+ var SOLANA_ERROR__CODECS__LITERAL_UNION_DISCRIMINATOR_OUT_OF_RANGE2 = 8078016;
6119
+ var SOLANA_ERROR__CODECS__UNION_VARIANT_OUT_OF_RANGE2 = 8078017;
6120
+ var SOLANA_ERROR__CODECS__INVALID_CONSTANT2 = 8078018;
6121
+ var SOLANA_ERROR__CODECS__EXPECTED_ZERO_VALUE_TO_MATCH_ITEM_FIXED_SIZE2 = 8078019;
6122
+ var SOLANA_ERROR__CODECS__ENCODED_BYTES_MUST_NOT_INCLUDE_SENTINEL2 = 8078020;
6123
+ var SOLANA_ERROR__CODECS__SENTINEL_MISSING_IN_DECODED_BYTES2 = 8078021;
6124
+ var SOLANA_ERROR__CODECS__CANNOT_USE_LEXICAL_VALUES_AS_ENUM_DISCRIMINATORS2 = 8078022;
6125
+ var SOLANA_ERROR__CODECS__EXPECTED_DECODER_TO_CONSUME_ENTIRE_BYTE_ARRAY2 = 8078023;
6126
+ var SOLANA_ERROR__CODECS__INVALID_PATTERN_MATCH_VALUE2 = 8078024;
6127
+ var SOLANA_ERROR__CODECS__INVALID_PATTERN_MATCH_BYTES2 = 8078025;
6128
+ var SOLANA_ERROR__CODECS__INVALID_UTF8_BYTES2 = 8078026;
6129
+ var SOLANA_ERROR__CODECS__INVALID_UTF8_STRING2 = 8078027;
6130
+ var SOLANA_ERROR__CODECS__SENTINEL_MISSING_AT_END_OF_BYTES2 = 8078028;
6131
+ var SOLANA_ERROR__CODECS__SENTINEL_MUST_NOT_BE_EMPTY2 = 8078029;
6132
+ var SOLANA_ERROR__FIXED_POINTS__INVALID_TOTAL_BITS2 = 809e4;
6133
+ var SOLANA_ERROR__FIXED_POINTS__INVALID_FRACTIONAL_BITS2 = 8090001;
6134
+ var SOLANA_ERROR__FIXED_POINTS__INVALID_DECIMALS2 = 8090002;
6135
+ var SOLANA_ERROR__FIXED_POINTS__FRACTIONAL_BITS_EXCEED_TOTAL_BITS2 = 8090003;
6136
+ var SOLANA_ERROR__FIXED_POINTS__VALUE_OUT_OF_RANGE2 = 8090004;
6137
+ var SOLANA_ERROR__FIXED_POINTS__INVALID_STRING2 = 8090005;
6138
+ var SOLANA_ERROR__FIXED_POINTS__INVALID_ZERO_DENOMINATOR_RATIO2 = 8090006;
6139
+ var SOLANA_ERROR__FIXED_POINTS__ARITHMETIC_OVERFLOW2 = 8090007;
6140
+ var SOLANA_ERROR__FIXED_POINTS__SHAPE_MISMATCH2 = 8090008;
6141
+ var SOLANA_ERROR__FIXED_POINTS__DIVISION_BY_ZERO2 = 8090009;
6142
+ var SOLANA_ERROR__FIXED_POINTS__STRICT_MODE_PRECISION_LOSS2 = 8090010;
6143
+ var SOLANA_ERROR__FIXED_POINTS__MALFORMED_RAW_VALUE2 = 8090011;
6144
+ var SOLANA_ERROR__FIXED_POINTS__TOTAL_BITS_NOT_BYTE_ALIGNED2 = 8090012;
6145
+ var SOLANA_ERROR__RPC__INTEGER_OVERFLOW2 = 81e5;
6146
+ var SOLANA_ERROR__RPC__TRANSPORT_HTTP_HEADER_FORBIDDEN2 = 8100001;
6147
+ var SOLANA_ERROR__RPC__TRANSPORT_HTTP_ERROR2 = 8100002;
6148
+ var SOLANA_ERROR__RPC__API_PLAN_MISSING_FOR_RPC_METHOD2 = 8100003;
6149
+ var SOLANA_ERROR__RPC_SUBSCRIPTIONS__CANNOT_CREATE_SUBSCRIPTION_PLAN2 = 819e4;
6150
+ var SOLANA_ERROR__RPC_SUBSCRIPTIONS__EXPECTED_SERVER_SUBSCRIPTION_ID2 = 8190001;
6151
+ var SOLANA_ERROR__RPC_SUBSCRIPTIONS__CHANNEL_CLOSED_BEFORE_MESSAGE_BUFFERED2 = 8190002;
6152
+ var SOLANA_ERROR__RPC_SUBSCRIPTIONS__CHANNEL_CONNECTION_CLOSED2 = 8190003;
6153
+ var SOLANA_ERROR__RPC_SUBSCRIPTIONS__CHANNEL_FAILED_TO_CONNECT2 = 8190004;
6154
+ var SOLANA_ERROR__SUBSCRIBABLE__RETRY_NOT_SUPPORTED2 = 8195e3;
6155
+ var SOLANA_ERROR__SUBSCRIBABLE__STREAM_CLOSED_WITHOUT_ERROR2 = 8195001;
6156
+ var SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS2 = 85e5;
6157
+ var SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE2 = 8500001;
6158
+ var SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION2 = 8500002;
6159
+ var SOLANA_ERROR__PROGRAM_CLIENTS__UNEXPECTED_RESOLVED_INSTRUCTION_INPUT_TYPE2 = 8500003;
6160
+ var SOLANA_ERROR__PROGRAM_CLIENTS__RESOLVED_INSTRUCTION_INPUT_MUST_BE_NON_NULL2 = 8500004;
6161
+ var SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_ACCOUNT_TYPE2 = 8500005;
6162
+ var SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT2 = 8500006;
6163
+ var SOLANA_ERROR__PROGRAM_CLIENTS__RESOLVED_INSTRUCTION_INPUT_MUST_BE_SIGNER2 = 8500007;
6164
+ var SOLANA_ERROR__WALLET__NOT_CONNECTED2 = 89e5;
6165
+ var SOLANA_ERROR__WALLET__NO_SIGNER_CONNECTED2 = 8900001;
6166
+ var SOLANA_ERROR__WALLET__SIGNER_NOT_AVAILABLE2 = 8900002;
6167
+ var SOLANA_ERROR__WALLET__ACCOUNT_NOT_AVAILABLE2 = 8900003;
6168
+ var SOLANA_ERROR__REACT__MISSING_PROVIDER2 = 9e6;
6169
+ var SOLANA_ERROR__REACT__MISSING_CAPABILITY2 = 9000001;
6170
+ var SOLANA_ERROR__REACT__SUBSCRIPTION_CLOSED_WITHOUT_ERROR2 = 9000002;
6171
+ var SOLANA_ERROR__INVARIANT_VIOLATION__SUBSCRIPTION_ITERATOR_STATE_MISSING2 = 99e5;
6172
+ var SOLANA_ERROR__INVARIANT_VIOLATION__SUBSCRIPTION_ITERATOR_MUST_NOT_POLL_BEFORE_RESOLVING_EXISTING_MESSAGE_PROMISE2 = 9900001;
6173
+ var SOLANA_ERROR__INVARIANT_VIOLATION__CACHED_ABORTABLE_ITERABLE_CACHE_ENTRY_MISSING2 = 9900002;
6174
+ var SOLANA_ERROR__INVARIANT_VIOLATION__SWITCH_MUST_BE_EXHAUSTIVE2 = 9900003;
6175
+ var SOLANA_ERROR__INVARIANT_VIOLATION__DATA_PUBLISHER_CHANNEL_UNIMPLEMENTED2 = 9900004;
6176
+ var SOLANA_ERROR__INVARIANT_VIOLATION__INVALID_INSTRUCTION_PLAN_KIND2 = 9900005;
6177
+ var SOLANA_ERROR__INVARIANT_VIOLATION__INVALID_TRANSACTION_PLAN_KIND2 = 9900006;
6178
+ function encodeValue2(value) {
6179
+ if (Array.isArray(value)) {
6180
+ const commaSeparatedValues = value.map(encodeValue2).join(
6181
+ "%2C%20"
6182
+ /* ", " */
6183
+ );
6184
+ return "%5B" + commaSeparatedValues + /* "]" */
6185
+ "%5D";
6186
+ } else if (typeof value === "bigint") {
6187
+ return `${value}n`;
6188
+ } else {
6189
+ return encodeURIComponent(
6190
+ String(
6191
+ value != null && Object.getPrototypeOf(value) === null ? (
6192
+ // Plain objects with no prototype don't have a `toString` method.
6193
+ // Convert them before stringifying them.
6194
+ { ...value }
6195
+ ) : value
6196
+ )
6197
+ );
6198
+ }
6199
+ }
6200
+ function encodeObjectContextEntry2([key, value]) {
6201
+ return `${key}=${encodeValue2(value)}`;
6202
+ }
6203
+ function encodeContextObject2(context) {
6204
+ const searchParamsString = Object.entries(context).map(encodeObjectContextEntry2).join("&");
6205
+ return Buffer.from(searchParamsString, "utf8").toString("base64");
6206
+ }
6207
+ var SolanaErrorMessages2 = {
6208
+ [SOLANA_ERROR__ACCOUNTS__ACCOUNT_NOT_FOUND2]: "Account not found at address: $address",
6209
+ [SOLANA_ERROR__ACCOUNTS__EXPECTED_ALL_ACCOUNTS_TO_BE_DECODED2]: "Not all accounts were decoded. Encoded accounts found at addresses: $addresses.",
6210
+ [SOLANA_ERROR__ACCOUNTS__EXPECTED_DECODED_ACCOUNT2]: "Expected decoded account at address: $address",
6211
+ [SOLANA_ERROR__ACCOUNTS__FAILED_TO_DECODE_ACCOUNT2]: "Failed to decode account data at address: $address",
6212
+ [SOLANA_ERROR__ACCOUNTS__ONE_OR_MORE_ACCOUNTS_NOT_FOUND2]: "Accounts not found at addresses: $addresses",
6213
+ [SOLANA_ERROR__ADDRESSES__FAILED_TO_FIND_VIABLE_PDA_BUMP_SEED2]: "Unable to find a viable program address bump seed.",
6214
+ [SOLANA_ERROR__ADDRESSES__INVALID_BASE58_ENCODED_ADDRESS2]: "$putativeAddress is not a base58-encoded address.",
6215
+ [SOLANA_ERROR__ADDRESSES__INVALID_BYTE_LENGTH2]: "Expected base58 encoded address to decode to a byte array of length 32. Actual length: $actualLength.",
6216
+ [SOLANA_ERROR__ADDRESSES__INVALID_ED25519_PUBLIC_KEY2]: "The `CryptoKey` must be an `Ed25519` public key.",
6217
+ [SOLANA_ERROR__ADDRESSES__INVALID_OFF_CURVE_ADDRESS2]: "$putativeOffCurveAddress is not a base58-encoded off-curve address.",
6218
+ [SOLANA_ERROR__ADDRESSES__INVALID_SEEDS_POINT_ON_CURVE2]: "Invalid seeds; point must fall off the Ed25519 curve.",
6219
+ [SOLANA_ERROR__ADDRESSES__MALFORMED_PDA2]: "Expected given program derived address to have the following format: [Address, ProgramDerivedAddressBump].",
6220
+ [SOLANA_ERROR__ADDRESSES__MAX_NUMBER_OF_PDA_SEEDS_EXCEEDED2]: "A maximum of $maxSeeds seeds, including the bump seed, may be supplied when creating an address. Received: $actual.",
6221
+ [SOLANA_ERROR__ADDRESSES__MAX_PDA_SEED_LENGTH_EXCEEDED2]: "The seed at index $index with length $actual exceeds the maximum length of $maxSeedLength bytes.",
6222
+ [SOLANA_ERROR__ADDRESSES__PDA_BUMP_SEED_OUT_OF_RANGE2]: "Expected program derived address bump to be in the range [0, 255], got: $bump.",
6223
+ [SOLANA_ERROR__ADDRESSES__PDA_ENDS_WITH_PDA_MARKER2]: "Program address cannot end with PDA marker.",
6224
+ [SOLANA_ERROR__ADDRESSES__STRING_LENGTH_OUT_OF_RANGE2]: "Expected base58-encoded address string of length in the range [32, 44]. Actual length: $actualLength.",
6225
+ [SOLANA_ERROR__BLOCKHASH_STRING_LENGTH_OUT_OF_RANGE2]: "Expected base58-encoded blockhash string of length in the range [32, 44]. Actual length: $actualLength.",
6226
+ [SOLANA_ERROR__BLOCK_HEIGHT_EXCEEDED2]: "The network has progressed past the last block for which this transaction could have been committed.",
6227
+ [SOLANA_ERROR__CODECS__CANNOT_DECODE_EMPTY_BYTE_ARRAY2]: "Codec [$codecDescription] cannot decode empty byte arrays.",
6228
+ [SOLANA_ERROR__CODECS__CANNOT_USE_LEXICAL_VALUES_AS_ENUM_DISCRIMINATORS2]: "Enum codec cannot use lexical values [$stringValues] as discriminators. Either remove all lexical values or set `useValuesAsDiscriminators` to `false`.",
6229
+ [SOLANA_ERROR__CODECS__ENCODED_BYTES_MUST_NOT_INCLUDE_SENTINEL2]: "Sentinel [$hexSentinel] must not be present in encoded bytes [$hexEncodedBytes].",
6230
+ [SOLANA_ERROR__CODECS__ENCODER_DECODER_FIXED_SIZE_MISMATCH2]: "Encoder and decoder must have the same fixed size, got [$encoderFixedSize] and [$decoderFixedSize].",
6231
+ [SOLANA_ERROR__CODECS__ENCODER_DECODER_MAX_SIZE_MISMATCH2]: "Encoder and decoder must have the same max size, got [$encoderMaxSize] and [$decoderMaxSize].",
6232
+ [SOLANA_ERROR__CODECS__ENCODER_DECODER_SIZE_COMPATIBILITY_MISMATCH2]: "Encoder and decoder must either both be fixed-size or variable-size.",
6233
+ [SOLANA_ERROR__CODECS__ENUM_DISCRIMINATOR_OUT_OF_RANGE2]: "Enum discriminator out of range. Expected a number in [$formattedValidDiscriminators], got $discriminator.",
6234
+ [SOLANA_ERROR__CODECS__EXPECTED_FIXED_LENGTH2]: "Expected a fixed-size codec, got a variable-size one.",
6235
+ [SOLANA_ERROR__CODECS__EXPECTED_POSITIVE_BYTE_LENGTH2]: "Codec [$codecDescription] expected a positive byte length, got $bytesLength.",
6236
+ [SOLANA_ERROR__CODECS__EXPECTED_VARIABLE_LENGTH2]: "Expected a variable-size codec, got a fixed-size one.",
6237
+ [SOLANA_ERROR__CODECS__EXPECTED_ZERO_VALUE_TO_MATCH_ITEM_FIXED_SIZE2]: "Codec [$codecDescription] expected zero-value [$hexZeroValue] to have the same size as the provided fixed-size item [$expectedSize bytes].",
6238
+ [SOLANA_ERROR__CODECS__INVALID_BYTE_LENGTH2]: "Codec [$codecDescription] expected $expected bytes, got $bytesLength.",
6239
+ [SOLANA_ERROR__CODECS__INVALID_CONSTANT2]: "Expected byte array constant [$hexConstant] to be present in data [$hexData] at offset [$offset].",
6240
+ [SOLANA_ERROR__CODECS__INVALID_DISCRIMINATED_UNION_VARIANT2]: "Invalid discriminated union variant. Expected one of [$variants], got $value.",
6241
+ [SOLANA_ERROR__CODECS__INVALID_ENUM_VARIANT2]: "Invalid enum variant. Expected one of [$stringValues] or a number in [$formattedNumericalValues], got $variant.",
6242
+ [SOLANA_ERROR__CODECS__INVALID_LITERAL_UNION_VARIANT2]: "Invalid literal union variant. Expected one of [$variants], got $value.",
6243
+ [SOLANA_ERROR__CODECS__INVALID_NUMBER_OF_ITEMS2]: "Expected [$codecDescription] to have $expected items, got $actual.",
6244
+ [SOLANA_ERROR__CODECS__INVALID_STRING_FOR_BASE2]: "Invalid value $value for base $base with alphabet $alphabet.",
6245
+ [SOLANA_ERROR__CODECS__INVALID_UTF8_BYTES2]: "Invalid UTF-8 byte sequence at offset $offset.",
6246
+ [SOLANA_ERROR__CODECS__INVALID_UTF8_STRING2]: "Invalid UTF-8 string. Found a lone surrogate at index $index.",
6247
+ [SOLANA_ERROR__CODECS__LITERAL_UNION_DISCRIMINATOR_OUT_OF_RANGE2]: "Literal union discriminator out of range. Expected a number between $minRange and $maxRange, got $discriminator.",
6248
+ [SOLANA_ERROR__CODECS__NUMBER_OUT_OF_RANGE2]: "Codec [$codecDescription] expected number to be in the range [$min, $max], got $value.",
6249
+ [SOLANA_ERROR__CODECS__OFFSET_OUT_OF_RANGE2]: "Codec [$codecDescription] expected offset to be in the range [0, $bytesLength], got $offset.",
6250
+ [SOLANA_ERROR__CODECS__SENTINEL_MISSING_AT_END_OF_BYTES2]: "Codec [$codecDescription] expected sentinel [$hexSentinel] to terminate the collection, but reached the end of the byte array without it.",
6251
+ [SOLANA_ERROR__CODECS__SENTINEL_MISSING_IN_DECODED_BYTES2]: "Expected sentinel [$hexSentinel] to be present in decoded bytes [$hexDecodedBytes].",
6252
+ [SOLANA_ERROR__CODECS__SENTINEL_MUST_NOT_BE_EMPTY2]: "The sentinel must not be empty.",
6253
+ [SOLANA_ERROR__CODECS__UNION_VARIANT_OUT_OF_RANGE2]: "Union variant out of range. Expected an index between $minRange and $maxRange, got $variant.",
6254
+ [SOLANA_ERROR__CODECS__EXPECTED_DECODER_TO_CONSUME_ENTIRE_BYTE_ARRAY2]: "This decoder expected a byte array of exactly $expectedLength bytes, but $numExcessBytes unexpected excess bytes remained after decoding. Are you sure that you have chosen the correct decoder for this data?",
6255
+ [SOLANA_ERROR__CODECS__INVALID_PATTERN_MATCH_VALUE2]: "Invalid pattern match value. The provided value does not match any of the specified patterns.",
6256
+ [SOLANA_ERROR__CODECS__INVALID_PATTERN_MATCH_BYTES2]: "Invalid pattern match bytes. The provided byte array does not match any of the specified patterns.",
6257
+ [SOLANA_ERROR__CRYPTO__RANDOM_VALUES_FUNCTION_UNIMPLEMENTED2]: "No random values implementation could be found.",
6258
+ [SOLANA_ERROR__FAILED_TO_SEND_TRANSACTION2]: "Failed to send transaction$causeMessage",
6259
+ [SOLANA_ERROR__FAILED_TO_SEND_TRANSACTIONS2]: "Failed to send transactions$causeMessages",
6260
+ [SOLANA_ERROR__FAILED_TO_SIGN_TRANSACTION2]: "Failed to sign transaction$causeMessage",
6261
+ [SOLANA_ERROR__FAILED_TO_SIGN_TRANSACTIONS2]: "Failed to sign transactions$causeMessages",
6262
+ [SOLANA_ERROR__FIXED_POINTS__ARITHMETIC_OVERFLOW2]: "Fixed-point operation `$operation` of kind `$kind` overflowed. Expected a raw bigint in [$min, $max], got $result.",
6263
+ [SOLANA_ERROR__FIXED_POINTS__DIVISION_BY_ZERO2]: "Fixed-point division by zero for value of kind `$kind` ($signedness, $totalBits bits).",
6264
+ [SOLANA_ERROR__FIXED_POINTS__FRACTIONAL_BITS_EXCEED_TOTAL_BITS2]: "`fractionalBits` ($fractionalBits) must not exceed `totalBits` ($totalBits).",
6265
+ [SOLANA_ERROR__FIXED_POINTS__INVALID_DECIMALS2]: "Invalid `decimals`. Expected a non-negative integer, got $decimals.",
6266
+ [SOLANA_ERROR__FIXED_POINTS__INVALID_FRACTIONAL_BITS2]: "Invalid `fractionalBits`. Expected a non-negative integer, got $fractionalBits.",
6267
+ [SOLANA_ERROR__FIXED_POINTS__INVALID_STRING2]: "Invalid string `$input` for fixed-point value of kind `$kind`.",
6268
+ [SOLANA_ERROR__FIXED_POINTS__INVALID_TOTAL_BITS2]: "Invalid `totalBits`. Expected a positive integer, got $totalBits.",
6269
+ [SOLANA_ERROR__FIXED_POINTS__INVALID_ZERO_DENOMINATOR_RATIO2]: "Invalid ratio $numerator/$denominator for fixed-point value of kind `$kind`. Denominator must be non-zero.",
6270
+ [SOLANA_ERROR__FIXED_POINTS__MALFORMED_RAW_VALUE2]: "Fixed-point value of kind `$kind` has a malformed `raw` field. Expected a bigint, got `$raw`.",
6271
+ [SOLANA_ERROR__FIXED_POINTS__SHAPE_MISMATCH2]: "Fixed-point `$operation` operation expected $expectedKind ($expectedSignedness, $expectedTotalBits bits, $expectedScale $expectedScaleLabel); got $actualKind ($actualSignedness, $actualTotalBits bits, $actualScale $actualScaleLabel).",
6272
+ [SOLANA_ERROR__FIXED_POINTS__STRICT_MODE_PRECISION_LOSS2]: "Fixed-point operation `$operation` of kind `$kind` cannot be performed exactly; pass a rounding mode other than `strict` to allow a rounded result.",
6273
+ [SOLANA_ERROR__FIXED_POINTS__TOTAL_BITS_NOT_BYTE_ALIGNED2]: "Fixed-point codec of kind `$kind` requires `totalBits` to be a multiple of 8; got $totalBits.",
6274
+ [SOLANA_ERROR__FIXED_POINTS__VALUE_OUT_OF_RANGE2]: "Fixed-point value of kind `$kind` is out of range for $signedness $totalBits-bit storage. Expected a raw bigint in [$min, $max], got $raw.",
6275
+ [SOLANA_ERROR__FS__UNSUPPORTED_ENVIRONMENT2]: "Filesystem operation `$operation` is not supported in this environment.",
6276
+ [SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_ALREADY_INITIALIZED2]: "Instruction requires an uninitialized account",
6277
+ [SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_BORROW_FAILED2]: "Instruction tries to borrow reference for an account which is already borrowed",
6278
+ [SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_BORROW_OUTSTANDING2]: "Instruction left account with an outstanding borrowed reference",
6279
+ [SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_DATA_SIZE_CHANGED2]: "Program other than the account's owner changed the size of the account data",
6280
+ [SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_DATA_TOO_SMALL2]: "Account data too small for instruction",
6281
+ [SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_NOT_EXECUTABLE2]: "Instruction expected an executable account",
6282
+ [SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_NOT_RENT_EXEMPT2]: "An account does not have enough lamports to be rent-exempt",
6283
+ [SOLANA_ERROR__INSTRUCTION_ERROR__ARITHMETIC_OVERFLOW2]: "Program arithmetic overflowed",
6284
+ [SOLANA_ERROR__INSTRUCTION_ERROR__BORSH_IO_ERROR2]: "Failed to serialize or deserialize account data",
6285
+ [SOLANA_ERROR__INSTRUCTION_ERROR__BUILTIN_PROGRAMS_MUST_CONSUME_COMPUTE_UNITS2]: "Builtin programs must consume compute units",
6286
+ [SOLANA_ERROR__INSTRUCTION_ERROR__CALL_DEPTH2]: "Cross-program invocation call depth too deep",
6287
+ [SOLANA_ERROR__INSTRUCTION_ERROR__COMPUTATIONAL_BUDGET_EXCEEDED2]: "Computational budget exceeded",
6288
+ [SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM2]: "Custom program error: #$code",
6289
+ [SOLANA_ERROR__INSTRUCTION_ERROR__DUPLICATE_ACCOUNT_INDEX2]: "Instruction contains duplicate accounts",
6290
+ [SOLANA_ERROR__INSTRUCTION_ERROR__DUPLICATE_ACCOUNT_OUT_OF_SYNC2]: "Instruction modifications of multiply-passed account differ",
6291
+ [SOLANA_ERROR__INSTRUCTION_ERROR__EXECUTABLE_ACCOUNT_NOT_RENT_EXEMPT2]: "Executable accounts must be rent exempt",
6292
+ [SOLANA_ERROR__INSTRUCTION_ERROR__EXECUTABLE_DATA_MODIFIED2]: "Instruction changed executable accounts data",
6293
+ [SOLANA_ERROR__INSTRUCTION_ERROR__EXECUTABLE_LAMPORT_CHANGE2]: "Instruction changed the balance of an executable account",
6294
+ [SOLANA_ERROR__INSTRUCTION_ERROR__EXECUTABLE_MODIFIED2]: "Instruction changed executable bit of an account",
6295
+ [SOLANA_ERROR__INSTRUCTION_ERROR__EXTERNAL_ACCOUNT_DATA_MODIFIED2]: "Instruction modified data of an account it does not own",
6296
+ [SOLANA_ERROR__INSTRUCTION_ERROR__EXTERNAL_ACCOUNT_LAMPORT_SPEND2]: "Instruction spent from the balance of an account it does not own",
6297
+ [SOLANA_ERROR__INSTRUCTION_ERROR__GENERIC_ERROR2]: "Generic instruction error",
6298
+ [SOLANA_ERROR__INSTRUCTION_ERROR__ILLEGAL_OWNER2]: "Provided owner is not allowed",
6299
+ [SOLANA_ERROR__INSTRUCTION_ERROR__IMMUTABLE2]: "Account is immutable",
6300
+ [SOLANA_ERROR__INSTRUCTION_ERROR__INCORRECT_AUTHORITY2]: "Incorrect authority provided",
6301
+ [SOLANA_ERROR__INSTRUCTION_ERROR__INCORRECT_PROGRAM_ID2]: "Incorrect program id for instruction",
6302
+ [SOLANA_ERROR__INSTRUCTION_ERROR__INSUFFICIENT_FUNDS2]: "Insufficient funds for instruction",
6303
+ [SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_ACCOUNT_DATA2]: "Invalid account data for instruction",
6304
+ [SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_ACCOUNT_OWNER2]: "Invalid account owner",
6305
+ [SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_ARGUMENT2]: "Invalid program argument",
6306
+ [SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_ERROR2]: "Program returned invalid error code",
6307
+ [SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_INSTRUCTION_DATA2]: "Invalid instruction data",
6308
+ [SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_REALLOC2]: "Failed to reallocate account data",
6309
+ [SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_SEEDS2]: "Provided seeds do not result in a valid address",
6310
+ [SOLANA_ERROR__INSTRUCTION_ERROR__MAX_ACCOUNTS_DATA_ALLOCATIONS_EXCEEDED2]: "Accounts data allocations exceeded the maximum allowed per transaction",
6311
+ [SOLANA_ERROR__INSTRUCTION_ERROR__MAX_ACCOUNTS_EXCEEDED2]: "Max accounts exceeded",
6312
+ [SOLANA_ERROR__INSTRUCTION_ERROR__MAX_INSTRUCTION_TRACE_LENGTH_EXCEEDED2]: "Max instruction trace length exceeded",
6313
+ [SOLANA_ERROR__INSTRUCTION_ERROR__MAX_SEED_LENGTH_EXCEEDED2]: "Length of the seed is too long for address generation",
6314
+ [SOLANA_ERROR__INSTRUCTION_ERROR__MISSING_ACCOUNT2]: "An account required by the instruction is missing",
6315
+ [SOLANA_ERROR__INSTRUCTION_ERROR__MISSING_REQUIRED_SIGNATURE2]: "Missing required signature for instruction",
6316
+ [SOLANA_ERROR__INSTRUCTION_ERROR__MODIFIED_PROGRAM_ID2]: "Instruction illegally modified the program id of an account",
6317
+ [SOLANA_ERROR__INSTRUCTION_ERROR__NOT_ENOUGH_ACCOUNT_KEYS2]: "Insufficient account keys for instruction",
6318
+ [SOLANA_ERROR__INSTRUCTION_ERROR__PRIVILEGE_ESCALATION2]: "Cross-program invocation with unauthorized signer or writable account",
6319
+ [SOLANA_ERROR__INSTRUCTION_ERROR__PROGRAM_ENVIRONMENT_SETUP_FAILURE2]: "Failed to create program execution environment",
6320
+ [SOLANA_ERROR__INSTRUCTION_ERROR__PROGRAM_FAILED_TO_COMPILE2]: "Program failed to compile",
6321
+ [SOLANA_ERROR__INSTRUCTION_ERROR__PROGRAM_FAILED_TO_COMPLETE2]: "Program failed to complete",
6322
+ [SOLANA_ERROR__INSTRUCTION_ERROR__READONLY_DATA_MODIFIED2]: "Instruction modified data of a read-only account",
6323
+ [SOLANA_ERROR__INSTRUCTION_ERROR__READONLY_LAMPORT_CHANGE2]: "Instruction changed the balance of a read-only account",
6324
+ [SOLANA_ERROR__INSTRUCTION_ERROR__REENTRANCY_NOT_ALLOWED2]: "Cross-program invocation reentrancy not allowed for this instruction",
6325
+ [SOLANA_ERROR__INSTRUCTION_ERROR__RENT_EPOCH_MODIFIED2]: "Instruction modified rent epoch of an account",
6326
+ [SOLANA_ERROR__INSTRUCTION_ERROR__UNBALANCED_INSTRUCTION2]: "Sum of account balances before and after instruction do not match",
6327
+ [SOLANA_ERROR__INSTRUCTION_ERROR__UNINITIALIZED_ACCOUNT2]: "Instruction requires an initialized account",
6328
+ [SOLANA_ERROR__INSTRUCTION_ERROR__UNKNOWN2]: "The instruction failed with the error: $errorName",
6329
+ [SOLANA_ERROR__INSTRUCTION_ERROR__UNSUPPORTED_PROGRAM_ID2]: "Unsupported program id",
6330
+ [SOLANA_ERROR__INSTRUCTION_ERROR__UNSUPPORTED_SYSVAR2]: "Unsupported sysvar",
6331
+ [SOLANA_ERROR__INVARIANT_VIOLATION__INVALID_INSTRUCTION_PLAN_KIND2]: "Invalid instruction plan kind: $kind.",
6332
+ [SOLANA_ERROR__INSTRUCTION_PLANS__EMPTY_INSTRUCTION_PLAN2]: "The provided instruction plan is empty.",
6333
+ [SOLANA_ERROR__INSTRUCTION_PLANS__FAILED_SINGLE_TRANSACTION_PLAN_RESULT_NOT_FOUND2]: "No failed transaction plan result was found in the provided transaction plan result.",
6334
+ [SOLANA_ERROR__INSTRUCTION_PLANS__NON_DIVISIBLE_TRANSACTION_PLANS_NOT_SUPPORTED2]: "This transaction plan executor does not support non-divisible sequential plans. To support them, you may create your own executor such that multi-transaction atomicity is preserved \u2014 e.g. by targetting RPCs that support transaction bundles.",
6335
+ [SOLANA_ERROR__INSTRUCTION_PLANS__FAILED_TO_EXECUTE_TRANSACTION_PLAN2]: "The provided transaction plan failed to execute. See the `transactionPlanResult` attribute for more details. Note that the `cause` property is deprecated, and a future version will not set it.",
6336
+ [SOLANA_ERROR__INSTRUCTION_PLANS__INVALID_MAX_INSTRUCTIONS_PER_TRANSACTION2]: "The configured maximum of $maxInstructions instructions per transaction is invalid. It must be a positive integer no greater than the transaction format limit of $transactionInstructionLimit instructions per transaction. Provide a `maxInstructionsPerTransaction` (on the transaction planner) or `maxInstructions` (on the message packer) value between 1 and $transactionInstructionLimit.",
6337
+ [SOLANA_ERROR__INSTRUCTION_PLANS__MAX_INSTRUCTIONS_PER_TRANSACTION_EXCEEDED2]: "Planning this transaction message would require $numInstructions instructions, which exceeds the configured maximum of $maxInstructions instructions per transaction. This limit is configurable, and intended to leave headroom for inner instructions which are included in the maximum instruction limit for transactions. Increase `maxInstructionsPerTransaction` on the transaction planner (or `maxInstructions` on the message packer) to allow more instructions per transaction.",
6338
+ [SOLANA_ERROR__INSTRUCTION_PLANS__MESSAGE_CANNOT_ACCOMMODATE_PLAN2]: "The provided message has insufficient capacity to accommodate the next instruction(s) in this plan. Expected at least $numBytesRequired free byte(s), got $numFreeBytes byte(s).",
6339
+ [SOLANA_ERROR__INVARIANT_VIOLATION__INVALID_TRANSACTION_PLAN_KIND2]: "Invalid transaction plan kind: $kind.",
6340
+ [SOLANA_ERROR__INSTRUCTION_PLANS__MESSAGE_PACKER_ALREADY_COMPLETE2]: "No more instructions to pack; the message packer has completed the instruction plan.",
6341
+ [SOLANA_ERROR__INSTRUCTION_PLANS__MESSAGE_REJECTED_BY_PACKER2]: "The message packer rejected the provided transaction message: $reason.",
6342
+ [SOLANA_ERROR__INSTRUCTION_PLANS__UNEXPECTED_INSTRUCTION_PLAN2]: "Unexpected instruction plan. Expected $expectedKind plan, got $actualKind plan.",
6343
+ [SOLANA_ERROR__INSTRUCTION_PLANS__UNEXPECTED_TRANSACTION_PLAN2]: "Unexpected transaction plan. Expected $expectedKind plan, got $actualKind plan.",
6344
+ [SOLANA_ERROR__INSTRUCTION_PLANS__UNEXPECTED_TRANSACTION_PLAN_RESULT2]: "Unexpected transaction plan result. Expected $expectedKind plan, got $actualKind plan.",
6345
+ [SOLANA_ERROR__INSTRUCTION_PLANS__EXPECTED_SUCCESSFUL_TRANSACTION_PLAN_RESULT2]: "Expected a successful transaction plan result. I.e. there is at least one failed or cancelled transaction in the plan.",
6346
+ [SOLANA_ERROR__INSTRUCTION__EXPECTED_TO_HAVE_ACCOUNTS2]: "The instruction does not have any accounts.",
6347
+ [SOLANA_ERROR__INSTRUCTION__EXPECTED_TO_HAVE_DATA2]: "The instruction does not have any data.",
6348
+ [SOLANA_ERROR__INSTRUCTION__PROGRAM_ID_MISMATCH2]: "Expected instruction to have progress address $expectedProgramAddress, got $actualProgramAddress.",
6349
+ [SOLANA_ERROR__INVALID_BLOCKHASH_BYTE_LENGTH2]: "Expected base58 encoded blockhash to decode to a byte array of length 32. Actual length: $actualLength.",
6350
+ [SOLANA_ERROR__INVALID_NONCE2]: "The nonce `$expectedNonceValue` is no longer valid. It has advanced to `$actualNonceValue`",
6351
+ [SOLANA_ERROR__INVARIANT_VIOLATION__CACHED_ABORTABLE_ITERABLE_CACHE_ENTRY_MISSING2]: "Invariant violation: Found no abortable iterable cache entry for key `$cacheKey`. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant",
6352
+ [SOLANA_ERROR__INVARIANT_VIOLATION__DATA_PUBLISHER_CHANNEL_UNIMPLEMENTED2]: "Invariant violation: This data publisher does not publish to the channel named `$channelName`. Supported channels include $supportedChannelNames.",
6353
+ [SOLANA_ERROR__INVARIANT_VIOLATION__SUBSCRIPTION_ITERATOR_MUST_NOT_POLL_BEFORE_RESOLVING_EXISTING_MESSAGE_PROMISE2]: "Invariant violation: WebSocket message iterator state is corrupt; iterated without first resolving existing message promise. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant",
6354
+ [SOLANA_ERROR__INVARIANT_VIOLATION__SUBSCRIPTION_ITERATOR_STATE_MISSING2]: "Invariant violation: WebSocket message iterator is missing state storage. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant",
6355
+ [SOLANA_ERROR__INVARIANT_VIOLATION__SWITCH_MUST_BE_EXHAUSTIVE2]: "Invariant violation: Switch statement non-exhaustive. Received unexpected value `$unexpectedValue`. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant",
6356
+ [SOLANA_ERROR__JSON_RPC__INTERNAL_ERROR2]: "JSON-RPC error: Internal JSON-RPC error ($__serverMessage)",
6357
+ [SOLANA_ERROR__JSON_RPC__INVALID_PARAMS2]: "JSON-RPC error: Invalid method parameter(s) ($__serverMessage)",
6358
+ [SOLANA_ERROR__JSON_RPC__INVALID_REQUEST2]: "JSON-RPC error: The JSON sent is not a valid `Request` object ($__serverMessage)",
6359
+ [SOLANA_ERROR__JSON_RPC__METHOD_NOT_FOUND2]: "JSON-RPC error: The method does not exist / is not available ($__serverMessage)",
6360
+ [SOLANA_ERROR__JSON_RPC__PARSE_ERROR2]: "JSON-RPC error: An error occurred on the server while parsing the JSON text ($__serverMessage)",
6361
+ [SOLANA_ERROR__JSON_RPC__SCAN_ERROR2]: "$__serverMessage",
6362
+ [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_CLEANED_UP2]: "$__serverMessage",
6363
+ [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_NOT_AVAILABLE2]: "$__serverMessage",
6364
+ [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET2]: "$__serverMessage",
6365
+ [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_EPOCH_REWARDS_PERIOD_ACTIVE2]: "Epoch rewards period still active at slot $slot",
6366
+ [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_FILTER_TRANSACTION_NOT_FOUND2]: "$__serverMessage",
6367
+ [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX2]: "$__serverMessage",
6368
+ [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED2]: "$__serverMessage",
6369
+ [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_LONG_TERM_STORAGE_UNREACHABLE2]: "Failed to query long-term storage; please try again",
6370
+ [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED2]: "Minimum context slot has not been reached",
6371
+ [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_NODE_UNHEALTHY2]: "Node is unhealthy; behind by $numSlotsBehind slots",
6372
+ [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_NO_SLOT_HISTORY2]: "No slot history",
6373
+ [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_NO_SNAPSHOT2]: "No snapshot",
6374
+ [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE2]: "Transaction simulation failed",
6375
+ [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SLOT_NOT_EPOCH_BOUNDARY2]: "Rewards cannot be found because slot $slot is not the epoch boundary. This may be due to gap in the queried node's local ledger or long-term storage",
6376
+ [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SLOT_SKIPPED2]: "$__serverMessage",
6377
+ [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE2]: "Transaction history is not available from this node",
6378
+ [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE2]: "$__serverMessage",
6379
+ [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH2]: "Transaction signature length mismatch",
6380
+ [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE2]: "Transaction signature verification failure",
6381
+ [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION2]: "$__serverMessage",
6382
+ [SOLANA_ERROR__KEYS__INVALID_BASE58_IN_GRIND_REGEX2]: "The grind regex `/$source/` contains the character `$character`, which is not in the base58 alphabet and can never match a Solana address.",
6383
+ [SOLANA_ERROR__KEYS__INVALID_KEY_PAIR_BYTE_LENGTH2]: "Key pair bytes must be of length 64, got $byteLength.",
6384
+ [SOLANA_ERROR__KEYS__INVALID_PRIVATE_KEY_BYTE_LENGTH2]: "Expected private key bytes with length 32. Actual length: $actualLength.",
6385
+ [SOLANA_ERROR__KEYS__INVALID_SIGNATURE_BYTE_LENGTH2]: "Expected base58-encoded signature to decode to a byte array of length 64. Actual length: $actualLength.",
6386
+ [SOLANA_ERROR__KEYS__PUBLIC_KEY_MUST_MATCH_PRIVATE_KEY2]: "The provided private key does not match the provided public key.",
6387
+ [SOLANA_ERROR__KEYS__SIGNATURE_STRING_LENGTH_OUT_OF_RANGE2]: "Expected base58-encoded signature string of length in the range [64, 88]. Actual length: $actualLength.",
6388
+ [SOLANA_ERROR__KEYS__WRITE_KEY_PAIR_UNSUPPORTED_ENVIRONMENT2]: "Writing a key pair to disk is not supported in this environment.",
6389
+ [SOLANA_ERROR__LAMPORTS_OUT_OF_RANGE2]: "Lamports value must be in the range [0, 2e64-1]",
6390
+ [SOLANA_ERROR__MALFORMED_BIGINT_STRING2]: "`$value` cannot be parsed as a `BigInt`",
6391
+ [SOLANA_ERROR__MALFORMED_JSON_RPC_ERROR2]: "$message",
6392
+ [SOLANA_ERROR__MALFORMED_NUMBER_STRING2]: "`$value` cannot be parsed as a `Number`",
6393
+ [SOLANA_ERROR__NONCE_ACCOUNT_NOT_FOUND2]: "No nonce account could be found at address `$nonceAccountAddress`",
6394
+ [SOLANA_ERROR__OFFCHAIN_MESSAGE__INVALID_APPLICATION_DOMAIN_BYTE_LENGTH2]: "Expected base58 encoded application domain to decode to a byte array of length 32. Actual length: $actualLength.",
6395
+ [SOLANA_ERROR__OFFCHAIN_MESSAGE__ADDRESSES_CANNOT_SIGN_OFFCHAIN_MESSAGE2]: "Attempted to sign an offchain message with an address that is not a signer for it",
6396
+ [SOLANA_ERROR__OFFCHAIN_MESSAGE__APPLICATION_DOMAIN_STRING_LENGTH_OUT_OF_RANGE2]: "Expected base58-encoded application domain string of length in the range [32, 44]. Actual length: $actualLength.",
6397
+ [SOLANA_ERROR__OFFCHAIN_MESSAGE__CONTENT_DOES_NOT_MATCH_EXPECTED2]: "The content of the offchain message does not match the content that was expected. Expected content with a byte-length of $expectedBytes; got content with a byte-length of $actualBytes. The signer may have signed different data than was requested; do not trust its signature.",
6398
+ [SOLANA_ERROR__OFFCHAIN_MESSAGE__ENVELOPE_SIGNERS_MISMATCH2]: "The signer addresses in this offchain message envelope do not match the list of required signers in the message preamble. These unexpected signers were present in the envelope: `[$unexpectedSigners]`. These required signers were missing from the envelope `[$missingSigners]`.",
6399
+ [SOLANA_ERROR__OFFCHAIN_MESSAGE__MAXIMUM_LENGTH_EXCEEDED2]: "The message body provided has a byte-length of $actualBytes. The maximum allowable byte-length is $maxBytes",
6400
+ [SOLANA_ERROR__OFFCHAIN_MESSAGE__MESSAGE_FORMAT_MISMATCH2]: "Expected message format $expectedMessageFormat, got $actualMessageFormat",
6401
+ [SOLANA_ERROR__OFFCHAIN_MESSAGE__MESSAGE_LENGTH_MISMATCH2]: "The message length specified in the message preamble is $specifiedLength bytes. The actual length of the message is $actualLength bytes.",
6402
+ [SOLANA_ERROR__OFFCHAIN_MESSAGE__MESSAGE_MUST_BE_NON_EMPTY2]: "Offchain message content must be non-empty",
6403
+ [SOLANA_ERROR__OFFCHAIN_MESSAGE__NUM_REQUIRED_SIGNERS_CANNOT_BE_ZERO2]: "Offchain message must specify the address of at least one required signer",
6404
+ [SOLANA_ERROR__OFFCHAIN_MESSAGE__NUM_ENVELOPE_SIGNATURES_CANNOT_BE_ZERO2]: "Offchain message envelope must reserve space for at least one signature",
6405
+ [SOLANA_ERROR__OFFCHAIN_MESSAGE__NUM_SIGNATURES_MISMATCH2]: "The offchain message preamble specifies $numRequiredSignatures required signature(s), got $signaturesLength.",
6406
+ [SOLANA_ERROR__OFFCHAIN_MESSAGE__REQUIRED_SIGNATORIES_DO_NOT_MATCH_EXPECTED2]: "The offchain message lists different required signatories than was expected. Expected [$expectedAddresses]. Got [$actualAddresses]. The signer may have signed different data than was requested; do not trust its signature.",
6407
+ [SOLANA_ERROR__OFFCHAIN_MESSAGE__SIGNATORIES_MUST_BE_SORTED2]: "The signatories of this offchain message must be listed in lexicographical order",
6408
+ [SOLANA_ERROR__OFFCHAIN_MESSAGE__SIGNATORIES_MUST_BE_UNIQUE2]: "An address must be listed no more than once among the signatories of an offchain message",
6409
+ [SOLANA_ERROR__OFFCHAIN_MESSAGE__SIGNATURES_MISSING2]: "Offchain message is missing signatures for addresses: $addresses.",
6410
+ [SOLANA_ERROR__OFFCHAIN_MESSAGE__SIGNATURE_VERIFICATION_FAILURE2]: "Offchain message signature verification failed. Signature mismatch for required signatories [$signatoriesWithInvalidSignatures]. Missing signatures for signatories [$signatoriesWithMissingSignatures]",
6411
+ [SOLANA_ERROR__OFFCHAIN_MESSAGE__RESTRICTED_ASCII_BODY_CHARACTER_OUT_OF_RANGE2]: "The message body provided contains characters whose codes fall outside the allowed range. In order to ensure clear-signing compatiblity with hardware wallets, the message may only contain line feeds and characters in the range [\\x20-\\x7e].",
6412
+ [SOLANA_ERROR__OFFCHAIN_MESSAGE__UNEXPECTED_VERSION2]: "Expected offchain message version $expectedVersion. Got $actualVersion.",
6413
+ [SOLANA_ERROR__OFFCHAIN_MESSAGE__VERSION_NUMBER_NOT_SUPPORTED2]: "This version of Kit does not support decoding offchain messages with version $unsupportedVersion. The current max supported version is 0.",
6414
+ [SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT2]: "The provided account could not be identified as an account from the $programName program.",
6415
+ [SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION2]: "The provided instruction could not be identified as an instruction from the $programName program.",
6416
+ [SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS2]: "The provided instruction is missing some accounts. Expected at least $expectedAccountMetas account(s), got $actualAccountMetas.",
6417
+ [SOLANA_ERROR__PROGRAM_CLIENTS__RESOLVED_INSTRUCTION_INPUT_MUST_BE_NON_NULL2]: "Expected resolved instruction input '$inputName' to be non-null.",
6418
+ [SOLANA_ERROR__PROGRAM_CLIENTS__RESOLVED_INSTRUCTION_INPUT_MUST_BE_SIGNER2]: "Expected resolved instruction input '$inputName' to be a `TransactionSigner` because the instruction requires this account to sign the transaction. If its signature is provided by other means, use `createNoopSigner()` from `@solana/signers` to satisfy this requirement.",
6419
+ [SOLANA_ERROR__PROGRAM_CLIENTS__UNEXPECTED_RESOLVED_INSTRUCTION_INPUT_TYPE2]: "Expected resolved instruction input '$inputName' to be of type `$expectedType`.",
6420
+ [SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_ACCOUNT_TYPE2]: "Unrecognized account type '$accountType' for the $programName program.",
6421
+ [SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE2]: "Unrecognized instruction type '$instructionType' for the $programName program.",
6422
+ [SOLANA_ERROR__RPC_SUBSCRIPTIONS__CANNOT_CREATE_SUBSCRIPTION_PLAN2]: "The notification name must end in 'Notifications' and the API must supply a subscription plan creator function for the notification '$notificationName'.",
6423
+ [SOLANA_ERROR__RPC_SUBSCRIPTIONS__CHANNEL_CLOSED_BEFORE_MESSAGE_BUFFERED2]: "WebSocket was closed before payload could be added to the send buffer",
6424
+ [SOLANA_ERROR__RPC_SUBSCRIPTIONS__CHANNEL_CONNECTION_CLOSED2]: "WebSocket connection closed",
6425
+ [SOLANA_ERROR__RPC_SUBSCRIPTIONS__CHANNEL_FAILED_TO_CONNECT2]: "WebSocket failed to connect",
6426
+ [SOLANA_ERROR__RPC_SUBSCRIPTIONS__EXPECTED_SERVER_SUBSCRIPTION_ID2]: "Failed to obtain a subscription id from the server",
6427
+ [SOLANA_ERROR__RPC__API_PLAN_MISSING_FOR_RPC_METHOD2]: "Could not find an API plan for RPC method: `$method`",
6428
+ [SOLANA_ERROR__RPC__INTEGER_OVERFLOW2]: "The $argumentLabel argument to the `$methodName` RPC method$optionalPathLabel was `$value`. This number is unsafe for use with the Solana JSON-RPC because it exceeds `Number.MAX_SAFE_INTEGER`.",
6429
+ [SOLANA_ERROR__RPC__TRANSPORT_HTTP_ERROR2]: "HTTP error ($statusCode): $message",
6430
+ [SOLANA_ERROR__RPC__TRANSPORT_HTTP_HEADER_FORBIDDEN2]: "HTTP header(s) forbidden: $headers. Learn more at https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name.",
6431
+ [SOLANA_ERROR__SIGNER__ADDRESS_CANNOT_HAVE_MULTIPLE_SIGNERS2]: "Multiple distinct signers were identified for address `$address`. Please ensure that you are using the same signer instance for each address.",
6432
+ [SOLANA_ERROR__SIGNER__EXPECTED_KEY_PAIR_SIGNER2]: "The provided value does not implement the `KeyPairSigner` interface",
6433
+ [SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_MODIFYING_SIGNER2]: "The provided value does not implement the `MessageModifyingSigner` interface",
6434
+ [SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_PARTIAL_SIGNER2]: "The provided value does not implement the `MessagePartialSigner` interface",
6435
+ [SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_SIGNER2]: "The provided value does not implement any of the `MessageSigner` interfaces",
6436
+ [SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_MODIFYING_SIGNER2]: "The provided value does not implement the `TransactionModifyingSigner` interface",
6437
+ [SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_PARTIAL_SIGNER2]: "The provided value does not implement the `TransactionPartialSigner` interface",
6438
+ [SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_SENDING_SIGNER2]: "The provided value does not implement the `TransactionSendingSigner` interface",
6439
+ [SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_SIGNER2]: "The provided value does not implement any of the `TransactionSigner` interfaces",
6440
+ [SOLANA_ERROR__SIGNER__TRANSACTION_CANNOT_HAVE_MULTIPLE_SENDING_SIGNERS2]: "More than one `TransactionSendingSigner` was identified.",
6441
+ [SOLANA_ERROR__SIGNER__TRANSACTION_SENDING_SIGNER_MISSING2]: "No `TransactionSendingSigner` was identified. Please provide a valid `TransactionWithSingleSendingSigner` transaction.",
6442
+ [SOLANA_ERROR__SIGNER__WALLET_ACCOUNT_CANNOT_SIGN_TRANSACTION2]: "The wallet account $address cannot be used to create a transaction signer because it does not implement either the `solana:signTransaction` or `solana:signAndSendTransaction` feature. At least one of these features is required. The account supports the following features: $supportedFeatures.",
6443
+ [SOLANA_ERROR__SIGNER__WALLET_MULTISIGN_UNIMPLEMENTED2]: "Wallet account signers do not support signing multiple messages/transactions in a single operation",
6444
+ [SOLANA_ERROR__SUBSCRIBABLE__RETRY_NOT_SUPPORTED2]: "This `ReactiveStreamStore` does not support retry. Use `createReactiveStoreFromDataPublisherFactory` to construct a retryable store.",
6445
+ [SOLANA_ERROR__SUBSCRIBABLE__STREAM_CLOSED_WITHOUT_ERROR2]: "The stream store closed in an error state but did not report an error.",
6446
+ [SOLANA_ERROR__SUBTLE_CRYPTO__CANNOT_EXPORT_NON_EXTRACTABLE_KEY2]: "Cannot export a non-extractable key.",
6447
+ [SOLANA_ERROR__SUBTLE_CRYPTO__DIGEST_UNIMPLEMENTED2]: "No digest implementation could be found.",
6448
+ [SOLANA_ERROR__SUBTLE_CRYPTO__DISALLOWED_IN_INSECURE_CONTEXT2]: "Cryptographic operations are only allowed in secure browser contexts. Read more here: https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts.",
6449
+ [SOLANA_ERROR__SUBTLE_CRYPTO__ED25519_ALGORITHM_UNIMPLEMENTED2]: "This runtime does not support the generation of Ed25519 key pairs.\n\nInstall @solana/webcrypto-ed25519-polyfill and call its `install` function before generating keys in environments that do not support Ed25519.\n\nFor a list of runtimes that currently support Ed25519 operations, visit https://github.com/WICG/webcrypto-secure-curves/issues/20.",
6450
+ [SOLANA_ERROR__SUBTLE_CRYPTO__EXPORT_FUNCTION_UNIMPLEMENTED2]: "No key export implementation could be found.",
6451
+ [SOLANA_ERROR__SUBTLE_CRYPTO__GENERATE_FUNCTION_UNIMPLEMENTED2]: "No key generation implementation could be found.",
6452
+ [SOLANA_ERROR__SUBTLE_CRYPTO__SIGN_FUNCTION_UNIMPLEMENTED2]: "No signing implementation could be found.",
6453
+ [SOLANA_ERROR__SUBTLE_CRYPTO__VERIFY_FUNCTION_UNIMPLEMENTED2]: "No signature verification implementation could be found.",
6454
+ [SOLANA_ERROR__TIMESTAMP_OUT_OF_RANGE2]: "Timestamp value must be in the range [-(2n ** 63n), (2n ** 63n) - 1]. `$value` given",
6455
+ [SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_BORROW_OUTSTANDING2]: "Transaction processing left an account with an outstanding borrowed reference",
6456
+ [SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_IN_USE2]: "Account in use",
6457
+ [SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_LOADED_TWICE2]: "Account loaded twice",
6458
+ [SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_NOT_FOUND2]: "Attempt to debit an account but found no record of a prior credit.",
6459
+ [SOLANA_ERROR__TRANSACTION_ERROR__ADDRESS_LOOKUP_TABLE_NOT_FOUND2]: "Transaction loads an address table account that doesn't exist",
6460
+ [SOLANA_ERROR__TRANSACTION_ERROR__ALREADY_PROCESSED2]: "This transaction has already been processed",
6461
+ [SOLANA_ERROR__TRANSACTION_ERROR__BLOCKHASH_NOT_FOUND2]: "Blockhash not found",
6462
+ [SOLANA_ERROR__TRANSACTION_ERROR__CALL_CHAIN_TOO_DEEP2]: "Loader call chain is too deep",
6463
+ [SOLANA_ERROR__TRANSACTION_ERROR__CLUSTER_MAINTENANCE2]: "Transactions are currently disabled due to cluster maintenance",
6464
+ [SOLANA_ERROR__TRANSACTION_ERROR__DUPLICATE_INSTRUCTION2]: "Transaction contains a duplicate instruction ($index) that is not allowed",
6465
+ [SOLANA_ERROR__TRANSACTION_ERROR__INSUFFICIENT_FUNDS_FOR_FEE2]: "Insufficient funds for fee",
6466
+ [SOLANA_ERROR__TRANSACTION_ERROR__INSUFFICIENT_FUNDS_FOR_RENT2]: "Transaction results in an account ($accountIndex) with insufficient funds for rent",
6467
+ [SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ACCOUNT_FOR_FEE2]: "This account may not be used to pay transaction fees",
6468
+ [SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ACCOUNT_INDEX2]: "Transaction contains an invalid account reference",
6469
+ [SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ADDRESS_LOOKUP_TABLE_DATA2]: "Transaction loads an address table account with invalid data",
6470
+ [SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ADDRESS_LOOKUP_TABLE_INDEX2]: "Transaction address table lookup uses an invalid index",
6471
+ [SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ADDRESS_LOOKUP_TABLE_OWNER2]: "Transaction loads an address table account with an invalid owner",
6472
+ [SOLANA_ERROR__TRANSACTION_ERROR__INVALID_LOADED_ACCOUNTS_DATA_SIZE_LIMIT2]: "LoadedAccountsDataSizeLimit set for transaction must be greater than 0.",
6473
+ [SOLANA_ERROR__TRANSACTION_ERROR__INVALID_PROGRAM_FOR_EXECUTION2]: "This program may not be used for executing instructions",
6474
+ [SOLANA_ERROR__TRANSACTION_ERROR__INVALID_RENT_PAYING_ACCOUNT2]: "Transaction leaves an account with a lower balance than rent-exempt minimum",
6475
+ [SOLANA_ERROR__TRANSACTION_ERROR__INVALID_WRITABLE_ACCOUNT2]: "Transaction loads a writable account that cannot be written",
6476
+ [SOLANA_ERROR__TRANSACTION_ERROR__MAX_LOADED_ACCOUNTS_DATA_SIZE_EXCEEDED2]: "Transaction exceeded max loaded accounts data size cap",
6477
+ [SOLANA_ERROR__TRANSACTION_ERROR__MISSING_SIGNATURE_FOR_FEE2]: "Transaction requires a fee but has no signature present",
6478
+ [SOLANA_ERROR__TRANSACTION_ERROR__PROGRAM_ACCOUNT_NOT_FOUND2]: "Attempt to load a program that does not exist",
6479
+ [SOLANA_ERROR__TRANSACTION_ERROR__PROGRAM_EXECUTION_TEMPORARILY_RESTRICTED2]: "Execution of the program referenced by account at index $accountIndex is temporarily restricted.",
6480
+ [SOLANA_ERROR__TRANSACTION_ERROR__RESANITIZATION_NEEDED2]: "ResanitizationNeeded",
6481
+ [SOLANA_ERROR__TRANSACTION_ERROR__SANITIZE_FAILURE2]: "Transaction failed to sanitize accounts offsets correctly",
6482
+ [SOLANA_ERROR__TRANSACTION_ERROR__SIGNATURE_FAILURE2]: "Transaction did not pass signature verification",
6483
+ [SOLANA_ERROR__TRANSACTION_ERROR__TOO_MANY_ACCOUNT_LOCKS2]: "Transaction locked too many accounts",
6484
+ [SOLANA_ERROR__TRANSACTION_ERROR__UNBALANCED_TRANSACTION2]: "Sum of account balances before and after transaction do not match",
6485
+ [SOLANA_ERROR__TRANSACTION_ERROR__UNKNOWN2]: "The transaction failed with the error `$errorName`",
6486
+ [SOLANA_ERROR__TRANSACTION_ERROR__UNSUPPORTED_VERSION2]: "Transaction version is unsupported",
6487
+ [SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_ACCOUNT_DATA_BLOCK_LIMIT2]: "Transaction would exceed account data limit within the block",
6488
+ [SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_ACCOUNT_DATA_TOTAL_LIMIT2]: "Transaction would exceed total account data limit",
6489
+ [SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_MAX_ACCOUNT_COST_LIMIT2]: "Transaction would exceed max account limit within the block",
6490
+ [SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_MAX_BLOCK_COST_LIMIT2]: "Transaction would exceed max Block Cost Limit",
6491
+ [SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_MAX_VOTE_COST_LIMIT2]: "Transaction would exceed max Vote Cost Limit",
6492
+ [SOLANA_ERROR__TRANSACTION__ADDRESSES_CANNOT_SIGN_TRANSACTION2]: "Attempted to sign a transaction with an address that is not a signer for it",
6493
+ [SOLANA_ERROR__TRANSACTION__ADDRESS_MISSING2]: "Transaction is missing an address at index: $index.",
6494
+ [SOLANA_ERROR__TRANSACTION__CANNOT_ENCODE_WITH_EMPTY_SIGNATURES2]: "Transaction has no expected signers therefore it cannot be encoded",
6495
+ [SOLANA_ERROR__TRANSACTION__COMPUTE_UNIT_LIMIT_OUT_OF_RANGE2]: "Transaction compute unit limit must be an integer in the range [0, $maxComputeUnitLimit]. `$computeUnitLimit` given",
6496
+ [SOLANA_ERROR__TRANSACTION__EXCEEDS_SIZE_LIMIT2]: "Transaction size $transactionSize exceeds limit of $transactionSizeLimit bytes",
6497
+ [SOLANA_ERROR__TRANSACTION__EXPECTED_BLOCKHASH_LIFETIME2]: "Transaction does not have a blockhash lifetime",
6498
+ [SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME2]: "Transaction is not a durable nonce transaction",
6499
+ [SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_ADDRESS_LOOKUP_TABLE_CONTENTS_MISSING2]: "Contents of these address lookup tables unknown: $lookupTableAddresses",
6500
+ [SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_ADDRESS_LOOKUP_TABLE_INDEX_OUT_OF_RANGE2]: "Lookup of address at index $highestRequestedIndex failed for lookup table `$lookupTableAddress`. Highest known index is $highestKnownIndex. The lookup table may have been extended since its contents were retrieved",
6501
+ [SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_FEE_PAYER_MISSING2]: "No fee payer set in CompiledTransaction",
6502
+ [SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_INSTRUCTION_PROGRAM_ADDRESS_NOT_FOUND2]: "Could not find program address at index $index",
6503
+ [SOLANA_ERROR__TRANSACTION__FAILED_TO_ESTIMATE_COMPUTE_LIMIT2]: "Failed to estimate the compute unit consumption for this transaction message. This is likely because simulating the transaction failed. Inspect the `cause` property of this error to learn more",
6504
+ [SOLANA_ERROR__TRANSACTION__FAILED_TO_ESTIMATE_LOADED_ACCOUNTS_DATA_SIZE_LIMIT2]: "Failed to estimate the loaded accounts data size for this transaction message. The RPC did not return a `loadedAccountsDataSize` value from simulation. This value is required for version 1 transactions",
6505
+ [SOLANA_ERROR__TRANSACTION__FAILED_WHEN_SIMULATING_TO_ESTIMATE_COMPUTE_LIMIT2]: "Transaction failed when it was simulated in order to estimate the compute unit consumption. The compute unit estimate provided is for a transaction that failed when simulated and may not be representative of the compute units this transaction would consume if successful. Inspect the `cause` property of this error to learn more",
6506
+ [SOLANA_ERROR__TRANSACTION__FAILED_WHEN_SIMULATING_TO_ESTIMATE_RESOURCE_LIMITS2]: "Transaction failed when it was simulated in order to estimate its resource limits. The resource limit estimates provided are for a transaction that failed when simulated and may not be representative of the resources this transaction would consume if successful. Inspect the `cause` property of this error to learn more",
6507
+ [SOLANA_ERROR__TRANSACTION__FEE_PAYER_MISSING2]: "Transaction is missing a fee payer.",
6508
+ [SOLANA_ERROR__TRANSACTION__FEE_PAYER_SIGNATURE_MISSING2]: "Could not determine this transaction's signature. Make sure that the transaction has been signed by its fee payer.",
6509
+ [SOLANA_ERROR__TRANSACTION__INVALID_NONCE_TRANSACTION_FIRST_INSTRUCTION_MUST_BE_ADVANCE_NONCE2]: "Transaction first instruction is not advance nonce account instruction.",
6510
+ [SOLANA_ERROR__TRANSACTION__INVALID_NONCE_TRANSACTION_INSTRUCTIONS_MISSING2]: "Transaction with no instructions cannot be durable nonce transaction.",
6511
+ [SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_CANNOT_PAY_FEES2]: "This transaction includes an address (`$programAddress`) which is both invoked and set as the fee payer. Program addresses may not pay fees",
6512
+ [SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_MUST_NOT_BE_WRITABLE2]: "This transaction includes an address (`$programAddress`) which is both invoked and marked writable. Program addresses may not be writable",
6513
+ [SOLANA_ERROR__TRANSACTION__MESSAGE_SIGNATURES_MISMATCH2]: "The transaction message expected the transaction to have $numRequiredSignatures signatures, got $signaturesLength.",
6514
+ [SOLANA_ERROR__TRANSACTION__SIGNATURES_MISSING2]: "Transaction is missing signatures for addresses: $addresses.",
6515
+ [SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_OUT_OF_RANGE2]: "Transaction version must be in the range [0, 127]. `$actualVersion` given",
6516
+ [SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_NOT_SUPPORTED2]: "This version of Kit does not support decoding transactions with version $unsupportedVersion. The current max supported version is 1.",
6517
+ [SOLANA_ERROR__TRANSACTION__NONCE_ACCOUNT_CANNOT_BE_IN_LOOKUP_TABLE2]: "The transaction has a durable nonce lifetime (with nonce `$nonce`), but the nonce account address is in a lookup table. The lifetime constraint cannot be constructed without fetching the lookup tables for the transaction.",
6518
+ [SOLANA_ERROR__TRANSACTION__INVALID_CONFIG_MASK_PRIORITY_FEE_BITS2]: "Invalid transaction config mask: $mask. Bits 0 and 1 must match (both set or both unset)",
6519
+ [SOLANA_ERROR__TRANSACTION__MALFORMED_MESSAGE_BYTES2]: "Transaction message bytes are malformed: $messageBytes",
6520
+ [SOLANA_ERROR__TRANSACTION__CANNOT_ENCODE_WITH_EMPTY_MESSAGE_BYTES2]: "Transaction message bytes are empty, so the transaction cannot be encoded",
6521
+ [SOLANA_ERROR__TRANSACTION__CANNOT_DECODE_EMPTY_TRANSACTION_BYTES2]: "Transaction bytes are empty, so no transaction can be decoded",
6522
+ [SOLANA_ERROR__TRANSACTION__VERSION_ZERO_MUST_BE_ENCODED_WITH_SIGNATURES_FIRST2]: "Transaction version 0 must be encoded with signatures first. This transaction was encoded with first byte $firstByte, which is expected to be a signature count for v0 transactions.",
6523
+ [SOLANA_ERROR__TRANSACTION__SIGNATURE_COUNT_TOO_HIGH_FOR_TRANSACTION_BYTES2]: "The provided transaction bytes expect that there should be $numExpectedSignatures signatures, but the bytes are not long enough to contain a transaction message with this many signatures. The provided bytes are $transactionBytesLength bytes long.",
6524
+ [SOLANA_ERROR__TRANSACTION__INVALID_HEAP_SIZE2]: "Transaction heap size must be an integer multiple of $multipleOf bytes in the range [$minHeapSize, $maxHeapSize]. `$heapSize` given",
6525
+ [SOLANA_ERROR__TRANSACTION__INVALID_NONCE_ACCOUNT_INDEX2]: "The transaction has a durable nonce lifetime, but the nonce account index is invalid. Expected a nonce account index less than $numberOfStaticAccounts, got $nonceAccountIndex.",
6526
+ [SOLANA_ERROR__TRANSACTION__INVALID_CONFIG_VALUE_KIND2]: "The transaction config value for $configName has the incorrect kind. Expected $expectedKind, got $actualKind.",
6527
+ [SOLANA_ERROR__TRANSACTION__INSTRUCTION_HEADERS_PAYLOADS_MISMATCH2]: "The transaction does not have the same number of instruction headers and instruction payloads. Got $numInstructionHeaders instruction headers, and $numInstructionPayloads instruction payloads.",
6528
+ [SOLANA_ERROR__TRANSACTION__TOO_MANY_SIGNER_ADDRESSES2]: "Transaction has $actualCount unique signer addresses but the maximum allowed is $maxAllowed",
6529
+ [SOLANA_ERROR__TRANSACTION__TOO_MANY_ACCOUNT_ADDRESSES2]: "Transaction has $actualCount unique account addresses but the maximum allowed is $maxAllowed",
6530
+ [SOLANA_ERROR__TRANSACTION__TOO_MANY_INSTRUCTIONS2]: "Transaction has $actualCount instructions but the maximum allowed is $maxAllowed",
6531
+ [SOLANA_ERROR__TRANSACTION__TOO_MANY_ACCOUNTS_IN_INSTRUCTION2]: "The instruction at index $instructionIndex has $actualCount account references but the maximum allowed is $maxAllowed",
6532
+ [SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_INSTRUCTION_ACCOUNT_INDEX_OUT_OF_RANGE2]: "Could not find an account address at index $index while decompiling an instruction",
6533
+ [SOLANA_ERROR__TRANSACTION_INTROSPECTION__CANNOT_DECODE_JSON_PARSED_TRANSACTION2]: "`getTransaction` responses fetched with `encoding: 'jsonParsed'` cannot be decoded. Re-fetch the transaction with `encoding: 'base64'`, `'base58'`, or `'json'`",
6534
+ [SOLANA_ERROR__TRANSACTION_INTROSPECTION__UNRECOGNIZED_GET_TRANSACTION_RESPONSE2]: "Could not recognize the shape of this `getTransaction` response. Expected a response fetched with `encoding: 'base64'`, `'base58'`, or `'json'`",
6535
+ [SOLANA_ERROR__REACT__MISSING_CAPABILITY2]: "`$hookName` requires the following capabilities to be installed on the client: [$capabilities]. $providerHint",
6536
+ [SOLANA_ERROR__REACT__MISSING_PROVIDER2]: "`$hookName` was called outside of a `ClientProvider`. Mount a `<ClientProvider client={client}>` in the ancestor tree.",
6537
+ [SOLANA_ERROR__REACT__SUBSCRIPTION_CLOSED_WITHOUT_ERROR2]: "The subscription closed in an error state but did not report an error.",
6538
+ [SOLANA_ERROR__WALLET__NOT_CONNECTED2]: "Cannot $operation: no wallet connected",
6539
+ [SOLANA_ERROR__WALLET__NO_SIGNER_CONNECTED2]: "No signing wallet connected (status: $status)",
6540
+ [SOLANA_ERROR__WALLET__SIGNER_NOT_AVAILABLE2]: "Connected wallet does not support signing",
6541
+ [SOLANA_ERROR__WALLET__ACCOUNT_NOT_AVAILABLE2]: 'Account $address is not available in wallet "$walletName"'
6542
+ };
6543
+ var INSTRUCTION_ERROR_RANGE_SIZE2 = 1e3;
6544
+ var START_INDEX2 = "i";
6545
+ var TYPE3 = "t";
6546
+ function getHumanReadableErrorMessage2(code, context = {}) {
6547
+ const messageFormatString = SolanaErrorMessages2[code];
6548
+ if (messageFormatString.length === 0) {
6549
+ return "";
6550
+ }
6551
+ let state;
6552
+ function commitStateUpTo(endIndex) {
6553
+ if (state[TYPE3] === 2) {
6554
+ const variableName = messageFormatString.slice(state[START_INDEX2] + 1, endIndex);
6555
+ fragments.push(
6556
+ variableName in context ? (
6557
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
6558
+ `${context[variableName]}`
6559
+ ) : `$${variableName}`
6560
+ );
6561
+ } else if (state[TYPE3] === 1) {
6562
+ fragments.push(messageFormatString.slice(state[START_INDEX2], endIndex));
6563
+ }
6564
+ }
6565
+ const fragments = [];
6566
+ messageFormatString.split("").forEach((char, ii) => {
6567
+ if (ii === 0) {
6568
+ state = {
6569
+ [START_INDEX2]: 0,
6570
+ [TYPE3]: messageFormatString[0] === "\\" ? 0 : messageFormatString[0] === "$" ? 2 : 1
6571
+ /* Text */
6572
+ };
6573
+ return;
6574
+ }
6575
+ let nextState;
6576
+ switch (state[TYPE3]) {
6577
+ case 0:
6578
+ nextState = {
6579
+ [START_INDEX2]: ii,
6580
+ [TYPE3]: 1
6581
+ /* Text */
6582
+ };
6583
+ break;
6584
+ case 1:
6585
+ if (char === "\\") {
6586
+ nextState = {
6587
+ [START_INDEX2]: ii,
6588
+ [TYPE3]: 0
6589
+ /* EscapeSequence */
6590
+ };
6591
+ } else if (char === "$") {
6592
+ nextState = {
6593
+ [START_INDEX2]: ii,
6594
+ [TYPE3]: 2
6595
+ /* Variable */
6596
+ };
6597
+ }
6598
+ break;
6599
+ case 2:
6600
+ if (char === "\\") {
6601
+ nextState = {
6602
+ [START_INDEX2]: ii,
6603
+ [TYPE3]: 0
6604
+ /* EscapeSequence */
6605
+ };
6606
+ } else if (char === "$") {
6607
+ nextState = {
6608
+ [START_INDEX2]: ii,
6609
+ [TYPE3]: 2
6610
+ /* Variable */
6611
+ };
6612
+ } else if (!char.match(/\w/)) {
6613
+ nextState = {
6614
+ [START_INDEX2]: ii,
6615
+ [TYPE3]: 1
6616
+ /* Text */
6617
+ };
6618
+ }
6619
+ break;
6620
+ }
6621
+ if (nextState) {
6622
+ if (state !== nextState) {
6623
+ commitStateUpTo(ii);
6624
+ }
6625
+ state = nextState;
6626
+ }
6627
+ });
6628
+ commitStateUpTo();
6629
+ let message = fragments.join("");
6630
+ if (code >= SOLANA_ERROR__INSTRUCTION_ERROR__UNKNOWN2 && code < SOLANA_ERROR__INSTRUCTION_ERROR__UNKNOWN2 + INSTRUCTION_ERROR_RANGE_SIZE2 && "index" in context) {
6631
+ message += ` (instruction #${context.index + 1})`;
6632
+ }
6633
+ return message;
6634
+ }
6635
+ function getErrorMessage2(code, context = {}) {
6636
+ if (process.env.NODE_ENV !== "production") {
6637
+ return getHumanReadableErrorMessage2(code, context);
6638
+ } else {
6639
+ let decodingAdviceMessage = `Solana error #${code}; Decode this error by running \`npx @solana/errors decode -- ${code}`;
6640
+ if (Object.keys(context).length) {
6641
+ decodingAdviceMessage += ` '${encodeContextObject2(context)}'`;
6642
+ }
6643
+ return `${decodingAdviceMessage}\``;
6644
+ }
6645
+ }
6646
+ function isSolanaError2(e5, code) {
6647
+ const isSolanaError22 = e5 instanceof Error && e5.name === "SolanaError";
6648
+ if (isSolanaError22) {
6649
+ if (code !== void 0) {
6650
+ return e5.context.__code === code;
6651
+ }
6652
+ return true;
6653
+ }
6654
+ return false;
6655
+ }
6656
+ var SolanaError2 = class extends Error {
6657
+ /**
6658
+ * Indicates the root cause of this {@link SolanaError}, if any.
6659
+ *
6660
+ * For example, a transaction error might have an instruction error as its root cause. In this
6661
+ * case, you will be able to access the instruction error on the transaction error as `cause`.
6662
+ */
6663
+ cause = this.cause;
6664
+ /**
6665
+ * Contains context that can assist in understanding or recovering from a {@link SolanaError}.
6666
+ */
6667
+ context;
6668
+ constructor(...[code, contextAndErrorOptions]) {
6669
+ let context;
6670
+ let errorOptions;
6671
+ if (contextAndErrorOptions) {
6672
+ Object.entries(Object.getOwnPropertyDescriptors(contextAndErrorOptions)).forEach(([name, descriptor]) => {
6673
+ if (name === "cause") {
6674
+ errorOptions = { cause: descriptor.value };
6675
+ } else {
6676
+ if (context === void 0) {
6677
+ context = {
6678
+ __code: code
6679
+ };
6680
+ }
6681
+ Object.defineProperty(context, name, descriptor);
6682
+ }
6683
+ });
6684
+ }
6685
+ const message = getErrorMessage2(code, context);
6686
+ super(message, errorOptions);
6687
+ this.context = Object.freeze(
6688
+ context === void 0 ? {
6689
+ __code: code
6690
+ } : context
6691
+ );
6692
+ this.name = "SolanaError";
6693
+ }
6694
+ };
6695
+
6696
+ // ../../node_modules/.pnpm/@solana+codecs-core@8.4.0_typescript@6.0.3/node_modules/@solana/codecs-core/dist/index.node.mjs
6697
+ function padBytes2(bytes, length) {
6698
+ if (bytes.length >= length) return bytes;
6699
+ const paddedBytes = new Uint8Array(length).fill(0);
6700
+ paddedBytes.set(bytes);
6701
+ return paddedBytes;
6702
+ }
6703
+ var fixBytes2 = (bytes, length) => padBytes2(bytes.length <= length ? bytes : bytes.slice(0, length), length);
6704
+ function getEncodedSize2(value, encoder) {
6705
+ return "fixedSize" in encoder ? encoder.fixedSize : encoder.getSizeFromValue(value);
6706
+ }
6707
+ function createEncoder2(encoder) {
6708
+ return Object.freeze({
6709
+ ...encoder,
6710
+ encode: (value) => {
6711
+ const bytes = new Uint8Array(getEncodedSize2(value, encoder));
6712
+ encoder.write(value, bytes, 0);
6713
+ return bytes;
6714
+ }
6715
+ });
6716
+ }
6717
+ function createDecoder2(decoder) {
6718
+ return Object.freeze({
6719
+ ...decoder,
6720
+ decode: (bytes, offset = 0) => decoder.read(bytes, offset)[0]
6721
+ });
6722
+ }
6723
+ function isFixedSize2(codec) {
6724
+ return "fixedSize" in codec && typeof codec.fixedSize === "number";
6725
+ }
6726
+ function isVariableSize2(codec) {
6727
+ return !isFixedSize2(codec);
6728
+ }
6729
+ function combineCodec2(encoder, decoder) {
6730
+ if (isFixedSize2(encoder) !== isFixedSize2(decoder)) {
6731
+ throw new SolanaError2(SOLANA_ERROR__CODECS__ENCODER_DECODER_SIZE_COMPATIBILITY_MISMATCH2);
6732
+ }
6733
+ if (isFixedSize2(encoder) && isFixedSize2(decoder) && encoder.fixedSize !== decoder.fixedSize) {
6734
+ throw new SolanaError2(SOLANA_ERROR__CODECS__ENCODER_DECODER_FIXED_SIZE_MISMATCH2, {
6735
+ decoderFixedSize: decoder.fixedSize,
6736
+ encoderFixedSize: encoder.fixedSize
6737
+ });
6738
+ }
6739
+ if (!isFixedSize2(encoder) && !isFixedSize2(decoder) && encoder.maxSize !== decoder.maxSize) {
6740
+ throw new SolanaError2(SOLANA_ERROR__CODECS__ENCODER_DECODER_MAX_SIZE_MISMATCH2, {
6741
+ decoderMaxSize: decoder.maxSize,
6742
+ encoderMaxSize: encoder.maxSize
6743
+ });
6744
+ }
6745
+ return {
6746
+ ...decoder,
6747
+ ...encoder,
6748
+ decode: decoder.decode,
6749
+ encode: encoder.encode,
6750
+ read: decoder.read,
6751
+ write: encoder.write
6752
+ };
6753
+ }
6754
+ function assertByteArrayHasEnoughBytesForCodec2(codecDescription, expected, bytes, offset = 0) {
6755
+ const bytesLength = bytes.length - offset;
6756
+ if (bytesLength < expected) {
6757
+ throw new SolanaError2(SOLANA_ERROR__CODECS__INVALID_BYTE_LENGTH2, {
6758
+ bytesLength,
6759
+ codecDescription,
6760
+ expected
6761
+ });
6762
+ }
6763
+ }
6764
+ function fixEncoderSize2(encoder, fixedBytes) {
6765
+ return createEncoder2({
6766
+ fixedSize: fixedBytes,
6767
+ write: (value, bytes, offset) => {
6768
+ const variableByteArray = encoder.encode(value);
6769
+ const fixedByteArray = variableByteArray.length > fixedBytes ? variableByteArray.slice(0, fixedBytes) : variableByteArray;
6770
+ bytes.set(fixedByteArray, offset);
6771
+ return offset + fixedBytes;
6772
+ }
6773
+ });
6774
+ }
6775
+ function fixDecoderSize2(decoder, fixedBytes) {
6776
+ return createDecoder2({
6777
+ fixedSize: fixedBytes,
6778
+ read: (bytes, offset) => {
6779
+ assertByteArrayHasEnoughBytesForCodec2("fixCodecSize", fixedBytes, bytes, offset);
6780
+ if (offset > 0 || bytes.length > fixedBytes) {
6781
+ bytes = bytes.slice(offset, offset + fixedBytes);
6782
+ }
6783
+ if (isFixedSize2(decoder)) {
6784
+ bytes = fixBytes2(bytes, decoder.fixedSize);
6785
+ }
6786
+ const [value] = decoder.read(bytes, 0);
6787
+ return [value, offset + fixedBytes];
6788
+ }
6789
+ });
6790
+ }
6791
+ function transformEncoder2(encoder, unmap) {
6792
+ return createEncoder2({
6793
+ ...isVariableSize2(encoder) ? { ...encoder, getSizeFromValue: (value) => encoder.getSizeFromValue(unmap(value)) } : encoder,
6794
+ write: (value, bytes, offset) => encoder.write(unmap(value), bytes, offset)
6795
+ });
6796
+ }
6797
+
6798
+ // ../../node_modules/.pnpm/@solana+codecs-strings@8.4.0_typescript@6.0.3/node_modules/@solana/codecs-strings/dist/index.node.mjs
6799
+ function assertValidBaseString3(alphabet4, testValue, givenValue = testValue) {
6800
+ if (!testValue.match(new RegExp(`^[${alphabet4}]*$`))) {
6801
+ throw new SolanaError2(SOLANA_ERROR__CODECS__INVALID_STRING_FOR_BASE2, {
6802
+ alphabet: alphabet4,
6803
+ base: alphabet4.length,
6804
+ value: givenValue
6805
+ });
6806
+ }
6807
+ }
6808
+ var getBaseXEncoder3 = (alphabet4) => {
6809
+ return createEncoder2({
6810
+ getSizeFromValue: (value) => {
6811
+ const [leadingZeroes, tailChars] = partitionLeadingZeroes3(value, alphabet4[0]);
6812
+ if (!tailChars) return value.length;
6813
+ const base10Number = getBigIntFromBaseX3(tailChars, alphabet4);
6814
+ return leadingZeroes.length + Math.ceil(base10Number.toString(16).length / 2);
6815
+ },
6816
+ write(value, bytes, offset) {
6817
+ assertValidBaseString3(alphabet4, value);
6818
+ if (value === "") return offset;
6819
+ const [leadingZeroes, tailChars] = partitionLeadingZeroes3(value, alphabet4[0]);
6820
+ if (!tailChars) {
6821
+ bytes.set(new Uint8Array(leadingZeroes.length).fill(0), offset);
6822
+ return offset + leadingZeroes.length;
6823
+ }
6824
+ let base10Number = getBigIntFromBaseX3(tailChars, alphabet4);
6825
+ const tailBytes = [];
6826
+ while (base10Number > 0n) {
6827
+ tailBytes.unshift(Number(base10Number % 256n));
6828
+ base10Number /= 256n;
6829
+ }
6830
+ const bytesToAdd = [...Array(leadingZeroes.length).fill(0), ...tailBytes];
6831
+ bytes.set(bytesToAdd, offset);
6832
+ return offset + bytesToAdd.length;
6833
+ }
6834
+ });
6835
+ };
6836
+ var getBaseXDecoder2 = (alphabet4) => {
6837
+ return createDecoder2({
6838
+ read(rawBytes, offset) {
6839
+ const bytes = offset === 0 || offset <= -rawBytes.byteLength ? rawBytes : rawBytes.slice(offset);
6840
+ if (bytes.length === 0) return ["", rawBytes.length];
6841
+ let trailIndex = bytes.findIndex((n) => n !== 0);
6842
+ trailIndex = trailIndex === -1 ? bytes.length : trailIndex;
6843
+ const leadingZeroes = alphabet4[0].repeat(trailIndex);
6844
+ if (trailIndex === bytes.length) return [leadingZeroes, rawBytes.length];
6845
+ const base10Number = bytes.slice(trailIndex).reduce((sum, byte) => sum * 256n + BigInt(byte), 0n);
6846
+ const tailChars = getBaseXFromBigInt2(base10Number, alphabet4);
6847
+ return [leadingZeroes + tailChars, rawBytes.length];
6848
+ }
6849
+ });
6850
+ };
6851
+ function partitionLeadingZeroes3(value, zeroCharacter) {
6852
+ const [leadingZeros, tailChars] = value.split(new RegExp(`((?!${zeroCharacter}).*)`));
6853
+ return [leadingZeros, tailChars];
6854
+ }
6855
+ function getBigIntFromBaseX3(value, alphabet4) {
6856
+ const base = BigInt(alphabet4.length);
6857
+ let sum = 0n;
6858
+ for (const char of value) {
6859
+ sum *= base;
6860
+ sum += BigInt(alphabet4.indexOf(char));
6861
+ }
6862
+ return sum;
6863
+ }
6864
+ function getBaseXFromBigInt2(value, alphabet4) {
6865
+ const base = BigInt(alphabet4.length);
6866
+ const tailChars = [];
6867
+ while (value > 0n) {
6868
+ tailChars.unshift(alphabet4[Number(value % base)]);
6869
+ value /= base;
6870
+ }
6871
+ return tailChars.join("");
6872
+ }
6873
+ var alphabet23 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
6874
+ var getBase58Encoder3 = () => getBaseXEncoder3(alphabet23);
6875
+ var getBase58Decoder2 = () => getBaseXDecoder2(alphabet23);
6876
+ var e4 = globalThis.TextDecoder;
6877
+ var o3 = globalThis.TextEncoder;
6878
+
6879
+ // ../../node_modules/.pnpm/@solana+assertions@8.4.0_typescript@6.0.3/node_modules/@solana/assertions/dist/index.node.mjs
6880
+ function assertDigestCapabilityIsAvailable2() {
6881
+ if (typeof globalThis.crypto === "undefined" || typeof globalThis.crypto.subtle?.digest !== "function") {
6882
+ throw new SolanaError2(SOLANA_ERROR__SUBTLE_CRYPTO__DIGEST_UNIMPLEMENTED2);
6883
+ }
6884
+ }
6885
+
6886
+ // ../../node_modules/.pnpm/@solana+addresses@8.4.0_typescript@6.0.3/node_modules/@solana/addresses/dist/index.node.mjs
6887
+ var memoizedBase58Encoder2;
6888
+ var memoizedBase58Decoder2;
6889
+ function getMemoizedBase58Encoder2() {
6890
+ if (!memoizedBase58Encoder2) memoizedBase58Encoder2 = getBase58Encoder3();
6891
+ return memoizedBase58Encoder2;
6892
+ }
6893
+ function getMemoizedBase58Decoder2() {
6894
+ if (!memoizedBase58Decoder2) memoizedBase58Decoder2 = getBase58Decoder2();
6895
+ return memoizedBase58Decoder2;
6896
+ }
6897
+ function assertIsAddress2(putativeAddress) {
6898
+ if (
6899
+ // Lowest address (32 bytes of zeroes)
6900
+ putativeAddress.length < 32 || // Highest address (32 bytes of 255)
6901
+ putativeAddress.length > 44
6902
+ ) {
6903
+ throw new SolanaError2(SOLANA_ERROR__ADDRESSES__STRING_LENGTH_OUT_OF_RANGE2, {
6904
+ actualLength: putativeAddress.length
6905
+ });
6906
+ }
6907
+ const base58Encoder = getMemoizedBase58Encoder2();
6908
+ const bytes = base58Encoder.encode(putativeAddress);
6909
+ const numBytes = bytes.byteLength;
6910
+ if (numBytes !== 32) {
6911
+ throw new SolanaError2(SOLANA_ERROR__ADDRESSES__INVALID_BYTE_LENGTH2, {
6912
+ actualLength: numBytes
6913
+ });
6914
+ }
6915
+ }
6916
+ function address2(putativeAddress) {
6917
+ assertIsAddress2(putativeAddress);
6918
+ return putativeAddress;
6919
+ }
6920
+ function getAddressEncoder2() {
6921
+ return transformEncoder2(
6922
+ fixEncoderSize2(getMemoizedBase58Encoder2(), 32),
6923
+ (putativeAddress) => address2(putativeAddress)
6924
+ );
6925
+ }
6926
+ function getAddressDecoder2() {
6927
+ return fixDecoderSize2(getMemoizedBase58Decoder2(), 32);
6928
+ }
6929
+ function getAddressCodec2() {
6930
+ return combineCodec2(getAddressEncoder2(), getAddressDecoder2());
6931
+ }
6932
+ var D2 = 37095705934669439343138083508754565189542113879843219016388785533085940283555n;
6933
+ var P2 = 57896044618658097711785492504343953926634992332820282019728792003956564819949n;
6934
+ var RM12 = 19681161376707505956807079304988542015446066515923890162744021073123829784752n;
6935
+ function mod2(a) {
6936
+ const r = a % P2;
6937
+ return r >= 0n ? r : P2 + r;
6938
+ }
6939
+ function pow22(x, power) {
6940
+ let r = x;
6941
+ while (power-- > 0n) {
6942
+ r *= r;
6943
+ r %= P2;
6944
+ }
6945
+ return r;
6946
+ }
6947
+ function pow_2_252_32(x) {
6948
+ const x2 = x * x % P2;
6949
+ const b2 = x2 * x % P2;
6950
+ const b4 = pow22(b2, 2n) * b2 % P2;
6951
+ const b5 = pow22(b4, 1n) * x % P2;
6952
+ const b10 = pow22(b5, 5n) * b5 % P2;
6953
+ const b20 = pow22(b10, 10n) * b10 % P2;
6954
+ const b40 = pow22(b20, 20n) * b20 % P2;
6955
+ const b80 = pow22(b40, 40n) * b40 % P2;
6956
+ const b160 = pow22(b80, 80n) * b80 % P2;
6957
+ const b240 = pow22(b160, 80n) * b80 % P2;
6958
+ const b250 = pow22(b240, 10n) * b10 % P2;
6959
+ const pow_p_5_8 = pow22(b250, 2n) * x % P2;
6960
+ return pow_p_5_8;
6961
+ }
6962
+ function uvRatio2(u, v) {
6963
+ const v3 = mod2(v * v * v);
6964
+ const v7 = mod2(v3 * v3 * v);
6965
+ const pow = pow_2_252_32(u * v7);
6966
+ let x = mod2(u * v3 * pow);
6967
+ const vx2 = mod2(v * x * x);
6968
+ const root1 = x;
6969
+ const root2 = mod2(x * RM12);
6970
+ const useRoot1 = vx2 === u;
6971
+ const useRoot2 = vx2 === mod2(-u);
6972
+ const noRoot = vx2 === mod2(-u * RM12);
6973
+ if (useRoot1) x = root1;
6974
+ if (useRoot2 || noRoot) x = root2;
6975
+ if ((mod2(x) & 1n) === 1n) x = mod2(-x);
6976
+ if (!useRoot1 && !useRoot2) {
6977
+ return null;
6978
+ }
6979
+ return x;
6980
+ }
6981
+ function pointIsOnCurve2(y, lastByte) {
6982
+ const y2 = mod2(y * y);
6983
+ const u = mod2(y2 - 1n);
6984
+ const v = mod2(D2 * y2 + 1n);
6985
+ const x = uvRatio2(u, v);
6986
+ if (x === null) {
6987
+ return false;
6988
+ }
6989
+ const isLastByteOdd = (lastByte & 128) !== 0;
6990
+ if (x === 0n && isLastByteOdd) {
6991
+ return false;
6992
+ }
6993
+ return true;
6994
+ }
6995
+ function byteToHex2(byte) {
6996
+ const hexString = byte.toString(16);
6997
+ if (hexString.length === 1) {
6998
+ return `0${hexString}`;
6999
+ } else {
7000
+ return hexString;
7001
+ }
7002
+ }
7003
+ function decompressPointBytes2(bytes) {
7004
+ const hexString = bytes.reduce((acc, byte, ii) => `${byteToHex2(ii === 31 ? byte & -129 : byte)}${acc}`, "");
7005
+ const integerLiteralString = `0x${hexString}`;
7006
+ return BigInt(integerLiteralString);
7007
+ }
7008
+ function compressedPointBytesAreOnCurve2(bytes) {
7009
+ if (bytes.byteLength !== 32) {
7010
+ return false;
7011
+ }
7012
+ const y = decompressPointBytes2(bytes);
7013
+ return pointIsOnCurve2(y, bytes[31]);
7014
+ }
7015
+ var MAX_SEED_LENGTH2 = 32;
7016
+ var MAX_SEEDS2 = 16;
7017
+ var PDA_MARKER_BYTES2 = [
7018
+ // The string 'ProgramDerivedAddress'
7019
+ 80,
7020
+ 114,
7021
+ 111,
7022
+ 103,
7023
+ 114,
7024
+ 97,
7025
+ 109,
7026
+ 68,
7027
+ 101,
7028
+ 114,
7029
+ 105,
7030
+ 118,
7031
+ 101,
7032
+ 100,
7033
+ 65,
7034
+ 100,
7035
+ 100,
7036
+ 114,
7037
+ 101,
7038
+ 115,
7039
+ 115
7040
+ ];
7041
+ async function createProgramDerivedAddress2({ programAddress, seeds }) {
7042
+ assertDigestCapabilityIsAvailable2();
7043
+ if (seeds.length > MAX_SEEDS2) {
7044
+ throw new SolanaError2(SOLANA_ERROR__ADDRESSES__MAX_NUMBER_OF_PDA_SEEDS_EXCEEDED2, {
7045
+ actual: seeds.length,
7046
+ maxSeeds: MAX_SEEDS2
7047
+ });
7048
+ }
7049
+ let textEncoder;
7050
+ const seedBytes = seeds.reduce((acc, seed, ii) => {
7051
+ const bytes = typeof seed === "string" ? (textEncoder ||= new TextEncoder()).encode(seed) : seed;
7052
+ if (bytes.byteLength > MAX_SEED_LENGTH2) {
7053
+ throw new SolanaError2(SOLANA_ERROR__ADDRESSES__MAX_PDA_SEED_LENGTH_EXCEEDED2, {
7054
+ actual: bytes.byteLength,
7055
+ index: ii,
7056
+ maxSeedLength: MAX_SEED_LENGTH2
7057
+ });
7058
+ }
7059
+ acc.push(...bytes);
7060
+ return acc;
7061
+ }, []);
7062
+ const base58EncodedAddressCodec = getAddressCodec2();
7063
+ const programAddressBytes = base58EncodedAddressCodec.encode(programAddress);
7064
+ const addressBytesBuffer = await crypto.subtle.digest(
7065
+ "SHA-256",
7066
+ new Uint8Array([...seedBytes, ...programAddressBytes, ...PDA_MARKER_BYTES2])
7067
+ );
7068
+ const addressBytes = new Uint8Array(addressBytesBuffer);
7069
+ if (compressedPointBytesAreOnCurve2(addressBytes)) {
7070
+ throw new SolanaError2(SOLANA_ERROR__ADDRESSES__INVALID_SEEDS_POINT_ON_CURVE2);
7071
+ }
7072
+ return base58EncodedAddressCodec.decode(addressBytes);
7073
+ }
7074
+ async function getProgramDerivedAddress2({
7075
+ programAddress,
7076
+ seeds
7077
+ }) {
7078
+ let bumpSeed = 255;
7079
+ while (bumpSeed > 0) {
7080
+ try {
7081
+ const address22 = await createProgramDerivedAddress2({
7082
+ programAddress,
7083
+ seeds: [...seeds, new Uint8Array([bumpSeed])]
7084
+ });
7085
+ return [address22, bumpSeed];
7086
+ } catch (e5) {
7087
+ if (isSolanaError2(e5, SOLANA_ERROR__ADDRESSES__INVALID_SEEDS_POINT_ON_CURVE2)) {
7088
+ bumpSeed--;
7089
+ } else {
7090
+ throw e5;
7091
+ }
7092
+ }
7093
+ }
7094
+ throw new SolanaError2(SOLANA_ERROR__ADDRESSES__FAILED_TO_FIND_VIABLE_PDA_BUMP_SEED2);
7095
+ }
7096
+
7097
+ // ../../node_modules/.pnpm/@solana+codecs-numbers@8.4.0_typescript@6.0.3/node_modules/@solana/codecs-numbers/dist/index.node.mjs
7098
+ function assertNumberIsBetweenForCodec2(codecDescription, min, max, value) {
7099
+ if (value < min || value > max) {
7100
+ throw new SolanaError2(SOLANA_ERROR__CODECS__NUMBER_OUT_OF_RANGE2, {
7101
+ codecDescription,
7102
+ max,
7103
+ min,
7104
+ value
7105
+ });
7106
+ }
7107
+ }
7108
+ function isLittleEndian2(config) {
7109
+ return config?.endian === 1 ? false : true;
7110
+ }
7111
+ function numberEncoderFactory2(input) {
7112
+ return createEncoder2({
7113
+ fixedSize: input.size,
7114
+ write(value, bytes, offset) {
7115
+ if (input.range) {
7116
+ assertNumberIsBetweenForCodec2(input.name, input.range[0], input.range[1], value);
7117
+ }
7118
+ const arrayBuffer = new ArrayBuffer(input.size);
7119
+ input.set(new DataView(arrayBuffer), value, isLittleEndian2(input.config));
7120
+ bytes.set(new Uint8Array(arrayBuffer), offset);
7121
+ return offset + input.size;
7122
+ }
7123
+ });
7124
+ }
7125
+ var getU64Encoder2 = (config = {}) => numberEncoderFactory2({
7126
+ config,
7127
+ name: "u64",
7128
+ range: [0n, BigInt("0xffffffffffffffff")],
7129
+ set: (view, value, le) => view.setBigUint64(0, BigInt(value), le),
7130
+ size: 8
7131
+ });
7132
+ var getU8Encoder2 = () => numberEncoderFactory2({
7133
+ name: "u8",
7134
+ range: [0, Number("0xff")],
7135
+ set: (view, value) => view.setUint8(0, Number(value)),
7136
+ size: 1
7137
+ });
7138
+
7139
+ // ../../node_modules/.pnpm/@solana+codecs-data-structures@8.4.0_typescript@6.0.3/node_modules/@solana/codecs-data-structures/dist/index.node.mjs
7140
+ function sumCodecSizes2(sizes) {
7141
+ return sizes.reduce((all, size) => all === null || size === null ? null : all + size, 0);
7142
+ }
7143
+ function getFixedSize2(codec) {
7144
+ return isFixedSize2(codec) ? codec.fixedSize : null;
7145
+ }
7146
+ function getMaxSize2(codec) {
7147
+ return isFixedSize2(codec) ? codec.fixedSize : codec.maxSize ?? null;
7148
+ }
7149
+ function getStructEncoder2(fields) {
7150
+ const fieldCodecs = fields.map(([, codec]) => codec);
7151
+ const fixedSize = sumCodecSizes2(fieldCodecs.map(getFixedSize2));
7152
+ const maxSize = sumCodecSizes2(fieldCodecs.map(getMaxSize2)) ?? void 0;
7153
+ return createEncoder2({
7154
+ ...fixedSize === null ? {
7155
+ getSizeFromValue: (value) => fields.map(([key, codec]) => getEncodedSize2(value[key], codec)).reduce((all, one) => all + one, 0),
7156
+ maxSize
7157
+ } : { fixedSize },
7158
+ write: (struct, bytes, offset) => {
7159
+ fields.forEach(([key, codec]) => {
7160
+ offset = codec.write(struct[key], bytes, offset);
7161
+ });
7162
+ return offset;
7163
+ }
7164
+ });
7165
+ }
7166
+
7167
+ // ../../node_modules/.pnpm/@solana+instructions@8.4.0_typescript@6.0.3/node_modules/@solana/instructions/dist/index.node.mjs
7168
+ var AccountRole2 = /* @__PURE__ */ ((AccountRole22) => {
7169
+ AccountRole22[AccountRole22["WRITABLE_SIGNER"] = /* 3 */
7170
+ 3] = "WRITABLE_SIGNER";
7171
+ AccountRole22[AccountRole22["READONLY_SIGNER"] = /* 2 */
7172
+ 2] = "READONLY_SIGNER";
7173
+ AccountRole22[AccountRole22["WRITABLE"] = /* 1 */
7174
+ 1] = "WRITABLE";
7175
+ AccountRole22[AccountRole22["READONLY"] = /* 0 */
7176
+ 0] = "READONLY";
7177
+ return AccountRole22;
7178
+ })(AccountRole2 || {});
7179
+ var IS_SIGNER_BITMASK2 = 2;
7180
+ function upgradeRoleToSigner2(role) {
7181
+ return role | IS_SIGNER_BITMASK2;
7182
+ }
7183
+
7184
+ // ../../node_modules/.pnpm/@solana+signers@8.4.0_typescript@6.0.3/node_modules/@solana/signers/dist/index.node.mjs
7185
+ function isTransactionModifyingSigner2(value) {
7186
+ return "modifyAndSignTransactions" in value && typeof value.modifyAndSignTransactions === "function";
7187
+ }
7188
+ function isTransactionPartialSigner2(value) {
7189
+ return "signTransactions" in value && typeof value.signTransactions === "function";
7190
+ }
7191
+ function isTransactionSendingSigner2(value) {
7192
+ return "signAndSendTransactions" in value && typeof value.signAndSendTransactions === "function";
7193
+ }
7194
+ function isTransactionSigner2(value) {
7195
+ return isTransactionPartialSigner2(value) || isTransactionModifyingSigner2(value) || isTransactionSendingSigner2(value);
7196
+ }
7197
+ var o4 = globalThis.TextEncoder;
7198
+
7199
+ // ../../node_modules/.pnpm/@solana+program-client-core@8.4.0_typescript@6.0.3/node_modules/@solana/program-client-core/dist/index.node.mjs
5838
7200
  function getNonNullResolvedInstructionInput(inputName, value) {
5839
7201
  if (value === null || value === void 0) {
5840
- throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__RESOLVED_INSTRUCTION_INPUT_MUST_BE_NON_NULL, {
7202
+ throw new SolanaError2(SOLANA_ERROR__PROGRAM_CLIENTS__RESOLVED_INSTRUCTION_INPUT_MUST_BE_NON_NULL2, {
5841
7203
  inputName
5842
7204
  });
5843
7205
  }
@@ -5857,7 +7219,7 @@ function getAccountMetaFactory(programAddress, optionalAccountStrategy) {
5857
7219
  return (inputName, account) => {
5858
7220
  if (!account.value) {
5859
7221
  if (optionalAccountStrategy === "omitted") return;
5860
- return Object.freeze({ address: programAddress, role: AccountRole.READONLY });
7222
+ return Object.freeze({ address: programAddress, role: AccountRole2.READONLY });
5861
7223
  }
5862
7224
  if (hasExplicitRole(account.value)) {
5863
7225
  return Object.freeze({
@@ -5869,14 +7231,14 @@ function getAccountMetaFactory(programAddress, optionalAccountStrategy) {
5869
7231
  const idlIsSigner = account.isSigner ?? "either";
5870
7232
  const isSigner = idlIsSigner !== false && isResolvedInstructionAccountSigner(account.value);
5871
7233
  if (!isSigner && idlIsSigner === true) {
5872
- throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__RESOLVED_INSTRUCTION_INPUT_MUST_BE_SIGNER, {
7234
+ throw new SolanaError2(SOLANA_ERROR__PROGRAM_CLIENTS__RESOLVED_INSTRUCTION_INPUT_MUST_BE_SIGNER2, {
5873
7235
  inputName
5874
7236
  });
5875
7237
  }
5876
- const writableRole = account.isWritable ? AccountRole.WRITABLE : AccountRole.READONLY;
7238
+ const writableRole = account.isWritable ? AccountRole2.WRITABLE : AccountRole2.READONLY;
5877
7239
  return Object.freeze({
5878
7240
  address: getAddressFromResolvedInstructionAccount(inputName, account.value),
5879
- role: isSigner ? upgradeRoleToSigner(writableRole) : writableRole,
7241
+ role: isSigner ? upgradeRoleToSigner2(writableRole) : writableRole,
5880
7242
  ...isSigner ? { signer: account.value } : {}
5881
7243
  });
5882
7244
  };
@@ -5885,7 +7247,7 @@ function hasExplicitRole(value) {
5885
7247
  return typeof value === "object" && "role" in value && typeof value.role === "number";
5886
7248
  }
5887
7249
  function isResolvedInstructionAccountSigner(value) {
5888
- return !!value && typeof value === "object" && "address" in value && typeof value.address === "string" && isTransactionSigner(value);
7250
+ return !!value && typeof value === "object" && "address" in value && typeof value.address === "string" && isTransactionSigner2(value);
5889
7251
  }
5890
7252
 
5891
7253
  // ../../node_modules/.pnpm/@solana-program+token@0.17.0_@solana+kit@8.4.0/node_modules/@solana-program/token/dist/src/index.mjs
@@ -5893,18 +7255,18 @@ async function findAssociatedTokenPda(seeds, config = {}) {
5893
7255
  const {
5894
7256
  programAddress = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
5895
7257
  } = config;
5896
- return await getProgramDerivedAddress({
7258
+ return await getProgramDerivedAddress2({
5897
7259
  programAddress,
5898
7260
  seeds: [
5899
- getAddressEncoder().encode(seeds.owner),
5900
- getAddressEncoder().encode(seeds.tokenProgram),
5901
- getAddressEncoder().encode(seeds.mint)
7261
+ getAddressEncoder2().encode(seeds.owner),
7262
+ getAddressEncoder2().encode(seeds.tokenProgram),
7263
+ getAddressEncoder2().encode(seeds.mint)
5902
7264
  ]
5903
7265
  });
5904
7266
  }
5905
7267
  var CREATE_ASSOCIATED_TOKEN_IDEMPOTENT_DISCRIMINATOR = 1;
5906
7268
  function getCreateAssociatedTokenIdempotentInstructionDataEncoder() {
5907
- return transformEncoder(getStructEncoder([["discriminator", getU8Encoder()]]), (value) => ({
7269
+ return transformEncoder2(getStructEncoder2([["discriminator", getU8Encoder2()]]), (value) => ({
5908
7270
  ...value,
5909
7271
  discriminator: CREATE_ASSOCIATED_TOKEN_IDEMPOTENT_DISCRIMINATOR
5910
7272
  }));
@@ -5942,11 +7304,11 @@ function getCreateAssociatedTokenIdempotentInstruction(input, config) {
5942
7304
  }
5943
7305
  var TRANSFER_CHECKED_DISCRIMINATOR = 12;
5944
7306
  function getTransferCheckedInstructionDataEncoder() {
5945
- return transformEncoder(
5946
- getStructEncoder([
5947
- ["discriminator", getU8Encoder()],
5948
- ["amount", getU64Encoder()],
5949
- ["decimals", getU8Encoder()]
7307
+ return transformEncoder2(
7308
+ getStructEncoder2([
7309
+ ["discriminator", getU8Encoder2()],
7310
+ ["amount", getU64Encoder2()],
7311
+ ["decimals", getU8Encoder2()]
5950
7312
  ]),
5951
7313
  (value) => ({ ...value, discriminator: TRANSFER_CHECKED_DISCRIMINATOR })
5952
7314
  );
@@ -6278,6 +7640,9 @@ async function signWalletWrite(scope, change) {
6278
7640
  }
6279
7641
 
6280
7642
  // src/lib/tap-enrol.ts
7643
+ var TAP_WAIT_POLL_INTERVAL_MS = 3e3;
7644
+ var TAP_WAIT_DEFAULT_TIMEOUT_SECONDS = 900;
7645
+ var TAP_WAIT_MAX_TIMEOUT_SECONDS = 3600;
6281
7646
  function verifierEnrolmentMessage(chainId) {
6282
7647
  return `TAP keys cannot be enrolled on chain ${chainId} from the CLI: TAP is off there, or the verifier's registrar is not available. The stored key stays unenrolled. To use a key the verifier issued, import it with 'taskmarket tap import --key-id <id> --key-file <path> --signature-agent <url> --force'.`;
6283
7648
  }
@@ -6316,11 +7681,80 @@ async function enrolTapKey(stored, chainId) {
6316
7681
  { chainId, publicKey: stored.publicKey, ...proof },
6317
7682
  { headers: auth.headers }
6318
7683
  );
6319
- return data;
7684
+ if (data.status === "card_verification_required") {
7685
+ if (typeof data.sessionId !== "string" || data.sessionId.length === 0 || typeof data.verificationUrl !== "string" || data.verificationUrl.length === 0 || typeof data.expiresAt !== "string" || data.expiresAt.length === 0 || typeof data.chainId !== "number") {
7686
+ throw new Error(
7687
+ `The card verification handoff answer is malformed: ${JSON.stringify(data)}`
7688
+ );
7689
+ }
7690
+ return {
7691
+ status: "card_verification_required",
7692
+ sessionId: data.sessionId,
7693
+ verificationUrl: data.verificationUrl,
7694
+ expiresAt: data.expiresAt,
7695
+ chainId: data.chainId
7696
+ };
7697
+ }
7698
+ return {
7699
+ status: "enrolled",
7700
+ enrolment: {
7701
+ keyId: data.keyId,
7702
+ algorithm: data.algorithm,
7703
+ chainId: data.chainId,
7704
+ ...typeof data.signatureAgent === "string" ? { signatureAgent: data.signatureAgent } : {}
7705
+ }
7706
+ };
6320
7707
  } catch (error) {
6321
7708
  throw explainEnrolFailure(error, chainId);
6322
7709
  }
6323
7710
  }
7711
+ async function readTapEnrolmentStatus(sessionId) {
7712
+ const auth = await signReadAuth();
7713
+ if (!auth || Object.keys(auth.headers).length === 0) {
7714
+ throw new Error("Checking TAP enrolment status needs a wallet. Run `taskmarket init` first.");
7715
+ }
7716
+ const data = await apiGet(`/api/tap/enrolments/${encodeURIComponent(sessionId)}`, {
7717
+ headers: auth.headers
7718
+ });
7719
+ if (typeof data !== "object" || data === null || data.status !== "pending" && data.status !== "completed" && data.status !== "expired" || typeof data.chainId !== "number") {
7720
+ throw new Error(`The TAP enrolment status answer is malformed: ${JSON.stringify(data)}`);
7721
+ }
7722
+ return data;
7723
+ }
7724
+ async function waitForTapEnrolment(sessionId, opts) {
7725
+ const pollIntervalMs = opts.pollIntervalMs ?? TAP_WAIT_POLL_INTERVAL_MS;
7726
+ const sleep4 = opts.sleep ?? ((ms2) => new Promise((r) => setTimeout(r, ms2)));
7727
+ const now = opts.now ?? (() => Date.now());
7728
+ const deadline = now() + opts.timeoutMs;
7729
+ while (true) {
7730
+ const state = await readTapEnrolmentStatus(sessionId);
7731
+ if (state.status === "completed") {
7732
+ if (typeof state.keyId !== "string" || state.keyId.length === 0) {
7733
+ throw new Error(
7734
+ `The completed TAP enrolment session has no key id: ${JSON.stringify(state)}`
7735
+ );
7736
+ }
7737
+ return {
7738
+ keyId: state.keyId,
7739
+ algorithm: state.algorithm,
7740
+ chainId: state.chainId,
7741
+ ...typeof state.signatureAgent === "string" ? { signatureAgent: state.signatureAgent } : {}
7742
+ };
7743
+ }
7744
+ if (state.status === "expired") {
7745
+ throw new Error(
7746
+ "The TAP card verification session expired before completion. Run 'taskmarket tap enrol' again to get a new verification link."
7747
+ );
7748
+ }
7749
+ const remainingMs = deadline - now();
7750
+ if (remainingMs <= 0) {
7751
+ throw new Error(
7752
+ "Timed out waiting for Visa card verification. Have the agent owner finish at the verification link or run 'taskmarket tap enrol' again."
7753
+ );
7754
+ }
7755
+ await sleep4(Math.min(pollIntervalMs, remainingMs));
7756
+ }
7757
+ }
6324
7758
  function withTapEnrolment(stored, enrolment) {
6325
7759
  if (typeof enrolment.keyId !== "string" || typeof enrolment.chainId !== "number") {
6326
7760
  throw new Error(`The enrolment answer has no key id: ${JSON.stringify(enrolment)}`);
@@ -6413,6 +7847,7 @@ async function addSolanaWallet() {
6413
7847
  await saveKeystore({ ...keystore, ...solanaKeystoreFields(dek, wallet) });
6414
7848
  printResult({ address: keystore.walletAddress, solanaAddress: wallet.address });
6415
7849
  }
7850
+ var TAP_CARD_VERIFICATION_NEXT_STEP = "Have the agent owner open verificationUrl in a browser to link a Visa card, then re-run 'taskmarket tap enrol' (or run with --wait).";
6416
7851
  async function tryEnrolTapKey(tapKey, chainId, warnings) {
6417
7852
  const retryCommand = "taskmarket tap enrol";
6418
7853
  if (chainId === void 0) {
@@ -6423,12 +7858,22 @@ async function tryEnrolTapKey(tapKey, chainId, warnings) {
6423
7858
  { retryCommand }
6424
7859
  )
6425
7860
  );
6426
- return tapKey;
7861
+ return { tapKey };
6427
7862
  }
6428
7863
  try {
6429
- const enrolled = withTapEnrolment(tapKey, await enrolTapKey(tapKey, chainId));
7864
+ const outcome = await enrolTapKey(tapKey, chainId);
7865
+ if (outcome.status === "card_verification_required") {
7866
+ return {
7867
+ tapKey,
7868
+ tapVerification: {
7869
+ ...outcome,
7870
+ nextStep: TAP_CARD_VERIFICATION_NEXT_STEP
7871
+ }
7872
+ };
7873
+ }
7874
+ const enrolled = withTapEnrolment(tapKey, outcome.enrolment);
6430
7875
  await saveKeystore({ ...await loadKeystore(), tapKey: enrolled });
6431
- return enrolled;
7876
+ return { tapKey: enrolled };
6432
7877
  } catch (err) {
6433
7878
  const reason = err?.envelope?.reason;
6434
7879
  warnings.push(
@@ -6438,7 +7883,7 @@ async function tryEnrolTapKey(tapKey, chainId, warnings) {
6438
7883
  { chainId, ...typeof reason === "string" ? { reason } : {}, retryCommand }
6439
7884
  )
6440
7885
  );
6441
- return tapKey;
7886
+ return { tapKey };
6442
7887
  }
6443
7888
  }
6444
7889
  async function addTapKey() {
@@ -6453,8 +7898,19 @@ async function addTapKey() {
6453
7898
  const created = storedTapKey(dek, null, generateTapKey(), /* @__PURE__ */ new Date(), "created");
6454
7899
  await saveKeystore({ ...keystore, tapKey: created });
6455
7900
  const warnings = [];
6456
- const tapKey = await tryEnrolTapKey(created, selectedNetworkOrUndefined()?.chainId, warnings);
6457
- printResult({ address: keystore.walletAddress, tapKey: tapKeySummary(tapKey) }, { warnings });
7901
+ const { tapKey, tapVerification } = await tryEnrolTapKey(
7902
+ created,
7903
+ selectedNetworkOrUndefined()?.chainId,
7904
+ warnings
7905
+ );
7906
+ printResult(
7907
+ {
7908
+ address: keystore.walletAddress,
7909
+ tapKey: tapKeySummary(tapKey),
7910
+ ...tapVerification ? { tapVerification } : {}
7911
+ },
7912
+ { warnings }
7913
+ );
6458
7914
  }
6459
7915
  var initCommand = new Command2("init").description(
6460
7916
  "Create and register this machine's agent wallet (one-time; refuses when a wallet exists)"
@@ -6481,7 +7937,7 @@ var initCommand = new Command2("init").description(
6481
7937
  return;
6482
7938
  }
6483
7939
  await ensureInitNetwork();
6484
- const { privateKey, address: address2 } = generateKeypair();
7940
+ const { privateKey, address: address3 } = generateKeypair();
6485
7941
  const solanaWallet = await generateSolanaKeypair();
6486
7942
  const publicKey = deriveCompressedPublicKey(privateKey);
6487
7943
  const legalBundle = LegalBundleSchema.parse(await apiGet("/api/legal/current"));
@@ -6489,11 +7945,11 @@ var initCommand = new Command2("init").description(
6489
7945
  assumeYes: Boolean(opts.yes),
6490
7946
  bundle: legalBundle,
6491
7947
  signMessage: (message) => privateKeyToAccount(privateKey).signMessage({ message }),
6492
- walletAddress: address2
7948
+ walletAddress: address3
6493
7949
  }) : void 0;
6494
7950
  const deviceRegisterSignature = await privateKeyToAccount(
6495
7951
  privateKey
6496
- ).signMessage({ message: buildDeviceRegisterMessage(address2) });
7952
+ ).signMessage({ message: buildDeviceRegisterMessage(address3) });
6497
7953
  const {
6498
7954
  deviceId,
6499
7955
  apiToken,
@@ -6503,14 +7959,14 @@ var initCommand = new Command2("init").description(
6503
7959
  legalReceipt: legalAcceptance?.receipt,
6504
7960
  publicKey,
6505
7961
  signature: deviceRegisterSignature,
6506
- walletAddress: address2
7962
+ walletAddress: address3
6507
7963
  });
6508
7964
  const encryptedKey = encryptPrivateKey(deviceEncryptionKey, privateKey);
6509
7965
  const createdTapKey = opts.tap ? storedTapKey(deviceEncryptionKey, null, generateTapKey(), /* @__PURE__ */ new Date(), "created") : void 0;
6510
7966
  let agentId = initialAgentId;
6511
7967
  const newKeystore = {
6512
7968
  encryptedKey,
6513
- walletAddress: address2,
7969
+ walletAddress: address3,
6514
7970
  deviceId,
6515
7971
  apiToken,
6516
7972
  agentId,
@@ -6537,7 +7993,7 @@ var initCommand = new Command2("init").description(
6537
7993
  return;
6538
7994
  }
6539
7995
  if (!agentId) {
6540
- agentId = await pollAgentId(address2);
7996
+ agentId = await pollAgentId(address3);
6541
7997
  if (agentId) {
6542
7998
  const keystore = await loadKeystore();
6543
7999
  await saveKeystore(
@@ -6560,10 +8016,10 @@ var initCommand = new Command2("init").description(
6560
8016
  renderFailure(err);
6561
8017
  return;
6562
8018
  }
6563
- const tapKey = createdTapKey ? await tryEnrolTapKey(createdTapKey, selectedNetwork().chainId, warnings) : void 0;
8019
+ const tapAttempt = createdTapKey ? await tryEnrolTapKey(createdTapKey, selectedNetwork().chainId, warnings) : void 0;
6564
8020
  printResult(
6565
8021
  {
6566
- address: address2,
8022
+ address: address3,
6567
8023
  agentId,
6568
8024
  solanaAddress: solanaWallet.address,
6569
8025
  network: chain?.networkName ?? networkInfo?.networkName,
@@ -6571,9 +8027,10 @@ var initCommand = new Command2("init").description(
6571
8027
  paymentMethod: chain?.paymentMethod,
6572
8028
  feeModel: chain?.feeModel,
6573
8029
  emailAddress,
6574
- ...tapKey ? { tapKey: tapKeySummary(tapKey) } : {}
8030
+ ...tapAttempt ? { tapKey: tapKeySummary(tapAttempt.tapKey) } : {},
8031
+ ...tapAttempt?.tapVerification ? { tapVerification: tapAttempt.tapVerification } : {}
6575
8032
  },
6576
- { warnings, next: nextAfterInit({ address: address2, chainId: selectedNetwork().chainId }) }
8033
+ { warnings, next: nextAfterInit({ address: address3, chainId: selectedNetwork().chainId }) }
6577
8034
  );
6578
8035
  });
6579
8036
 
@@ -6607,22 +8064,22 @@ var startCommand = new Command3("start").description(
6607
8064
  printError("No keystore found. Run `taskmarket init` first.");
6608
8065
  return;
6609
8066
  }
6610
- const address2 = auth.walletAddress;
8067
+ const address3 = auth.walletAddress;
6611
8068
  const chainId = selectedNetwork().chainId;
6612
8069
  const [balance, queue, withdrawal, open] = await Promise.all([
6613
8070
  settle(
6614
8071
  () => apiGet(
6615
- `/api/wallet/balance?${new URLSearchParams({ address: address2, chainId: String(chainId) })}`
8072
+ `/api/wallet/balance?${new URLSearchParams({ address: address3, chainId: String(chainId) })}`
6616
8073
  )
6617
8074
  ),
6618
8075
  settle(
6619
- () => apiGet(`/api/agents/action-queue?${new URLSearchParams({ address: address2, limit: "50" })}`, {
8076
+ () => apiGet(`/api/agents/action-queue?${new URLSearchParams({ address: address3, limit: "50" })}`, {
6620
8077
  headers: auth.headers
6621
8078
  })
6622
8079
  ),
6623
8080
  settle(
6624
8081
  () => apiGet(
6625
- `/api/wallet/withdrawal-address?${new URLSearchParams({ address: address2, chainId: String(chainId) })}`
8082
+ `/api/wallet/withdrawal-address?${new URLSearchParams({ address: address3, chainId: String(chainId) })}`
6626
8083
  )
6627
8084
  ),
6628
8085
  settle(
@@ -6636,7 +8093,7 @@ var startCommand = new Command3("start").description(
6636
8093
  const needsYou = queue ? queue.total : null;
6637
8094
  printResult(
6638
8095
  {
6639
- address: address2,
8096
+ address: address3,
6640
8097
  network: selectedNetwork().name,
6641
8098
  chainId,
6642
8099
  balance: balance ? {
@@ -6661,7 +8118,7 @@ var startCommand = new Command3("start").description(
6661
8118
  },
6662
8119
  {
6663
8120
  next: nextForHome({
6664
- address: address2,
8121
+ address: address3,
6665
8122
  chainId,
6666
8123
  balanceBaseUnits: balance?.balanceBaseUnits,
6667
8124
  needsYou: needsYou ?? 0,
@@ -7060,9 +8517,9 @@ identityCommand.command("status").description("Check identity registration statu
7060
8517
  identityCommand.command("feedback").description(
7061
8518
  "Show the agent your requester feedback is bound to and the protocol reputation feedback values"
7062
8519
  ).option("--address <address>", "Wallet to read (defaults to this wallet)").action(async (options) => {
7063
- const address2 = options.address ?? (await loadKeystore()).walletAddress;
8520
+ const address3 = options.address ?? (await loadKeystore()).walletAddress;
7064
8521
  const result = await apiGet(
7065
- `/api/identity/requester-feedback?address=${address2}&chainId=${selectedNetwork().chainId}`
8522
+ `/api/identity/requester-feedback?address=${address3}&chainId=${selectedNetwork().chainId}`
7066
8523
  );
7067
8524
  printResult(result);
7068
8525
  });
@@ -7174,12 +8631,12 @@ async function platformView(opts) {
7174
8631
  printResult(await apiGet(withChainId(`/api/stats/activity-heatmap?${query(input2)}`)));
7175
8632
  return true;
7176
8633
  }
7177
- let address2 = opts.address;
7178
- if (!address2 && !opts.agent) {
7179
- address2 = (await loadKeystore()).walletAddress;
8634
+ let address3 = opts.address;
8635
+ if (!address3 && !opts.agent) {
8636
+ address3 = (await loadKeystore()).walletAddress;
7180
8637
  }
7181
8638
  const input = parseInput(AgentTimeSeriesInputSchema, {
7182
- address: opts.agent ? void 0 : address2,
8639
+ address: opts.agent ? void 0 : address3,
7183
8640
  agentId: opts.agent,
7184
8641
  range: opts.range,
7185
8642
  bucket: opts.bucket
@@ -7194,20 +8651,20 @@ var statsCommand = new Command7("stats").description("View agent or platform-wid
7194
8651
  renderFailure(err);
7195
8652
  return;
7196
8653
  }
7197
- let address2 = opts.address;
7198
- if (!address2) {
8654
+ let address3 = opts.address;
8655
+ if (!address3) {
7199
8656
  const keystore = await loadKeystore();
7200
- address2 = keystore.walletAddress;
8657
+ address3 = keystore.walletAddress;
7201
8658
  }
7202
8659
  const statsQuery = withChainId(
7203
- opts.agent ? `/api/agents/stats?agentId=${opts.agent}` : `/api/agents/stats?address=${address2}`
8660
+ opts.agent ? `/api/agents/stats?agentId=${opts.agent}` : `/api/agents/stats?address=${address3}`
7204
8661
  );
7205
8662
  const [result, balanceResult, dreamsResult, exchangeRateResult] = await Promise.all([
7206
8663
  apiGet(statsQuery),
7207
8664
  apiGet(
7208
- `/api/wallet/balance?address=${address2}&chainId=${selectedNetwork().chainId}`
8665
+ `/api/wallet/balance?address=${address3}&chainId=${selectedNetwork().chainId}`
7209
8666
  ),
7210
- apiGet(withChainId(`/api/wallet/dreams-balance?address=${address2}`)).then(
8667
+ apiGet(withChainId(`/api/wallet/dreams-balance?address=${address3}`)).then(
7211
8668
  (r) => r
7212
8669
  ).catch(() => null),
7213
8670
  apiGet(withChainId("/api/wallet/exchange-rate")).then((r) => r).catch(() => null)
@@ -7333,11 +8790,11 @@ var statsCommand2 = new Command8("stats").description("Market totals and the act
7333
8790
  renderFailure(err);
7334
8791
  }
7335
8792
  });
7336
- var addressCommand2 = new Command8("address").description("One wallet on the selected --network: earnings, completed tasks, rating, events").argument("<address>", "wallet address (0x...)").option("--range <days>", `Window in days: ${RANGES.join(", ")} (default 30)`).action(async (address2, opts) => {
8793
+ var addressCommand2 = new Command8("address").description("One wallet on the selected --network: earnings, completed tasks, rating, events").argument("<address>", "wallet address (0x...)").option("--range <days>", `Window in days: ${RANGES.join(", ")} (default 30)`).action(async (address3, opts) => {
7337
8794
  try {
7338
- if (!ADDRESS_PATTERN.test(address2)) throw new Error("address must be a 0x wallet address");
8795
+ if (!ADDRESS_PATTERN.test(address3)) throw new Error("address must be a 0x wallet address");
7339
8796
  const windowDays = parseRange(opts.range, "30");
7340
- const wanted = address2.toLowerCase();
8797
+ const wanted = address3.toLowerCase();
7341
8798
  const [snapshot, page] = await Promise.all([
7342
8799
  apiGet(snapshotPath(windowDays, NODE_LIMIT)),
7343
8800
  apiGet(
@@ -7373,8 +8830,8 @@ function directTarget(query4) {
7373
8830
  return { type: "task", id, command: `taskmarket task get ${id}` };
7374
8831
  }
7375
8832
  if (ADDRESS_PATTERN2.test(query4)) {
7376
- const address2 = query4.toLowerCase();
7377
- return { type: "address", address: address2, command: `taskmarket explorer address ${address2}` };
8833
+ const address3 = query4.toLowerCase();
8834
+ return { type: "address", address: address3, command: `taskmarket explorer address ${address3}` };
7378
8835
  }
7379
8836
  return null;
7380
8837
  }
@@ -8157,8 +9614,8 @@ function parseRequirementFilter(value, schema, flag) {
8157
9614
  }
8158
9615
 
8159
9616
  // src/lib/hook-registry.ts
8160
- async function fetchHookRegistry(address2) {
8161
- const query4 = address2 ? `?address=${address2}` : "";
9617
+ async function fetchHookRegistry(address3) {
9618
+ const query4 = address3 ? `?address=${address3}` : "";
8162
9619
  return await apiGet(withChainId(`/api/hooks/registry${query4}`));
8163
9620
  }
8164
9621
  async function describeHookListings(hooks, alwaysListed = [], known) {
@@ -8171,20 +9628,20 @@ async function describeHookListings(hooks, alwaysListed = [], known) {
8171
9628
  return null;
8172
9629
  }
8173
9630
  const listed = new Map(registry.listed.map((entry) => [entry.address.toLowerCase(), entry]));
8174
- const implicit = new Set(alwaysListed.map((address2) => address2.toLowerCase()));
9631
+ const implicit = new Set(alwaysListed.map((address3) => address3.toLowerCase()));
8175
9632
  const listings = [];
8176
9633
  const warnings = [];
8177
9634
  for (const raw of hooks) {
8178
- const address2 = raw.toLowerCase();
8179
- const entry = listed.get(address2);
8180
- const isListed = entry !== void 0 || implicit.has(address2);
8181
- listings.push({ address: address2, listed: isListed, name: entry?.name ?? null });
9635
+ const address3 = raw.toLowerCase();
9636
+ const entry = listed.get(address3);
9637
+ const isListed = entry !== void 0 || implicit.has(address3);
9638
+ listings.push({ address: address3, listed: isListed, name: entry?.name ?? null });
8182
9639
  if (!isListed) {
8183
9640
  warnings.push(
8184
9641
  cliWarning(
8185
9642
  "hook_unlisted",
8186
- `Hook ${address2} is not listed in the hook registry for chain ${registry.chainId}. It was attached as given; run \`taskmarket hooks list\` for listed hooks.`,
8187
- { address: address2, chainId: registry.chainId }
9643
+ `Hook ${address3} is not listed in the hook registry for chain ${registry.chainId}. It was attached as given; run \`taskmarket hooks list\` for listed hooks.`,
9644
+ { address: address3, chainId: registry.chainId }
8188
9645
  )
8189
9646
  );
8190
9647
  }
@@ -8766,8 +10223,8 @@ var FILLED_FLAGS = [
8766
10223
  ["evaluationWindow", "--evaluation-window"],
8767
10224
  ["evaluatorStake", "--evaluator-stake"]
8768
10225
  ];
8769
- async function fetchListedEvaluator(address2) {
8770
- const wallet = parseInput(EthAddressSchema, address2);
10226
+ async function fetchListedEvaluator(address3) {
10227
+ const wallet = parseInput(EthAddressSchema, address3);
8771
10228
  const params = new URLSearchParams({
8772
10229
  address: wallet,
8773
10230
  limit: "1",
@@ -8787,13 +10244,13 @@ async function fetchListedEvaluator(address2) {
8787
10244
  }
8788
10245
  return entry;
8789
10246
  }
8790
- async function evaluatorFlagsFromListing(address2, opts) {
10247
+ async function evaluatorFlagsFromListing(address3, opts) {
8791
10248
  for (const [key, flag] of FILLED_FLAGS) {
8792
10249
  if (opts[key] !== void 0) {
8793
10250
  throw new Error(`--evaluator-from-listing fills ${flag} from the listing; leave it out`);
8794
10251
  }
8795
10252
  }
8796
- const listing = await fetchListedEvaluator(address2);
10253
+ const listing = await fetchListedEvaluator(address3);
8797
10254
  const { feeBps, evaluationWindowHours, stakeUsd } = listing.service;
8798
10255
  return {
8799
10256
  listing,
@@ -9099,7 +10556,7 @@ var createCmd = new Command12("create").description("Create a new task (costs th
9099
10556
  "Only workers with one of these identities may claim, pitch, bid, submit proofs or submit work (comma-separated; any one is enough): erc8004:identity:registered, erc8004:reputation:reputable"
9100
10557
  ).option(
9101
10558
  "--require-verified <verifiers>",
9102
- "Only workers one of these verifiers passes may work on the task (comma-separated; any one is enough): tap:identity:known (any agent registered with TAP; the level to use) or tap:identity:verified (agents the verifier reviewed by hand; the verifier does not use this level yet). With --require-identity too, both must be met."
10559
+ "Only workers one of these verifiers passes may work on the task (comma-separated; any one is enough): tap:identity:verified (TAP Verified: any agent whose key the verifier lists). With --require-identity too, both must be met."
9103
10560
  ).option("--tags <tags>", "Comma-separated tags").option(
9104
10561
  "--capabilities <slugs>",
9105
10562
  "Comma-separated capability slugs the task needs, from `taskmarket capabilities` (active entries only; capped like a listing)"
@@ -9148,7 +10605,7 @@ var createCmd = new Command12("create").description("Create a new task (costs th
9148
10605
  "Attach the payout gate; it opens on its own this long from now, e.g. 48h, 7d (1h to 180d). Without --gated-by, link the gating task later with `taskmarket task link-gate`"
9149
10606
  ).option(
9150
10607
  "--gates <taskIds>",
9151
- "Make this task the gating task of your own gated tasks (repeat, or comma-separated; at most 16), each with a payout gate and no gating task yet: their payouts wait on this one. Not with --gated-by or --gate-deadline",
10608
+ "Make this task the gating task of your own gated tasks (repeat, or comma-separated; at most 16), each with a payout gate and no gating task yet: their payouts wait on this one. You must be each task's requester (the gate also accepts a project operator). Not with --gated-by or --gate-deadline",
9152
10609
  (value, previous = []) => [
9153
10610
  ...previous,
9154
10611
  ...value.split(",").map((id) => id.trim()).filter(Boolean)
@@ -9522,17 +10979,17 @@ async function runCreateTask(input, extra = {}) {
9522
10979
  const hookConfigs = /* @__PURE__ */ new Map();
9523
10980
  for (const raw of opts.hookConfig ?? []) {
9524
10981
  const separator = raw.indexOf("=");
9525
- const address2 = separator > 0 ? raw.slice(0, separator).trim() : "";
9526
- if (!ethAddrRe.test(address2)) {
10982
+ const address3 = separator > 0 ? raw.slice(0, separator).trim() : "";
10983
+ if (!ethAddrRe.test(address3)) {
9527
10984
  return void printError("--hook-config must be <address>=<config> with a valid hook address");
9528
10985
  }
9529
- if (!hooks.some((hook) => hook.toLowerCase() === address2.toLowerCase())) {
9530
- return void printError(`--hook-config names ${address2}, which is not attached with --hook`);
10986
+ if (!hooks.some((hook) => hook.toLowerCase() === address3.toLowerCase())) {
10987
+ return void printError(`--hook-config names ${address3}, which is not attached with --hook`);
9531
10988
  }
9532
- if (hookConfigs.has(address2.toLowerCase())) {
9533
- return void printError(`--hook-config is given twice for ${address2}`);
10989
+ if (hookConfigs.has(address3.toLowerCase())) {
10990
+ return void printError(`--hook-config is given twice for ${address3}`);
9534
10991
  }
9535
- hookConfigs.set(address2.toLowerCase(), raw.slice(separator + 1));
10992
+ hookConfigs.set(address3.toLowerCase(), raw.slice(separator + 1));
9536
10993
  }
9537
10994
  let hookRegistry = null;
9538
10995
  const needsRegistry = Boolean(opts.gateDeadline) || gatesTargets.length > 0 || [...hookConfigs.values()].some((value) => !value.trim().startsWith("0x"));
@@ -9870,7 +11327,7 @@ var listCmd = new Command13("list").alias("search").description("List available
9870
11327
  "Only tasks that require this worker identity: erc8004:identity:registered or erc8004:reputation:reputable"
9871
11328
  ).option(
9872
11329
  "--verified-by <verifier>",
9873
- "Only tasks that require this verifier: tap:identity:known or tap:identity:verified"
11330
+ "Only tasks that require this verifier: tap:identity:verified"
9874
11331
  ).option("--limit <n>", "Maximum results to return", "20").option(
9875
11332
  "--cursor <cursor>",
9876
11333
  "Cursor from previous page (nextCursor in JSON output); pass it with the same --sort and filters"
@@ -10053,12 +11510,12 @@ async function confirmStakeTerms(action, taskId, yes) {
10053
11510
  );
10054
11511
  return false;
10055
11512
  }
10056
- async function confirmStakeAffordable(address2, stake) {
11513
+ async function confirmStakeAffordable(address3, stake) {
10057
11514
  if (stake <= 0n) return true;
10058
11515
  let balance;
10059
11516
  try {
10060
11517
  const result = await apiGet(
10061
- `/api/wallet/balance?address=${address2}&chainId=${selectedNetwork().chainId}`
11518
+ `/api/wallet/balance?address=${address3}&chainId=${selectedNetwork().chainId}`
10062
11519
  );
10063
11520
  if (typeof result?.balanceBaseUnits !== "string") return true;
10064
11521
  balance = BigInt(result.balanceBaseUnits);
@@ -10897,12 +12354,12 @@ var listCmd2 = new Command20("list").description(
10897
12354
  if (tab === null) {
10898
12355
  return void printError(`--tab must be one of: ${HIRE_TABS.join(", ")}`);
10899
12356
  }
10900
- const address2 = opts.address ?? (await loadKeystore()).walletAddress;
12357
+ const address3 = opts.address ?? (await loadKeystore()).walletAddress;
10901
12358
  const result = await listTasks(cliTaskReadContext(), {
10902
12359
  status: "ALL",
10903
12360
  hire: true,
10904
12361
  // Offers to a worker are reserved hires; a requester's hires include quotes and requests.
10905
- ...opts.role === "worker" ? { hireKind: HireKind.enum.reserved, reservedWorker: address2 } : { requester: address2 },
12362
+ ...opts.role === "worker" ? { hireKind: HireKind.enum.reserved, reservedWorker: address3 } : { requester: address3 },
10906
12363
  hireState: opts.state,
10907
12364
  hireTab: tab,
10908
12365
  hireServiceId: opts.service,
@@ -11197,7 +12654,7 @@ var SubmissionPageSchema = TaskChildListSchema.pick({ cursor: true }).extend({
11197
12654
  });
11198
12655
  var submissionsCmd = new Command29("submissions").description("List submissions for a task").argument("<taskId>", "Task ID (0x-prefixed hex)").option(
11199
12656
  "--passed-check <provider>",
11200
- "Only submissions whose worker passed this check when submitting: erc8004:identity:registered, erc8004:reputation:reputable, tap:identity:known or tap:identity:verified"
12657
+ "Only submissions whose worker passed this check when submitting: erc8004:identity:registered, erc8004:reputation:reputable, or tap:identity:verified"
11201
12658
  ).option("--limit <n>", "Page size (1-500); without it every submission is listed").option("--cursor <id>", "Last returned id; read the following page").option("--ids <ids>", "Only these submissions: comma-separated ids (at most 50)").action(
11202
12659
  async (taskId, opts) => {
11203
12660
  const passedCheck = parseRequirementFilter(opts.passedCheck, CHECK_FILTER, "--passed-check");
@@ -11634,7 +13091,7 @@ var updateCmd = new Command41("update").description(
11634
13091
  "Replace the identity requirement (comma-separated, any one is enough: erc8004:identity:registered, erc8004:reputation:reputable; none clears it). Refused once a worker has committed."
11635
13092
  ).option(
11636
13093
  "--require-verified <verifiers>",
11637
- "Replace the verifier requirement (comma-separated, any one is enough: tap:identity:known, tap:identity:verified; none clears it). tap:identity:known accepts any agent registered with TAP; tap:identity:verified needs one the verifier reviewed by hand, a level it does not use yet. Refused once a worker has committed."
13094
+ "Replace the verifier requirement (comma-separated, any one is enough: tap:identity:verified; none clears it). tap:identity:verified (TAP Verified) accepts any agent whose key the verifier lists. Refused once a worker has committed."
11638
13095
  ).action(
11639
13096
  async (taskId, opts) => {
11640
13097
  const body = { taskId };
@@ -12055,7 +13512,7 @@ var unlockCmd = new Command49("unlock").description("Unlock a private task with
12055
13512
 
12056
13513
  // src/commands/task/invite.ts
12057
13514
  import { Command as Command50 } from "commander";
12058
- var inviteCmd = new Command50("invite").description("Invite a wallet to view a private task (requester only)").argument("<taskId>", "Task ID (0x-prefixed hex)").argument("<address>", "Wallet address to invite").action(async (taskId, address2) => {
13515
+ var inviteCmd = new Command50("invite").description("Invite a wallet to view a private task (requester only)").argument("<taskId>", "Task ID (0x-prefixed hex)").argument("<address>", "Wallet address to invite").action(async (taskId, address3) => {
12059
13516
  const auth = await signReadAuth();
12060
13517
  if (!auth || Object.keys(auth.headers).length === 0) {
12061
13518
  printError("No keystore found. Run `taskmarket init` first.");
@@ -12064,7 +13521,7 @@ var inviteCmd = new Command50("invite").description("Invite a wallet to view a p
12064
13521
  try {
12065
13522
  const { data: result, idempotencyKey } = await apiPost(
12066
13523
  `/api/tasks/${taskId}/private-access/viewers`,
12067
- { taskId, viewerAddress: address2 },
13524
+ { taskId, viewerAddress: address3 },
12068
13525
  { headers: auth.headers }
12069
13526
  );
12070
13527
  printResult(result, { idempotencyKey });
@@ -12075,7 +13532,7 @@ var inviteCmd = new Command50("invite").description("Invite a wallet to view a p
12075
13532
 
12076
13533
  // src/commands/task/uninvite.ts
12077
13534
  import { Command as Command51 } from "commander";
12078
- var uninviteCmd = new Command51("uninvite").description("Remove a wallet from a private task's allowlist (requester only)").argument("<taskId>", "Task ID (0x-prefixed hex)").argument("<address>", "Wallet address to remove").action(async (taskId, address2) => {
13535
+ var uninviteCmd = new Command51("uninvite").description("Remove a wallet from a private task's allowlist (requester only)").argument("<taskId>", "Task ID (0x-prefixed hex)").argument("<address>", "Wallet address to remove").action(async (taskId, address3) => {
12079
13536
  const auth = await signReadAuth();
12080
13537
  if (!auth || Object.keys(auth.headers).length === 0) {
12081
13538
  printError("No keystore found. Run `taskmarket init` first.");
@@ -12083,7 +13540,7 @@ var uninviteCmd = new Command51("uninvite").description("Remove a wallet from a
12083
13540
  }
12084
13541
  try {
12085
13542
  const { data: result, idempotencyKey } = await apiDelete(
12086
- `/api/tasks/${taskId}/private-access/viewers/${encodeURIComponent(address2)}`,
13543
+ `/api/tasks/${taskId}/private-access/viewers/${encodeURIComponent(address3)}`,
12087
13544
  { headers: auth.headers }
12088
13545
  );
12089
13546
  printResult(result, { idempotencyKey });
@@ -12496,7 +13953,7 @@ async function runAgentCommand(options) {
12496
13953
  try {
12497
13954
  const { assertAgentCompatibility } = await import("./compatibility-636WJOEX.js");
12498
13955
  const pi = assertAgentCompatibility();
12499
- const { runAgent } = await import("./launch-K5666QYB.js");
13956
+ const { runAgent } = await import("./launch-TMSW4WPX.js");
12500
13957
  result = await runAgent({
12501
13958
  model: options.model,
12502
13959
  pi,
@@ -12569,25 +14026,25 @@ function wholeNumber(flag, value) {
12569
14026
  function hoursToSecs2(flag, value) {
12570
14027
  return Math.round(positiveNumber(flag, value) * HOUR);
12571
14028
  }
12572
- async function fetchListing(address2) {
14029
+ async function fetchListing(address3) {
12573
14030
  const auth = await signReadAuth();
12574
- const result = await apiGet(`/api/agents/${address2}/listing`, { headers: auth?.headers });
14031
+ const result = await apiGet(`/api/agents/${address3}/listing`, { headers: auth?.headers });
12575
14032
  return AgentListingSchema.parse(result);
12576
14033
  }
12577
- async function fetchServiceRecords(address2, chainId) {
14034
+ async function fetchServiceRecords(address3, chainId) {
12578
14035
  try {
12579
14036
  const params = new URLSearchParams({ chainId: String(chainId) });
12580
14037
  const parsed = AgentServiceRecordsResponseSchema.safeParse(
12581
- await apiGet(`/api/agents/${address2}/hires/services?${params.toString()}`)
14038
+ await apiGet(`/api/agents/${address3}/hires/services?${params.toString()}`)
12582
14039
  );
12583
14040
  return parsed.success ? parsed.data : null;
12584
14041
  } catch {
12585
14042
  return null;
12586
14043
  }
12587
14044
  }
12588
- async function fetchHireAvailability(address2) {
14045
+ async function fetchHireAvailability(address3) {
12589
14046
  try {
12590
- const params = new URLSearchParams({ worker: address2 });
14047
+ const params = new URLSearchParams({ worker: address3 });
12591
14048
  const parsed = HireAvailabilitySchema.safeParse(
12592
14049
  await apiGet(`/api/tasks/hire-availability?${params.toString()}`)
12593
14050
  );
@@ -12758,11 +14215,16 @@ function serviceInputFromStored(service) {
12758
14215
  deliveryPeriodSecs: service.deliveryPeriodSecs,
12759
14216
  ...service.acceptBySecs !== null ? { acceptBySecs: service.acceptBySecs } : {},
12760
14217
  ...service.terms ? { terms: service.terms } : {},
12761
- ...service.requiresEvaluator ? { requiresEvaluator: true } : {}
14218
+ ...service.requiresEvaluator ? { requiresEvaluator: true } : {},
14219
+ ...service.hireAcceptPolicy === "ask" ? { hireAcceptPolicy: "ask" } : {}
12762
14220
  };
12763
14221
  }
12764
14222
  if (service.kind === "quote") {
12765
- return { ...base, ...service.requiresEvaluator ? { requiresEvaluator: true } : {} };
14223
+ return {
14224
+ ...base,
14225
+ ...service.requiresEvaluator ? { requiresEvaluator: true } : {},
14226
+ ...service.hireAcceptPolicy === "ask" ? { hireAcceptPolicy: "ask" } : {}
14227
+ };
12766
14228
  }
12767
14229
  return {
12768
14230
  ...base,
@@ -12801,6 +14263,13 @@ function buildServiceInput(opts, base = {}) {
12801
14263
  if (opts.requiresEvaluator) service.requiresEvaluator = true;
12802
14264
  else delete service.requiresEvaluator;
12803
14265
  }
14266
+ if (opts.hirePolicy !== void 0) {
14267
+ const policy = parseInput(ServiceHireAcceptPolicySchema, opts.hirePolicy);
14268
+ if (service.kind === "evaluation") {
14269
+ throw new Error("--hire-policy applies only to fixed and quote services");
14270
+ }
14271
+ service.hireAcceptPolicy = policy;
14272
+ }
12804
14273
  return service;
12805
14274
  }
12806
14275
  function addServiceOptions(command) {
@@ -12813,7 +14282,10 @@ function addServiceOptions(command) {
12813
14282
  ).option("--title <title>", "Service title").option("--description <text>", "What the service covers").option("--deliverable <text>", "What the requester receives").option("--specialty <label>", "A specialty label or slug (repeatable; at least one)", collect3).option("--chain <chain>", "A chain requesters may pay on, by name or id (repeatable)", collect3).option("--all-chains", "Accept every chain you are registered on (the default)").option("--price <usd>", "fixed: price in USD, e.g. 25 or 12.50").option("--delivery <hours>", "fixed: delivery period in hours").option("--accept-by <hours>", "fixed: hours you have to accept a hire (default 72)").option("--terms-preset <name>", "fixed: settlement terms preset for hires").option("--fee-bps <bps>", "evaluation: your fee in basis points").option("--evaluation-window <hours>", "evaluation: hours you take to evaluate").option("--stake <usd>", "evaluation: stake the requester puts behind you, in USD").option(
12814
14283
  "--requires-evaluator",
12815
14284
  "fixed or quote: a hire of this service must name an evaluator before it is accepted"
12816
- ).option("--no-requires-evaluator", "fixed or quote: hires need no evaluator (the default)");
14285
+ ).option("--no-requires-evaluator", "fixed or quote: hires need no evaluator (the default)").option(
14286
+ "--hire-policy <policy>",
14287
+ `fixed or quote: hire acceptance policy (${SERVICE_HIRE_ACCEPT_POLICIES.join(" or ")}; default auto)`
14288
+ );
12817
14289
  }
12818
14290
  var serviceCommand = new Command58("service").description(
12819
14291
  "Your listing services: the priced offers requesters hire you for"
@@ -12879,9 +14351,9 @@ var availabilityCommand = new Command58("availability").description(
12879
14351
  });
12880
14352
  var listingCommand = new Command58("listing").description(
12881
14353
  "Show your listing, or another worker's, with whether it is taking hires now and each service's track record on the selected --network"
12882
- ).argument("[address]", "Wallet address; your own when left out").action(async (address2) => {
14354
+ ).argument("[address]", "Wallet address; your own when left out").action(async (address3) => {
12883
14355
  try {
12884
- const listing = address2 ? await fetchListing(address2) : await ownListing();
14356
+ const listing = address3 ? await fetchListing(address3) : await ownListing();
12885
14357
  const network = selectedNetworkOrUndefined();
12886
14358
  const [records, hireAvailability] = await Promise.all([
12887
14359
  network && listing.listed && listing.services.length > 0 ? fetchServiceRecords(listing.address, network.chainId) : null,
@@ -12930,13 +14402,13 @@ function agentManagementCommands() {
12930
14402
  const status = new Command59("status").description(
12931
14403
  "Show the agent channels (locked, charged, refundable), purchases with an unknown outcome, the sandbox and compute credit. Reads only."
12932
14404
  ).action(async () => {
12933
- const { collectAgentStatus } = await import("./status-YKFKGTMQ.js");
14405
+ const { collectAgentStatus } = await import("./status-VQ7V3CIS.js");
12934
14406
  await run(() => collectAgentStatus());
12935
14407
  });
12936
14408
  const doctor = new Command59("doctor").description(
12937
14409
  "Check that the agent can start: Node and the bundled runtime, wallet and policy, channels, API, sandbox broker, host keys, xgate and RPC. Reads only."
12938
14410
  ).action(async () => {
12939
- const { runDoctor } = await import("./doctor-FACAMASV.js");
14411
+ const { runDoctor } = await import("./doctor-UA5ST7KE.js");
12940
14412
  const report = await run(() => runDoctor());
12941
14413
  if (report && !report.ok) process.exitCode = 1;
12942
14414
  });
@@ -12947,7 +14419,7 @@ function agentManagementCommands() {
12947
14419
  "Reconcile the open purchases of this channel, as status lists it; also reaches retired channels"
12948
14420
  ).action(
12949
14421
  async (invocationId, options) => {
12950
- const { reconcileChannelPurchases, reconcileInvocation } = await import("./reconcile-Q4MJXXR3.js");
14422
+ const { reconcileChannelPurchases, reconcileInvocation } = await import("./reconcile-VVNRBYY7.js");
12951
14423
  const choice = { rail: options.rail, channel: options.channel };
12952
14424
  if (invocationId !== void 0) {
12953
14425
  await run(() => reconcileInvocation(invocationId, { choice }));
@@ -12979,7 +14451,7 @@ function agentManagementCommands() {
12979
14451
  `Not a USDC amount: ${options.amount} (digits, at most 6 decimals)`
12980
14452
  );
12981
14453
  }
12982
- const { openAgentChannels, requestTopUp, selectRail, withdrawalHatch } = await import("./channels-4YOMV7R7.js");
14454
+ const { openAgentChannels, requestTopUp, selectRail, withdrawalHatch } = await import("./channels-K4AKXBRM.js");
12983
14455
  const { rails } = await openAgentChannels();
12984
14456
  const result = await requestTopUp(selectRail(rails, options.rail), amount2);
12985
14457
  return {
@@ -12999,8 +14471,8 @@ function agentManagementCommands() {
12999
14471
  await run(async () => {
13000
14472
  await requireExperimental();
13001
14473
  const { AGENT_VIEW_VERSION } = await import("./budget-view-J6L7X6EY.js");
13002
- const { closeChannel, openAgentChannels, selectChannel } = await import("./channels-4YOMV7R7.js");
13003
- const { reconcileLeasedPurchase } = await import("./reconcile-Q4MJXXR3.js");
14474
+ const { closeChannel, openAgentChannels, selectChannel } = await import("./channels-K4AKXBRM.js");
14475
+ const { reconcileLeasedPurchase } = await import("./reconcile-VVNRBYY7.js");
13004
14476
  const opened = await openAgentChannels();
13005
14477
  const { rail, retired } = selectChannel(opened, options);
13006
14478
  const result = await closeChannel(
@@ -13054,7 +14526,7 @@ function agentManagementCommands() {
13054
14526
  async (options) => {
13055
14527
  await run(async () => {
13056
14528
  await requireExperimental();
13057
- const { runPull } = await import("./sync-pull-AN2M344W.js");
14529
+ const { runPull } = await import("./sync-pull-UKSVJFMY.js");
13058
14530
  const { terminalPrompter } = await import("./prompter-LSICEYSQ.js");
13059
14531
  return runPull(options, {
13060
14532
  interactive: Boolean(process.stdin.isTTY && process.stdout.isTTY),
@@ -13134,7 +14606,7 @@ var agentsCommand = new Command61("agents").description("Browse the worker direc
13134
14606
  "Filter by actor kind: agent, human (the web directory filtered to humans) or hosted"
13135
14607
  ).option(
13136
14608
  "--verified-by <verifier>",
13137
- "Only agents this verifier passed within the last 30 days: tap:identity:known (any agent registered with TAP) or tap:identity:verified (reviewed by hand; not yet used by the verifier)"
14609
+ "Only agents this verifier passed within the last 30 days: tap:identity:verified (TAP Verified: any agent whose key the verifier lists)"
13138
14610
  ).option(
13139
14611
  "--availability <availability>",
13140
14612
  "available (open and under capacity), unavailable (paused or fully booked) or any",
@@ -13206,15 +14678,71 @@ async function installedSkillsFor(wallet) {
13206
14678
  return {};
13207
14679
  }
13208
14680
  }
14681
+ async function resolveAgentTarget(target) {
14682
+ if (target.startsWith("@")) {
14683
+ const handle = normalizeShopHandle(target);
14684
+ if (!handle || !SHOP_HANDLE_REGEX.test(handle)) {
14685
+ throw new Error(
14686
+ `Invalid shopfront handle "${target}". Expected @handle with 3 to 30 lowercase letters, digits, or hyphens.`
14687
+ );
14688
+ }
14689
+ let resolved;
14690
+ try {
14691
+ resolved = await apiGet(`/api/shopfronts/handle/${encodeURIComponent(handle)}`);
14692
+ } catch (err) {
14693
+ const status = err && typeof err === "object" && "status" in err && typeof err.status === "number" ? err.status : void 0;
14694
+ if (status === 404) {
14695
+ throw new Error(`Shopfront handle "@${handle}" not found`);
14696
+ }
14697
+ throw err;
14698
+ }
14699
+ const parsed = ShopHandleResolveResultSchema.safeParse(resolved);
14700
+ if (!parsed.success) {
14701
+ throw new Error(`Shopfront handle "@${handle}" could not be resolved`);
14702
+ }
14703
+ return parseInput(EthAddressSchema, parsed.data.walletAddress);
14704
+ }
14705
+ return parseInput(EthAddressSchema, target);
14706
+ }
14707
+ async function fetchPublicShopfront(wallet) {
14708
+ try {
14709
+ const parsed = AgentShopfrontPublicSchema.safeParse(
14710
+ await apiGet(`/api/shopfronts/${encodeURIComponent(wallet)}`)
14711
+ );
14712
+ if (!parsed.success) return null;
14713
+ const {
14714
+ handle,
14715
+ shopStatus,
14716
+ crew,
14717
+ samples,
14718
+ webring,
14719
+ trophies,
14720
+ guestbookEnabled,
14721
+ guestbookCount
14722
+ } = parsed.data;
14723
+ return {
14724
+ handle,
14725
+ shopStatus,
14726
+ crew,
14727
+ samples,
14728
+ webring,
14729
+ trophies,
14730
+ guestbookEnabled,
14731
+ guestbookCount
14732
+ };
14733
+ } catch {
14734
+ return null;
14735
+ }
14736
+ }
13209
14737
  agentsCommand.command("get").description(
13210
- "Show a worker's record (agent or human) on the selected --network, or on every chain"
13211
- ).argument("<address>", "Wallet address of the worker").option("--all-chains", "List the worker's records on every served chain").option(
14738
+ "Show a worker's record (agent or human) by wallet address or @handle on the selected --network, or on every chain"
14739
+ ).argument("<target>", "Wallet address or @handle of the worker").option("--all-chains", "List the worker's records on every served chain").option(
13212
14740
  "--hires",
13213
14741
  "Add the worker's hire record, each listed service's record (serviceRecords) and the workers it hired (see `taskmarket agents hires`)"
13214
- ).action(async (address2, opts) => {
14742
+ ).action(async (target, opts) => {
13215
14743
  let wallet;
13216
14744
  try {
13217
- wallet = parseInput(EthAddressSchema, address2);
14745
+ wallet = await resolveAgentTarget(target);
13218
14746
  } catch (err) {
13219
14747
  renderFailure(err);
13220
14748
  return;
@@ -13234,14 +14762,16 @@ agentsCommand.command("get").description(
13234
14762
  printResult(result);
13235
14763
  return;
13236
14764
  }
13237
- const [skills2, hireAvailability2] = await Promise.all([
14765
+ const [skills2, hireAvailability2, shopfront2] = await Promise.all([
13238
14766
  installedSkillsFor(wallet),
13239
- fetchHireAvailability(wallet)
14767
+ fetchHireAvailability(wallet),
14768
+ fetchPublicShopfront(wallet)
13240
14769
  ]);
13241
14770
  printResult({
13242
14771
  ...parsed.data,
13243
14772
  ...skills2,
13244
14773
  ...hireAvailability2 ? { hireAvailability: hireAvailability2 } : {},
14774
+ ...shopfront2 ? { shopfront: shopfront2 } : {},
13245
14775
  chains: parsed.data.chains.map((entry) => ({
13246
14776
  ...entry,
13247
14777
  earningsToken: paymentTokenSymbol(entry.chainId)
@@ -13251,12 +14781,18 @@ agentsCommand.command("get").description(
13251
14781
  }
13252
14782
  const { chainId } = selectedNetwork();
13253
14783
  const params = new URLSearchParams({ address: wallet, chainId: String(chainId) });
13254
- const [stats, skills, hireAvailability] = await Promise.all([
14784
+ const [stats, skills, hireAvailability, shopfront] = await Promise.all([
13255
14785
  apiGet(`/api/agents/stats?${params.toString()}`),
13256
14786
  installedSkillsFor(wallet),
13257
- fetchHireAvailability(wallet)
14787
+ fetchHireAvailability(wallet),
14788
+ fetchPublicShopfront(wallet)
13258
14789
  ]);
13259
- const record = stats && typeof stats === "object" ? { ...stats, ...skills, ...hireAvailability ? { hireAvailability } : {} } : stats;
14790
+ const record = stats && typeof stats === "object" ? {
14791
+ ...stats,
14792
+ ...skills,
14793
+ ...hireAvailability ? { hireAvailability } : {},
14794
+ ...shopfront ? { shopfront } : {}
14795
+ } : stats;
13260
14796
  if (!opts.hires) {
13261
14797
  printResult(record);
13262
14798
  return;
@@ -13289,9 +14825,9 @@ agentsCommand.command("hires").description(
13289
14825
  "--role <role>",
13290
14826
  `${AGENT_HIRES_ROLES.join(" (hires of this wallet) or ")} (hires this wallet made)`,
13291
14827
  "worker"
13292
- ).option("--limit <n>", "Maximum public hires to list (1 to 50)", "20").option("--offset <n>", "Public hires to skip", "0").action(async (address2, opts) => {
14828
+ ).option("--limit <n>", "Maximum public hires to list (1 to 50)", "20").option("--offset <n>", "Public hires to skip", "0").action(async (address3, opts) => {
13293
14829
  try {
13294
- const wallet = parseInput(EthAddressSchema, address2);
14830
+ const wallet = parseInput(EthAddressSchema, address3);
13295
14831
  const role = parseInput(AgentHiresRoleSchema, opts.role);
13296
14832
  const limit = parseInput(AgentHiresInputSchema.shape.limit, Number(opts.limit));
13297
14833
  const offset = parseInput(AgentHiresInputSchema.shape.offset, Number(opts.offset));
@@ -13344,12 +14880,12 @@ agentsCommand.command("specialties").description("List the specialties workers a
13344
14880
  renderFailure(err);
13345
14881
  }
13346
14882
  });
13347
- agentsCommand.command("report").description("Report a worker's listing, or one of its services, to Taskmarket staff").argument("<address>", "Wallet address of the reported worker").requiredOption("--reason <reason>", `One of: ${AGENT_LISTING_REPORT_REASONS.join(", ")}`).option("--service <serviceId>", "Report this service only").option("--note <text>", "What is wrong, for staff").action(async (address2, opts) => {
14883
+ agentsCommand.command("report").description("Report a worker's listing, or one of its services, to Taskmarket staff").argument("<address>", "Wallet address of the reported worker").requiredOption("--reason <reason>", `One of: ${AGENT_LISTING_REPORT_REASONS.join(", ")}`).option("--service <serviceId>", "Report this service only").option("--note <text>", "What is wrong, for staff").action(async (address3, opts) => {
13348
14884
  try {
13349
14885
  const auth = await signReadAuth();
13350
14886
  const signedIn = auth !== null && Object.keys(auth.headers).length > 0;
13351
14887
  const body = parseInput(AgentListingReportInputSchema, {
13352
- listingAddress: address2,
14888
+ listingAddress: address3,
13353
14889
  ...signedIn ? { walletAddress: auth.walletAddress } : {},
13354
14890
  ...opts.service ? { serviceId: opts.service } : {},
13355
14891
  reason: opts.reason,
@@ -13570,23 +15106,23 @@ var dashboardCommand = new Command62("dashboard").description(
13570
15106
  printError("No keystore found. Run `taskmarket init` first.");
13571
15107
  return;
13572
15108
  }
13573
- const address2 = auth.walletAddress;
15109
+ const address3 = auth.walletAddress;
13574
15110
  const chainId = selectedNetwork().chainId;
13575
15111
  const headers = auth.headers;
13576
15112
  const owner = new URLSearchParams({
13577
- owner: address2,
15113
+ owner: address3,
13578
15114
  status: "all",
13579
15115
  limit: String(AUTOMATIONS_READ_LIMIT)
13580
15116
  });
13581
15117
  const [queue, inbox, workflows, schedules, projects, balance, activity] = await Promise.all([
13582
15118
  settle2(
13583
- () => apiGet(`/api/agents/action-queue?${new URLSearchParams({ address: address2, limit: "50" })}`, {
15119
+ () => apiGet(`/api/agents/action-queue?${new URLSearchParams({ address: address3, limit: "50" })}`, {
13584
15120
  headers
13585
15121
  })
13586
15122
  ),
13587
15123
  settle2(
13588
15124
  () => apiGet(
13589
- `/api/agents/inbox?${new URLSearchParams({ address: address2, sort: "attention", limit: String(DASHBOARD_TASK_LIMIT) })}`,
15125
+ `/api/agents/inbox?${new URLSearchParams({ address: address3, sort: "attention", limit: String(DASHBOARD_TASK_LIMIT) })}`,
13590
15126
  { headers }
13591
15127
  )
13592
15128
  ),
@@ -13599,13 +15135,13 @@ var dashboardCommand = new Command62("dashboard").description(
13599
15135
  settle2(
13600
15136
  () => apiGet(
13601
15137
  withChainId(
13602
- `/api/projects?${new URLSearchParams({ address: address2, role: "owner", status: "open", limit: String(PROJECTS_READ_LIMIT) })}`
15138
+ `/api/projects?${new URLSearchParams({ address: address3, role: "owner", status: "open", limit: String(PROJECTS_READ_LIMIT) })}`
13603
15139
  )
13604
15140
  )
13605
15141
  ),
13606
15142
  settle2(
13607
15143
  () => apiGet(
13608
- `/api/wallet/balance?${new URLSearchParams({ address: address2, chainId: String(chainId) })}`
15144
+ `/api/wallet/balance?${new URLSearchParams({ address: address3, chainId: String(chainId) })}`
13609
15145
  )
13610
15146
  ),
13611
15147
  settle2(
@@ -13637,7 +15173,7 @@ var dashboardCommand = new Command62("dashboard").description(
13637
15173
  });
13638
15174
  printResult(
13639
15175
  withChainNames({
13640
- address: address2,
15176
+ address: address3,
13641
15177
  chainId,
13642
15178
  generatedAt: new Date(nowMs).toISOString(),
13643
15179
  needsYou,
@@ -13670,7 +15206,7 @@ var dashboardCommand = new Command62("dashboard").description(
13670
15206
  }),
13671
15207
  {
13672
15208
  next: nextForHome({
13673
- address: address2,
15209
+ address: address3,
13674
15210
  chainId,
13675
15211
  balanceBaseUnits: balance.value?.balanceBaseUnits,
13676
15212
  needsYou: needsYou.total,
@@ -13752,12 +15288,12 @@ var inboxCommand = new Command63("inbox").description(
13752
15288
  }
13753
15289
  return;
13754
15290
  }
13755
- const address2 = auth.walletAddress;
15291
+ const address3 = auth.walletAddress;
13756
15292
  const hasReadAuth = Object.keys(auth.headers).length > 0;
13757
- const inboxParams = new URLSearchParams({ address: address2 });
15293
+ const inboxParams = new URLSearchParams({ address: address3 });
13758
15294
  if (opts.tasksSort) inboxParams.set("sort", opts.tasksSort);
13759
15295
  if (tasksLimit !== void 0) inboxParams.set("limit", String(tasksLimit));
13760
- const actionParams = new URLSearchParams({ address: address2, limit: String(page.limit) });
15296
+ const actionParams = new URLSearchParams({ address: address3, limit: String(page.limit) });
13761
15297
  if (page.cursor) actionParams.set("cursor", page.cursor);
13762
15298
  if (opts.actionsOnly) {
13763
15299
  try {
@@ -13774,7 +15310,7 @@ var inboxCommand = new Command63("inbox").description(
13774
15310
  return;
13775
15311
  }
13776
15312
  const ownerParams = new URLSearchParams({
13777
- owner: address2,
15313
+ owner: address3,
13778
15314
  status: "needs_action",
13779
15315
  limit: "20"
13780
15316
  });
@@ -13914,9 +15450,9 @@ var depositCommand = new Command64("deposit").description(
13914
15450
  "--relay-route <routeId>",
13915
15451
  "Request a Relay deposit address for this wallet on an offered route (see fundingOptions.relayRoutes)"
13916
15452
  ).option("--amount <amount>", "Amount of the route origin stablecoin to send, for --relay-route").action(async (opts) => {
13917
- let address2;
15453
+ let address3;
13918
15454
  try {
13919
- address2 = await getWalletAddress();
15455
+ address3 = await getWalletAddress();
13920
15456
  } catch (err) {
13921
15457
  renderFailure(err, { fallback: "No keystore found. Run `taskmarket init` first." });
13922
15458
  return;
@@ -13945,7 +15481,7 @@ var depositCommand = new Command64("deposit").description(
13945
15481
  const chainId = chain.chainId;
13946
15482
  const tokenAddress = chain.tokenAddress;
13947
15483
  const data = {
13948
- address: address2,
15484
+ address: address3,
13949
15485
  network: chain.networkName,
13950
15486
  chainId,
13951
15487
  currency: paymentTokenSymbol(chainId),
@@ -13960,13 +15496,13 @@ var depositCommand = new Command64("deposit").description(
13960
15496
  return;
13961
15497
  }
13962
15498
  const balance = await apiGet(
13963
- `/api/wallet/balance?address=${address2}&chainId=${chainId}`
15499
+ `/api/wallet/balance?address=${address3}&chainId=${chainId}`
13964
15500
  ).catch(() => null);
13965
15501
  printResult(
13966
15502
  { ...data, fundingOptions },
13967
15503
  {
13968
15504
  next: nextForBalance({
13969
- address: address2,
15505
+ address: address3,
13970
15506
  chainId,
13971
15507
  balanceBaseUnits: balance?.balanceBaseUnits
13972
15508
  })
@@ -13991,7 +15527,7 @@ var depositCommand = new Command64("deposit").description(
13991
15527
  if (BigInt(amountBaseUnits) <= 0n) throw new Error("Enter a valid amount.");
13992
15528
  const deposit = await requestRelayBridgeDepositAddress({
13993
15529
  routeId,
13994
- recipient: address2,
15530
+ recipient: address3,
13995
15531
  amountBaseUnits
13996
15532
  });
13997
15533
  const route = RELAY_BRIDGE_ROUTES[routeId];
@@ -14001,7 +15537,7 @@ var depositCommand = new Command64("deposit").description(
14001
15537
  routeId,
14002
15538
  ...deposit,
14003
15539
  send: `${opts.amount} ${route.origin.symbol} on ${route.origin.chainName} to ${deposit.depositAddress}`,
14004
- credits: `${route.destination.symbol} on ${route.destination.chainName} to ${address2}`
15540
+ credits: `${route.destination.symbol} on ${route.destination.chainName} to ${address3}`
14005
15541
  }
14006
15542
  });
14007
15543
  } catch (err) {
@@ -14014,10 +15550,10 @@ import { Command as Command75 } from "commander";
14014
15550
 
14015
15551
  // src/commands/wallet/balance.ts
14016
15552
  import { Command as Command65 } from "commander";
14017
- function balancePath(address2, chainId) {
14018
- return `/api/wallet/balance?address=${address2}&chainId=${chainId}`;
15553
+ function balancePath(address3, chainId) {
15554
+ return `/api/wallet/balance?address=${address3}&chainId=${chainId}`;
14019
15555
  }
14020
- async function allChainBalances(address2) {
15556
+ async function allChainBalances(address3) {
14021
15557
  const raw = await apiGet("/trpc/network.info");
14022
15558
  const info = NetworkInfoSchema.safeParse(raw?.result?.data);
14023
15559
  if (!info.success) {
@@ -14033,7 +15569,7 @@ async function allChainBalances(address2) {
14033
15569
  tokenSymbol: chain.tokenSymbol
14034
15570
  };
14035
15571
  try {
14036
- const result = await apiGet(balancePath(address2, chain.chainId));
15572
+ const result = await apiGet(balancePath(address3, chain.chainId));
14037
15573
  return {
14038
15574
  ...base,
14039
15575
  tokenSymbol: result.tokenSymbol ?? chain.tokenSymbol,
@@ -14045,7 +15581,7 @@ async function allChainBalances(address2) {
14045
15581
  }
14046
15582
  })
14047
15583
  );
14048
- return { address: address2, chains };
15584
+ return { address: address3, chains };
14049
15585
  }
14050
15586
  var walletBalanceCommand = new Command65("balance").description("Show the wallet's payment-token balance on the selected network").option("--address <addr>", "Address to check (defaults to own wallet)").option(
14051
15587
  "--all-chains",
@@ -14066,26 +15602,26 @@ var walletBalanceCommand = new Command65("balance").description("Show the wallet
14066
15602
  printResult(await readSolanaBalances(createRpc2(connection), connection, owner));
14067
15603
  return;
14068
15604
  }
14069
- let address2 = opts.address;
14070
- const ownWallet = !address2;
14071
- if (!address2) {
15605
+ let address3 = opts.address;
15606
+ const ownWallet = !address3;
15607
+ if (!address3) {
14072
15608
  const keystore = await loadKeystore();
14073
- address2 = keystore.walletAddress;
15609
+ address3 = keystore.walletAddress;
14074
15610
  }
14075
15611
  if (opts.allChains) {
14076
15612
  try {
14077
- printResult(await allChainBalances(address2));
15613
+ printResult(await allChainBalances(address3));
14078
15614
  } catch (err) {
14079
15615
  renderFailure(err, { fallback: "Failed to fetch network info from backend." });
14080
15616
  }
14081
15617
  return;
14082
15618
  }
14083
15619
  const chainId = selectedNetwork().chainId;
14084
- const result = await apiGet(balancePath(address2, chainId));
15620
+ const result = await apiGet(balancePath(address3, chainId));
14085
15621
  printResult(
14086
15622
  result,
14087
15623
  ownWallet ? {
14088
- next: nextForBalance({ address: address2, chainId, balanceBaseUnits: result.balanceBaseUnits })
15624
+ next: nextForBalance({ address: address3, chainId, balanceBaseUnits: result.balanceBaseUnits })
14089
15625
  } : void 0
14090
15626
  );
14091
15627
  }
@@ -14203,17 +15739,17 @@ var walletImportCommand = new Command66("import").description("Import an existin
14203
15739
  }
14204
15740
  const privateKey = normalizePrivateKey(rawKey);
14205
15741
  const account = privateKeyToAccount2(privateKey);
14206
- const address2 = account.address;
15742
+ const address3 = account.address;
14207
15743
  const publicKey = deriveCompressedPublicKey(privateKey);
14208
15744
  const legalBundle = LegalBundleSchema.parse(await apiGet("/api/legal/current"));
14209
15745
  const legalAcceptance = legalBundle.enforcementEnabled ? await acceptLegalBundle({
14210
15746
  assumeYes: Boolean(opts.yes),
14211
15747
  bundle: legalBundle,
14212
15748
  signMessage: (message) => account.signMessage({ message }),
14213
- walletAddress: address2
15749
+ walletAddress: address3
14214
15750
  }) : void 0;
14215
15751
  const deviceRegisterSignature = await account.signMessage({
14216
- message: buildDeviceRegisterMessage(address2)
15752
+ message: buildDeviceRegisterMessage(address3)
14217
15753
  });
14218
15754
  const {
14219
15755
  deviceId,
@@ -14224,13 +15760,13 @@ var walletImportCommand = new Command66("import").description("Import an existin
14224
15760
  legalReceipt: legalAcceptance?.receipt,
14225
15761
  publicKey,
14226
15762
  signature: deviceRegisterSignature,
14227
- walletAddress: address2
15763
+ walletAddress: address3
14228
15764
  });
14229
15765
  const encryptedKey = encryptPrivateKey(deviceEncryptionKey, privateKey);
14230
15766
  let agentId = initialAgentId;
14231
15767
  await saveKeystore({
14232
15768
  encryptedKey,
14233
- walletAddress: address2,
15769
+ walletAddress: address3,
14234
15770
  deviceId,
14235
15771
  apiToken,
14236
15772
  agentId,
@@ -14244,7 +15780,7 @@ var walletImportCommand = new Command66("import").description("Import an existin
14244
15780
  } : {}
14245
15781
  });
14246
15782
  if (!agentId) {
14247
- agentId = await pollAgentId(address2);
15783
+ agentId = await pollAgentId(address3);
14248
15784
  if (agentId) {
14249
15785
  const keystore = await loadKeystore();
14250
15786
  await saveKeystore(
@@ -14252,7 +15788,7 @@ var walletImportCommand = new Command66("import").description("Import an existin
14252
15788
  );
14253
15789
  }
14254
15790
  }
14255
- printResult({ address: address2, agentId }, { warnings: argvKeyWarnings(keySource) });
15791
+ printResult({ address: address3, agentId }, { warnings: argvKeyWarnings(keySource) });
14256
15792
  });
14257
15793
 
14258
15794
  // src/commands/wallet/set-withdrawal-address.ts
@@ -14274,19 +15810,19 @@ var WithdrawalAddressMismatchError = class extends Error {
14274
15810
  function pinnedWithdrawalAddress(keystore, chainId) {
14275
15811
  return keystore.withdrawalAddresses?.[String(chainId)] ?? keystore.withdrawalAddress;
14276
15812
  }
14277
- async function pinWithdrawalAddress(keystore, chainId, address2) {
15813
+ async function pinWithdrawalAddress(keystore, chainId, address3) {
14278
15814
  await saveKeystore({
14279
15815
  ...keystore,
14280
- withdrawalAddresses: { ...keystore.withdrawalAddresses, [String(chainId)]: address2 }
15816
+ withdrawalAddresses: { ...keystore.withdrawalAddresses, [String(chainId)]: address3 }
14281
15817
  });
14282
15818
  }
14283
15819
  function serverChainMismatch(requested, answered) {
14284
15820
  if (answered === void 0 || answered === requested) return void 0;
14285
15821
  return `Refusing to continue: the server answered for chain ${answered}, but this CLI asked for chain ${requested}. Nothing was pinned.`;
14286
15822
  }
14287
- async function fetchWithdrawalAddress(address2, chainId) {
15823
+ async function fetchWithdrawalAddress(address3, chainId) {
14288
15824
  const response = await apiGet(
14289
- `/api/wallet/withdrawal-address?address=${address2}&chainId=${chainId}`
15825
+ `/api/wallet/withdrawal-address?address=${address3}&chainId=${chainId}`
14290
15826
  );
14291
15827
  const mismatch = serverChainMismatch(chainId, response.chainId);
14292
15828
  if (mismatch) throw new Error(mismatch);
@@ -14336,8 +15872,8 @@ function isValidAddress(addr) {
14336
15872
  }
14337
15873
  var setWithdrawalAddressCommand = new Command67("set-withdrawal-address").description(
14338
15874
  "Set the withdrawal address for payment-token withdrawals on the selected network (once per chain, free)"
14339
- ).argument("<address>", "Ethereum address to receive withdrawals").action(async (address2) => {
14340
- if (!isValidAddress(address2)) {
15875
+ ).argument("<address>", "Ethereum address to receive withdrawals").action(async (address3) => {
15876
+ if (!isValidAddress(address3)) {
14341
15877
  printError("Invalid Ethereum address: must be 0x followed by 40 hex characters");
14342
15878
  return;
14343
15879
  }
@@ -14354,7 +15890,7 @@ var setWithdrawalAddressCommand = new Command67("set-withdrawal-address").descri
14354
15890
  const expiresAt = Math.floor(Date.now() / 1e3) + SIGNATURE_TTL_SECONDS;
14355
15891
  const message = buildSetWithdrawalAddressMessage({
14356
15892
  walletAddress,
14357
- withdrawalAddress: address2,
15893
+ withdrawalAddress: address3,
14358
15894
  chainId,
14359
15895
  nonce,
14360
15896
  expiresAt
@@ -14362,7 +15898,7 @@ var setWithdrawalAddressCommand = new Command67("set-withdrawal-address").descri
14362
15898
  const signature = await signMessage(message, keystore);
14363
15899
  const { data: result, idempotencyKey } = await apiPost("/api/wallet/set-withdrawal-address", {
14364
15900
  walletAddress,
14365
- withdrawalAddress: address2,
15901
+ withdrawalAddress: address3,
14366
15902
  signature,
14367
15903
  nonce,
14368
15904
  expiresAt,
@@ -14399,14 +15935,14 @@ import { Command as Command68 } from "commander";
14399
15935
  var getWithdrawalAddressCommand = new Command68("get-withdrawal-address").description(
14400
15936
  "Show the withdrawal address registered on the selected network, if any (the address is per chain)"
14401
15937
  ).option("--address <addr>", "Wallet address to check (defaults to own wallet)").action(async (opts) => {
14402
- let address2 = opts.address;
14403
- if (!address2) {
15938
+ let address3 = opts.address;
15939
+ if (!address3) {
14404
15940
  const keystore = await loadKeystore();
14405
- address2 = keystore.walletAddress;
15941
+ address3 = keystore.walletAddress;
14406
15942
  }
14407
15943
  const { chainId } = selectedNetwork();
14408
15944
  const result = await apiGet(
14409
- `/api/wallet/withdrawal-address?address=${address2}&chainId=${chainId}`
15945
+ `/api/wallet/withdrawal-address?address=${address3}&chainId=${chainId}`
14410
15946
  );
14411
15947
  printResult({ ...result, chainId: result.chainId ?? chainId });
14412
15948
  });
@@ -14516,12 +16052,12 @@ var revealRecoveryCodeCommand = new Command71("reveal-recovery-code").descriptio
14516
16052
  printError("No keystore found. Run `taskmarket init` first.");
14517
16053
  return;
14518
16054
  }
14519
- const address2 = keystore.walletAddress;
16055
+ const address3 = keystore.walletAddress;
14520
16056
  const { chainId } = selectedNetwork();
14521
- const message = buildRevealAccountRecoveryCodeMessage(address2, chainId);
16057
+ const message = buildRevealAccountRecoveryCodeMessage(address3, chainId);
14522
16058
  const signature = await signMessage(message, keystore);
14523
16059
  const { data: result, idempotencyKey } = await apiPost("/api/wallet/reveal-backfilled-recovery-code", {
14524
- address: address2,
16060
+ address: address3,
14525
16061
  signature,
14526
16062
  chainId
14527
16063
  });
@@ -15361,8 +16897,8 @@ function cachedInboxLookup(lookup, options = {}) {
15361
16897
  const now = options.now ?? Date.now;
15362
16898
  const maxEntries = options.maxEntries ?? 5e3;
15363
16899
  const cache = /* @__PURE__ */ new Map();
15364
- return async (address2) => {
15365
- const key = address2.toLowerCase();
16900
+ return async (address3) => {
16901
+ const key = address3.toLowerCase();
15366
16902
  const cached = cache.get(key);
15367
16903
  if (cached && cached.expiresAt > now()) {
15368
16904
  return cached.inboxId;
@@ -15698,12 +17234,12 @@ function devConversationId(a, b) {
15698
17234
  function createFileBus(dir) {
15699
17235
  fs7.mkdirSync(dir, { recursive: true });
15700
17236
  const logPath = (inboxId) => path4.join(dir, `inbox-${inboxId}.jsonl`);
15701
- const addressPath = (address2) => path4.join(dir, `address-${address2.toLowerCase()}`);
17237
+ const addressPath = (address3) => path4.join(dir, `address-${address3.toLowerCase()}`);
15702
17238
  return {
15703
- register: (address2, inboxId) => fs7.writeFileSync(addressPath(address2), inboxId),
15704
- lookup: (address2) => {
17239
+ register: (address3, inboxId) => fs7.writeFileSync(addressPath(address3), inboxId),
17240
+ lookup: (address3) => {
15705
17241
  try {
15706
- return fs7.readFileSync(addressPath(address2), "utf8").trim() || null;
17242
+ return fs7.readFileSync(addressPath(address3), "utf8").trim() || null;
15707
17243
  } catch {
15708
17244
  return null;
15709
17245
  }
@@ -15744,8 +17280,8 @@ async function createDevClient(input) {
15744
17280
  inboxId,
15745
17281
  installationId,
15746
17282
  dbPath,
15747
- async inboxIdForAddress(address2) {
15748
- return devInboxByAddress.get(address2.toLowerCase()) ?? fileBus?.lookup(address2) ?? null;
17283
+ async inboxIdForAddress(address3) {
17284
+ return devInboxByAddress.get(address3.toLowerCase()) ?? fileBus?.lookup(address3) ?? null;
15749
17285
  },
15750
17286
  async sendMessage(toInboxId, body) {
15751
17287
  const message = {
@@ -16268,7 +17804,7 @@ async function createProductionClient(input, env) {
16268
17804
  }
16269
17805
  const installationId = extractString(client, ["installationId", "installationID"]) ?? extractString(asObject(client)?.installation, ["id", "installationId"]) ?? input.existingInstallationId ?? randomUUID3();
16270
17806
  const cursor = loadXmtpCursor(xmtpCursorPath(defaultXmtpDbDir(), input.walletAddress));
16271
- const inboxIdForAddress = cachedInboxLookup(async (address2) => {
17807
+ const inboxIdForAddress = cachedInboxLookup(async (address3) => {
16272
17808
  const lookup = asObject(client)?.fetchInboxIdByIdentifier;
16273
17809
  if (typeof lookup !== "function") {
16274
17810
  throw new XmtpTransportError(
@@ -16277,7 +17813,7 @@ async function createProductionClient(input, env) {
16277
17813
  );
16278
17814
  }
16279
17815
  const resolved = await withRetry(
16280
- () => lookup.call(client, { identifier: address2, identifierKind: 0 }),
17816
+ () => lookup.call(client, { identifier: address3, identifierKind: 0 }),
16281
17817
  parseRetryAttempts()
16282
17818
  );
16283
17819
  return resolved ?? null;
@@ -16451,24 +17987,24 @@ async function createXmtpClient(input) {
16451
17987
  return createProductionClient(input, env);
16452
17988
  }
16453
17989
  var networkInboxLookups = /* @__PURE__ */ new Map();
16454
- async function lookupInboxIdOnNetwork(address2) {
17990
+ async function lookupInboxIdOnNetwork(address3) {
16455
17991
  const env = resolveXmtpEnv();
16456
17992
  let lookup = networkInboxLookups.get(env);
16457
17993
  if (!lookup) {
16458
17994
  lookup = env === "memory" ? memoryInboxLookup() : sdkNetworkInboxLookup(env);
16459
17995
  networkInboxLookups.set(env, lookup);
16460
17996
  }
16461
- return lookup(address2);
17997
+ return lookup(address3);
16462
17998
  }
16463
17999
  function memoryInboxLookup() {
16464
- return async (address2) => {
18000
+ return async (address3) => {
16465
18001
  const busDir = process.env.TASKMARKET_XMTP_MEMORY_DIR?.trim();
16466
- return devInboxByAddress.get(address2.toLowerCase()) ?? (busDir ? createFileBus(busDir).lookup(address2) : null);
18002
+ return devInboxByAddress.get(address3.toLowerCase()) ?? (busDir ? createFileBus(busDir).lookup(address3) : null);
16467
18003
  };
16468
18004
  }
16469
18005
  function sdkNetworkInboxLookup(env) {
16470
18006
  let backend;
16471
- return cachedInboxLookup(async (address2) => {
18007
+ return cachedInboxLookup(async (address3) => {
16472
18008
  assertXmtpSupported();
16473
18009
  const sdkModule = asObject(
16474
18010
  await import("@xmtp/node-sdk").catch((error) => {
@@ -16492,7 +18028,7 @@ function sdkNetworkInboxLookup(env) {
16492
18028
  backend ??= createBackend({ env });
16493
18029
  try {
16494
18030
  return await getInboxIdForIdentifier(await backend, {
16495
- identifier: address2,
18031
+ identifier: address3,
16496
18032
  identifierKind: 0
16497
18033
  });
16498
18034
  } catch (error) {
@@ -16789,7 +18325,7 @@ async function resolvePeerRuleInboxId(to, inboxIdOnNetwork = lookupInboxIdOnNetw
16789
18325
  if (isRawInboxId(to)) {
16790
18326
  return to;
16791
18327
  }
16792
- let address2 = to;
18328
+ let address3 = to;
16793
18329
  if (!isAddress3(to)) {
16794
18330
  const result = await apiGet(
16795
18331
  `/api/xmtp/resolve?agentId=${encodeURIComponent(to)}&chainId=${selectedNetwork().chainId}`
@@ -16797,11 +18333,11 @@ async function resolvePeerRuleInboxId(to, inboxIdOnNetwork = lookupInboxIdOnNetw
16797
18333
  if (!result.address) {
16798
18334
  throw new Error(`No XMTP inbox found for agent "${to}"`);
16799
18335
  }
16800
- address2 = result.address;
18336
+ address3 = result.address;
16801
18337
  }
16802
- const inboxId = await inboxIdOnNetwork(address2);
18338
+ const inboxId = await inboxIdOnNetwork(address3);
16803
18339
  if (!inboxId) {
16804
- throw new Error(`No XMTP inbox found on the XMTP network for address ${address2}`);
18340
+ throw new Error(`No XMTP inbox found on the XMTP network for address ${address3}`);
16805
18341
  }
16806
18342
  return inboxId;
16807
18343
  }
@@ -18359,8 +19895,8 @@ var VERIFIED_SENDER_VALUES = ["pass", "platform"];
18359
19895
  function isVerifiedSender(senderVerification) {
18360
19896
  return senderVerification != null && VERIFIED_SENDER_VALUES.includes(senderVerification);
18361
19897
  }
18362
- function domainOf(address2) {
18363
- return address2.slice(address2.lastIndexOf("@") + 1).trim().toLowerCase();
19898
+ function domainOf(address3) {
19899
+ return address3.slice(address3.lastIndexOf("@") + 1).trim().toLowerCase();
18364
19900
  }
18365
19901
  function replyNeedsVerifiedSender(original) {
18366
19902
  if (isVerifiedSender(original.senderVerification)) return false;
@@ -19460,12 +20996,12 @@ import { Command as Command107 } from "commander";
19460
20996
 
19461
20997
  // src/commands/requester/stats.ts
19462
20998
  import { Command as Command106 } from "commander";
19463
- var requesterStatsCmd = new Command106("stats").description("Get requester reputation stats for an address").argument("<address>", "Wallet address of the requester").action(async (address2) => {
19464
- if (!/^0x[0-9a-fA-F]{40}$/.test(address2)) {
20999
+ var requesterStatsCmd = new Command106("stats").description("Get requester reputation stats for an address").argument("<address>", "Wallet address of the requester").action(async (address3) => {
21000
+ if (!/^0x[0-9a-fA-F]{40}$/.test(address3)) {
19465
21001
  printError("Address must be a 0x-prefixed 20-byte hex string");
19466
21002
  return;
19467
21003
  }
19468
- const data = await apiGet(`/api/requester/${address2}/stats`);
21004
+ const data = await apiGet(`/api/requester/${address3}/stats`);
19469
21005
  if (!data) {
19470
21006
  printError("No stats found for address");
19471
21007
  return;
@@ -23195,8 +24731,8 @@ function getConfigDecoder() {
23195
24731
  function decodeConfig(encodedAccount) {
23196
24732
  return decodeAccount(encodedAccount, getConfigDecoder());
23197
24733
  }
23198
- async function fetchMaybeConfig(rpc, address2, config) {
23199
- const maybeAccount = await fetchEncodedAccount(rpc, address2, config);
24734
+ async function fetchMaybeConfig(rpc, address3, config) {
24735
+ const maybeAccount = await fetchEncodedAccount(rpc, address3, config);
23200
24736
  return decodeConfig(maybeAccount);
23201
24737
  }
23202
24738
 
@@ -23324,11 +24860,65 @@ function getVaultDecoder() {
23324
24860
  function decodeVault(encodedAccount) {
23325
24861
  return decodeAccount(encodedAccount, getVaultDecoder());
23326
24862
  }
23327
- async function fetchMaybeVault(rpc, address2, config) {
23328
- const maybeAccount = await fetchEncodedAccount(rpc, address2, config);
24863
+ async function fetchMaybeVault(rpc, address3, config) {
24864
+ const maybeAccount = await fetchEncodedAccount(rpc, address3, config);
23329
24865
  return decodeVault(maybeAccount);
23330
24866
  }
23331
24867
 
24868
+ // ../../node_modules/.pnpm/@solana+program-client-core@8.4.0_typescript@5.7.3/node_modules/@solana/program-client-core/dist/index.node.mjs
24869
+ function getNonNullResolvedInstructionInput2(inputName, value) {
24870
+ if (value === null || value === void 0) {
24871
+ throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__RESOLVED_INSTRUCTION_INPUT_MUST_BE_NON_NULL, {
24872
+ inputName
24873
+ });
24874
+ }
24875
+ return value;
24876
+ }
24877
+ function getAddressFromResolvedInstructionAccount2(inputName, value) {
24878
+ const nonNullValue = getNonNullResolvedInstructionInput2(inputName, value);
24879
+ if (typeof value === "object" && "address" in nonNullValue) {
24880
+ return nonNullValue.address;
24881
+ }
24882
+ if (Array.isArray(nonNullValue)) {
24883
+ return nonNullValue[0];
24884
+ }
24885
+ return nonNullValue;
24886
+ }
24887
+ function getAccountMetaFactory2(programAddress, optionalAccountStrategy) {
24888
+ return (inputName, account) => {
24889
+ if (!account.value) {
24890
+ if (optionalAccountStrategy === "omitted") return;
24891
+ return Object.freeze({ address: programAddress, role: AccountRole.READONLY });
24892
+ }
24893
+ if (hasExplicitRole2(account.value)) {
24894
+ return Object.freeze({
24895
+ address: account.value.address,
24896
+ role: account.value.role,
24897
+ ..."signer" in account.value && account.value.signer ? { signer: account.value.signer } : {}
24898
+ });
24899
+ }
24900
+ const idlIsSigner = account.isSigner ?? "either";
24901
+ const isSigner = idlIsSigner !== false && isResolvedInstructionAccountSigner2(account.value);
24902
+ if (!isSigner && idlIsSigner === true) {
24903
+ throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__RESOLVED_INSTRUCTION_INPUT_MUST_BE_SIGNER, {
24904
+ inputName
24905
+ });
24906
+ }
24907
+ const writableRole = account.isWritable ? AccountRole.WRITABLE : AccountRole.READONLY;
24908
+ return Object.freeze({
24909
+ address: getAddressFromResolvedInstructionAccount2(inputName, account.value),
24910
+ role: isSigner ? upgradeRoleToSigner(writableRole) : writableRole,
24911
+ ...isSigner ? { signer: account.value } : {}
24912
+ });
24913
+ };
24914
+ }
24915
+ function hasExplicitRole2(value) {
24916
+ return typeof value === "object" && "role" in value && typeof value.role === "number";
24917
+ }
24918
+ function isResolvedInstructionAccountSigner2(value) {
24919
+ return !!value && typeof value === "object" && "address" in value && typeof value.address === "string" && isTransactionSigner(value);
24920
+ }
24921
+
23332
24922
  // ../../packages/solana-sponsored-client/dist/generated/pdas/binding.js
23333
24923
  async function findBindingPda(seeds, config = {}) {
23334
24924
  const { programAddress = "STvau1t111111111111111111111111111111111111" } = config;
@@ -23401,7 +24991,7 @@ function getBindPayoutInstructionDataEncoder() {
23401
24991
  }
23402
24992
  async function getBindPayoutInstructionAsync(input, config) {
23403
24993
  const programAddress = config?.programAddress ?? SPONSORED_TASKS_PROGRAM_ADDRESS;
23404
- const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
24994
+ const getAccountMeta = getAccountMetaFactory2(programAddress, "programId");
23405
24995
  const originalAccounts = {
23406
24996
  config: { value: input.config ?? null, isSigner: false, isWritable: false },
23407
24997
  binding: { value: input.binding ?? null, isSigner: false, isWritable: true },
@@ -23417,8 +25007,8 @@ async function getBindPayoutInstructionAsync(input, config) {
23417
25007
  }
23418
25008
  if (!accounts.binding.value) {
23419
25009
  accounts.binding.value = await findBindingPda({
23420
- taskChainId: getNonNullResolvedInstructionInput("taskChainId", args.taskChainId),
23421
- agent: getNonNullResolvedInstructionInput("agent", args.agent)
25010
+ taskChainId: getNonNullResolvedInstructionInput2("taskChainId", args.taskChainId),
25011
+ agent: getNonNullResolvedInstructionInput2("agent", args.agent)
23422
25012
  }, { programAddress });
23423
25013
  }
23424
25014
  if (!accounts.systemProgram.value) {
@@ -23493,7 +25083,7 @@ function getCreateVaultInstructionDataEncoder() {
23493
25083
  }
23494
25084
  function getCreateVaultInstruction(input, config) {
23495
25085
  const programAddress = config?.programAddress ?? SPONSORED_TASKS_PROGRAM_ADDRESS;
23496
- const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
25086
+ const getAccountMeta = getAccountMetaFactory2(programAddress, "programId");
23497
25087
  const originalAccounts = {
23498
25088
  config: { value: input.config ?? null, isSigner: false, isWritable: false },
23499
25089
  sponsor: { value: input.sponsor ?? null, isSigner: true, isWritable: true },
@@ -23559,7 +25149,7 @@ function getEmergencyExitInstructionDataEncoder() {
23559
25149
  }
23560
25150
  function getEmergencyExitInstruction(input, config) {
23561
25151
  const programAddress = config?.programAddress ?? SPONSORED_TASKS_PROGRAM_ADDRESS;
23562
- const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
25152
+ const getAccountMeta = getAccountMetaFactory2(programAddress, "programId");
23563
25153
  const originalAccounts = {
23564
25154
  vault: { value: input.vault ?? null, isSigner: false, isWritable: true },
23565
25155
  sponsor: { value: input.sponsor ?? null, isSigner: true, isWritable: false },
@@ -23629,7 +25219,7 @@ function getFundInstructionDataEncoder() {
23629
25219
  }
23630
25220
  function getFundInstruction(input, config) {
23631
25221
  const programAddress = config?.programAddress ?? SPONSORED_TASKS_PROGRAM_ADDRESS;
23632
- const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
25222
+ const getAccountMeta = getAccountMetaFactory2(programAddress, "programId");
23633
25223
  const originalAccounts = {
23634
25224
  vault: { value: input.vault ?? null, isSigner: false, isWritable: true },
23635
25225
  mint: { value: input.mint ?? null, isSigner: false, isWritable: false },
@@ -23796,7 +25386,7 @@ function getSetManagersInstructionDataEncoder() {
23796
25386
  }
23797
25387
  function getSetManagersInstruction(input, config) {
23798
25388
  const programAddress = config?.programAddress ?? SPONSORED_TASKS_PROGRAM_ADDRESS;
23799
- const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
25389
+ const getAccountMeta = getAccountMetaFactory2(programAddress, "programId");
23800
25390
  const originalAccounts = {
23801
25391
  vault: { value: input.vault ?? null, isSigner: false, isWritable: true },
23802
25392
  sponsor: { value: input.sponsor ?? null, isSigner: true, isWritable: false },
@@ -25154,16 +26744,16 @@ import { Command as Command116 } from "commander";
25154
26744
  var sponsoredTaskManagedCommand = new Command116("managed").description(
25155
26745
  "List the active Sponsored Task vaults an address can fund tasks from as an active manager (defaults to your wallet)"
25156
26746
  ).option("--address <address>", "Manager address (defaults to your wallet)").option("--limit <n>", "Max vaults to return (1-100)", "50").option("--cursor <vaultId>", "Pagination cursor from a previous nextCursor").action(async (opts) => {
25157
- let address2 = opts.address;
25158
- if (address2 === void 0) {
26747
+ let address3 = opts.address;
26748
+ if (address3 === void 0) {
25159
26749
  try {
25160
- address2 = (await loadKeystore()).walletAddress;
26750
+ address3 = (await loadKeystore()).walletAddress;
25161
26751
  } catch {
25162
26752
  printError("No keystore found. Run `taskmarket init` first, or pass --address.");
25163
26753
  return;
25164
26754
  }
25165
26755
  }
25166
- if (!/^0x[a-fA-F0-9]{40}$/.test(address2)) {
26756
+ if (!/^0x[a-fA-F0-9]{40}$/.test(address3)) {
25167
26757
  printError("Invalid Ethereum address for --address");
25168
26758
  return;
25169
26759
  }
@@ -25175,7 +26765,7 @@ var sponsoredTaskManagedCommand = new Command116("managed").description(
25175
26765
  const params = new URLSearchParams({ limit: String(limit) });
25176
26766
  if (opts.cursor) params.set("cursor", opts.cursor);
25177
26767
  const result = await apiGet(
25178
- `/api/sponsored-task-vaults/managed/${address2.toLowerCase()}?${params.toString()}`
26768
+ `/api/sponsored-task-vaults/managed/${address3.toLowerCase()}?${params.toString()}`
25179
26769
  );
25180
26770
  printResult(result);
25181
26771
  });
@@ -25526,7 +27116,7 @@ async function findEntitlement(vaultId, workerAddress, taskId, options = {}) {
25526
27116
  const entitlements = await apiGet(
25527
27117
  `/api/sponsored-task-vaults/${vaultId}/entitlements?workerAddress=${workerAddress}${query4}`
25528
27118
  );
25529
- const found = taskId ? entitlements.find((e4) => e4.taskId.toLowerCase() === taskId.toLowerCase()) : entitlements[0];
27119
+ const found = taskId ? entitlements.find((e5) => e5.taskId.toLowerCase() === taskId.toLowerCase()) : entitlements[0];
25530
27120
  if (found || !taskId || Date.now() + 3e3 > deadline) return found;
25531
27121
  await sleep4(3e3);
25532
27122
  }
@@ -25652,16 +27242,16 @@ var REWARD_STATES = SponsoredTaskRewardStateSchema.options;
25652
27242
  var CLAIM_STATUSES = SponsoredTaskWorkerRewardClaimStatusSchema.options;
25653
27243
  var sponsoredTaskRewardsCommand = new Command126("rewards").description("List Sponsored Task rewards across every vault (defaults to your wallet)").option("--address <address>", "Worker address (defaults to your wallet)").option("--state <state>", `Reward state: ${REWARD_STATES.join(", ")}`).option("--claim-status <status>", `Claim status: ${CLAIM_STATUSES.join(", ")}`).option("--limit <n>", "Max rewards to return (1-100)", "50").option("--cursor <cursor>", "Pagination cursor from a previous nextCursor").action(
25654
27244
  async (opts) => {
25655
- let address2 = opts.address;
25656
- if (address2 === void 0) {
27245
+ let address3 = opts.address;
27246
+ if (address3 === void 0) {
25657
27247
  try {
25658
- address2 = (await loadKeystore()).walletAddress;
27248
+ address3 = (await loadKeystore()).walletAddress;
25659
27249
  } catch {
25660
27250
  printError("No keystore found. Run `taskmarket init` first, or pass --address.");
25661
27251
  return;
25662
27252
  }
25663
27253
  }
25664
- if (!/^0x[a-fA-F0-9]{40}$/.test(address2)) {
27254
+ if (!/^0x[a-fA-F0-9]{40}$/.test(address3)) {
25665
27255
  printError("Invalid Ethereum address for --address");
25666
27256
  return;
25667
27257
  }
@@ -25683,7 +27273,7 @@ var sponsoredTaskRewardsCommand = new Command126("rewards").description("List Sp
25683
27273
  if (opts.claimStatus) params.set("claimStatus", opts.claimStatus);
25684
27274
  if (opts.cursor) params.set("cursor", opts.cursor);
25685
27275
  const result = await apiGet(
25686
- `/api/sponsored-task-rewards/workers/${address2.toLowerCase()}?${params.toString()}`
27276
+ `/api/sponsored-task-rewards/workers/${address3.toLowerCase()}?${params.toString()}`
25687
27277
  );
25688
27278
  printResult(withChainNames(result));
25689
27279
  }
@@ -28054,18 +29644,18 @@ var projectListCommand = new Command149("list").description(
28054
29644
  if (before !== void 0) funding.set("before", String(before));
28055
29645
  return void printResult(await apiGet(withChainId(`/api/projects?${funding.toString()}`)));
28056
29646
  }
28057
- let address2 = opts.address;
28058
- if (address2 === void 0) {
29647
+ let address3 = opts.address;
29648
+ if (address3 === void 0) {
28059
29649
  try {
28060
- address2 = (await loadKeystore()).walletAddress;
29650
+ address3 = (await loadKeystore()).walletAddress;
28061
29651
  } catch {
28062
29652
  return void printError(
28063
29653
  "No keystore found. Run `taskmarket init` first, or pass --address."
28064
29654
  );
28065
29655
  }
28066
29656
  }
28067
- if (!ADDRESS.test(address2)) return void printError("Invalid Ethereum address for --address");
28068
- const params = new URLSearchParams({ address: address2, role: opts.role });
29657
+ if (!ADDRESS.test(address3)) return void printError("Invalid Ethereum address for --address");
29658
+ const params = new URLSearchParams({ address: address3, role: opts.role });
28069
29659
  if (opts.open) params.set("status", "open");
28070
29660
  if (opts.finished) params.set("status", "finished");
28071
29661
  if (opts.limit !== void 0) params.set("limit", opts.limit.trim());
@@ -28909,9 +30499,9 @@ var listCommand10 = new Command154("list").description(
28909
30499
  );
28910
30500
  var showCommand8 = new Command154("show").description(
28911
30501
  "Show one hook on the selected --network: its registry listing, or its onchain observation marked unlisted"
28912
- ).argument("<address>", "Hook contract address").action(async (address2) => {
30502
+ ).argument("<address>", "Hook contract address").action(async (address3) => {
28913
30503
  try {
28914
- const input = parseInput(HookGetInputSchema, { address: address2 });
30504
+ const input = parseInput(HookGetInputSchema, { address: address3 });
28915
30505
  const registry = await fetchHookRegistry(input.address.toLowerCase());
28916
30506
  const wanted = input.address.toLowerCase();
28917
30507
  const listed = registry.listed.find((hook) => hook.address.toLowerCase() === wanted);
@@ -28932,9 +30522,9 @@ var encodeConfigCommand = new Command154("encode-config").description(
28932
30522
  ).argument("<address>", "Hook contract address").requiredOption(
28933
30523
  "--values <json>",
28934
30524
  "The values as a JSON array in schema order, or a JSON object keyed by field name"
28935
- ).action(async (address2, opts) => {
30525
+ ).action(async (address3, opts) => {
28936
30526
  try {
28937
- const input = parseInput(HookGetInputSchema, { address: address2 });
30527
+ const input = parseInput(HookGetInputSchema, { address: address3 });
28938
30528
  const wanted = input.address.toLowerCase();
28939
30529
  const registry = await fetchHookRegistry(wanted);
28940
30530
  const entry = registry.listed.find((hook) => hook.address.toLowerCase() === wanted);
@@ -29152,13 +30742,37 @@ tapCommand.command("create").description(
29152
30742
  renderFailure(err);
29153
30743
  }
29154
30744
  });
30745
+ var CARD_VERIFICATION_NEXT_STEP = "Have the agent owner open verificationUrl in a browser to link a Visa card, then re-run 'taskmarket tap enrol' (or run with --wait).";
30746
+ function parseWaitTimeoutSeconds(raw) {
30747
+ if (raw === void 0) return TAP_WAIT_DEFAULT_TIMEOUT_SECONDS;
30748
+ const trimmed = raw.trim();
30749
+ if (!/^\d+$/.test(trimmed)) {
30750
+ throw new Error(
30751
+ `--wait-timeout must be a positive integer between 1 and ${TAP_WAIT_MAX_TIMEOUT_SECONDS} seconds`
30752
+ );
30753
+ }
30754
+ const seconds = Number(trimmed);
30755
+ if (!Number.isSafeInteger(seconds) || seconds < 1 || seconds > TAP_WAIT_MAX_TIMEOUT_SECONDS) {
30756
+ throw new Error(
30757
+ `--wait-timeout must be a positive integer between 1 and ${TAP_WAIT_MAX_TIMEOUT_SECONDS} seconds`
30758
+ );
30759
+ }
30760
+ return seconds;
30761
+ }
29155
30762
  tapCommand.command("enrol").description(
29156
30763
  "Enrol the stored TAP key on the configured network's chain and store the key id it gets. On a chain that supports it, the key (ECDSA P-256) is registered with the verifier's directory and the directory URL is stored for Signature-Agent; elsewhere enrolment is refused."
29157
30764
  ).option(
29158
30765
  "--force",
29159
- "Enrol a key this CLI already enrolled on this chain again; the server replaces its previous key there"
30766
+ "Enrol a key this CLI already enrolled on this chain again: it keeps its key id unless the directory no longer resolves it, which registers it again"
30767
+ ).option(
30768
+ "--wait",
30769
+ "Wait for the owner to complete Visa card verification in a browser and save the issued key id"
30770
+ ).option(
30771
+ "--wait-timeout <seconds>",
30772
+ `Maximum seconds to wait with --wait (default: ${TAP_WAIT_DEFAULT_TIMEOUT_SECONDS})`
29160
30773
  ).action(async (opts) => {
29161
30774
  try {
30775
+ const waitTimeoutSeconds = parseWaitTimeoutSeconds(opts.waitTimeout);
29162
30776
  const keystore = await loadKeystore();
29163
30777
  const stored = keystore.tapKey;
29164
30778
  if (!stored) {
@@ -29177,8 +30791,33 @@ tapCommand.command("enrol").description(
29177
30791
  `The TAP key's key id ${stored.keyId} was not enrolled by 'tap enrol' on chain ${chainId}, so 'tap enrol --force' will not replace it. Use 'taskmarket tap remove' or 'taskmarket tap import --force' to replace the key.`
29178
30792
  );
29179
30793
  }
29180
- const enrolment = await enrolTapKey(stored, chainId);
29181
- const tapKey = withTapEnrolment(stored, enrolment);
30794
+ const outcome = await enrolTapKey(stored, chainId);
30795
+ if (outcome.status === "card_verification_required") {
30796
+ if (!opts.wait) {
30797
+ printResult({
30798
+ enrolled: false,
30799
+ status: "card_verification_required",
30800
+ chainId: outcome.chainId,
30801
+ sessionId: outcome.sessionId,
30802
+ verificationUrl: outcome.verificationUrl,
30803
+ expiresAt: outcome.expiresAt,
30804
+ nextStep: CARD_VERIFICATION_NEXT_STEP
30805
+ });
30806
+ return;
30807
+ }
30808
+ process.stderr.write(
30809
+ `Waiting for Visa card verification (expires ${outcome.expiresAt}): ${outcome.verificationUrl}
30810
+ `
30811
+ );
30812
+ const enrolment = await waitForTapEnrolment(outcome.sessionId, {
30813
+ timeoutMs: waitTimeoutSeconds * 1e3
30814
+ });
30815
+ const tapKey2 = withTapEnrolment(stored, enrolment);
30816
+ await saveKeystore({ ...keystore, tapKey: tapKey2 });
30817
+ printResult(tapKeySummary(tapKey2));
30818
+ return;
30819
+ }
30820
+ const tapKey = withTapEnrolment(stored, outcome.enrolment);
29182
30821
  await saveKeystore({ ...keystore, tapKey });
29183
30822
  printResult(tapKeySummary(tapKey));
29184
30823
  } catch (err) {