@secondlayer/stacks 2.21.1 → 3.0.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.
Files changed (72) hide show
  1. package/README.md +6 -5
  2. package/dist/shared/stacks-2p9cazp7.cjs +263 -0
  3. package/dist/shared/stacks-2p9cazp7.cjs.map +12 -0
  4. package/dist/shared/stacks-9mqveyjv.cjs.map +2 -2
  5. package/dist/shared/{stacks-cdvn8qbh.cjs → stacks-b221qkst.cjs} +4 -3
  6. package/dist/shared/stacks-b221qkst.cjs.map +10 -0
  7. package/dist/shared/{stacks-0x50nn01.cjs → stacks-byyex2zk.cjs} +3 -2
  8. package/dist/shared/{stacks-0x50nn01.cjs.map → stacks-byyex2zk.cjs.map} +2 -2
  9. package/dist/shared/{stacks-rb9shyk8.js → stacks-ch5vshcd.js} +4 -4
  10. package/dist/shared/stacks-ch5vshcd.js.map +10 -0
  11. package/dist/shared/{stacks-f0hfqaj5.js → stacks-cyeajysa.js} +2 -2
  12. package/dist/shared/{stacks-msmgyerb.js → stacks-r2yw4xzb.js} +4 -3
  13. package/dist/shared/stacks-r2yw4xzb.js.map +10 -0
  14. package/dist/shared/stacks-tqrws7kd.js +252 -0
  15. package/dist/shared/stacks-tqrws7kd.js.map +12 -0
  16. package/dist/src/accounts/index.js +1 -2
  17. package/dist/src/accounts/index.js.map +2 -2
  18. package/dist/src/actions/index.cjs +3 -1
  19. package/dist/src/actions/index.cjs.map +1 -1
  20. package/dist/src/actions/index.d.cts +16 -1
  21. package/dist/src/actions/index.d.ts +16 -1
  22. package/dist/src/actions/index.js +9 -6
  23. package/dist/src/actions/index.js.map +1 -1
  24. package/dist/src/bitcoin/index.js +2 -3
  25. package/dist/src/bitcoin/index.js.map +2 -2
  26. package/dist/src/bns/index.js +3 -4
  27. package/dist/src/bns/index.js.map +2 -2
  28. package/dist/src/chains/index.js +1 -2
  29. package/dist/src/chains/index.js.map +1 -1
  30. package/dist/src/clarity/index.d.cts +3 -1
  31. package/dist/src/clarity/index.d.ts +3 -1
  32. package/dist/src/clarity/index.js +3 -2
  33. package/dist/src/clarity/index.js.map +1 -1
  34. package/dist/src/filters/index.cjs +1 -261
  35. package/dist/src/filters/index.cjs.map +3 -6
  36. package/dist/src/filters/index.js +13 -249
  37. package/dist/src/filters/index.js.map +3 -6
  38. package/dist/src/index.cjs +2 -75
  39. package/dist/src/index.cjs.map +3 -8
  40. package/dist/src/index.d.cts +389 -164
  41. package/dist/src/index.d.ts +389 -164
  42. package/dist/src/index.js +7 -80
  43. package/dist/src/index.js.map +3 -8
  44. package/dist/src/postconditions/index.js +1 -2
  45. package/dist/src/postconditions/index.js.map +1 -1
  46. package/dist/src/pox/index.js +3 -4
  47. package/dist/src/pox/index.js.map +2 -2
  48. package/dist/src/pox5/index.js +4 -5
  49. package/dist/src/pox5/index.js.map +2 -2
  50. package/dist/src/sbtc/index.js +3 -4
  51. package/dist/src/sbtc/index.js.map +2 -2
  52. package/dist/src/stackingdao/index.js +3 -4
  53. package/dist/src/stackingdao/index.js.map +2 -2
  54. package/dist/src/subscriptions/index.js +1 -2
  55. package/dist/src/subscriptions/index.js.map +1 -1
  56. package/dist/src/tools/index.cjs +3 -2
  57. package/dist/src/tools/index.cjs.map +4 -4
  58. package/dist/src/tools/index.js +3 -2
  59. package/dist/src/tools/index.js.map +4 -4
  60. package/dist/src/transactions/index.js +1 -2
  61. package/dist/src/transactions/index.js.map +1 -1
  62. package/dist/src/utils/index.js +1 -2
  63. package/dist/src/utils/index.js.map +2 -2
  64. package/dist/src/x402/index.js +1 -2
  65. package/dist/src/x402/index.js.map +2 -2
  66. package/package.json +4 -2
  67. package/dist/shared/stacks-cdvn8qbh.cjs.map +0 -10
  68. package/dist/shared/stacks-cfazrteq.js +0 -20
  69. package/dist/shared/stacks-cfazrteq.js.map +0 -9
  70. package/dist/shared/stacks-msmgyerb.js.map +0 -10
  71. package/dist/shared/stacks-rb9shyk8.js.map +0 -10
  72. /package/dist/shared/{stacks-f0hfqaj5.js.map → stacks-cyeajysa.js.map} +0 -0
@@ -52,7 +52,6 @@ import {
52
52
  import"../../shared/stacks-2mm20wqf.js";
53
53
  import"../../shared/stacks-azp00pve.js";
54
54
  import"../../shared/stacks-qs5fzts5.js";
55
- import"../../shared/stacks-cfazrteq.js";
56
55
  export {
57
56
  signTransactionWithAccount,
58
57
  signTransaction,
@@ -103,5 +102,5 @@ export {
103
102
  AddressHashMode
104
103
  };
105
104
 
106
- //# debugId=AE530DDA13A7DED764756E2164756E21
105
+ //# debugId=807B224563D0746B64756E2164756E21
107
106
  //# sourceMappingURL=index.js.map
@@ -4,6 +4,6 @@
4
4
  "sourcesContent": [
5
5
  ],
6
6
  "mappings": "",
7
- "debugId": "AE530DDA13A7DED764756E2164756E21",
7
+ "debugId": "807B224563D0746B64756E2164756E21",
8
8
  "names": []
9
9
  }
@@ -52,7 +52,6 @@ import {
52
52
  writeUInt32BE,
53
53
  writeUInt8
54
54
  } from "../../shared/stacks-qs5fzts5.js";
55
- import"../../shared/stacks-cfazrteq.js";
56
55
  // src/utils/signature.ts
57
56
  import { sha256 as sha2562 } from "@noble/hashes/sha2.js";
58
57
  import { Signature as NobleSignature, verify } from "@noble/secp256k1";
@@ -216,5 +215,5 @@ export {
216
215
  AddressVersion
217
216
  };
218
217
 
219
- //# debugId=F99004DF2704D3DE64756E2164756E21
218
+ //# debugId=EC0621F8EF3DEDCD64756E2164756E21
220
219
  //# sourceMappingURL=index.js.map
@@ -5,7 +5,7 @@
5
5
  "import { sha256 } from \"@noble/hashes/sha2.js\";\nimport { Signature as NobleSignature, verify } from \"@noble/secp256k1\";\nimport { c32address } from \"./address.ts\";\nimport { AddressVersion } from \"./constants.ts\";\nimport { concatBytes, hexToBytes, utf8ToBytes } from \"./encoding.ts\";\nimport { hashP2PKH } from \"./hash.ts\";\n\nexport interface RecoverableSignature {\n\t/** Recovery id (0–3) */\n\trecovery: number;\n\t/** 32-byte r value as hex */\n\tr: string;\n\t/** 32-byte s value as hex */\n\ts: string;\n}\n\n// --- Format conversion ---\n\n/**\n * Parse a 65-byte VRS hex signature into components.\n * VRS format: recovery (1 byte) + r (32 bytes) + s (32 bytes)\n */\nexport function parseSignature(hex: string): RecoverableSignature {\n\tconst clean = hex.startsWith(\"0x\") ? hex.slice(2) : hex;\n\tif (clean.length !== 130) {\n\t\tthrow new Error(\n\t\t\t`Invalid signature length: expected 130 hex chars, got ${clean.length}`,\n\t\t);\n\t}\n\treturn {\n\t\trecovery: Number.parseInt(clean.slice(0, 2), 16),\n\t\tr: clean.slice(2, 66),\n\t\ts: clean.slice(66, 130),\n\t};\n}\n\n/**\n * Serialize a recoverable signature to 65-byte VRS hex (130 chars).\n */\nexport function serializeSignature(sig: RecoverableSignature): string {\n\tconst v = sig.recovery.toString(16).padStart(2, \"0\");\n\treturn v + sig.r + sig.s;\n}\n\n/** Convert VRS hex to RSV hex: r+s (128 chars) + recovery (2 chars). */\nexport function signatureVrsToRsv(vrs: string): string {\n\tconst clean = vrs.startsWith(\"0x\") ? vrs.slice(2) : vrs;\n\treturn clean.slice(2) + clean.slice(0, 2);\n}\n\n/** Convert RSV hex to VRS hex: recovery (2 chars) + r+s (128 chars). */\nexport function signatureRsvToVrs(rsv: string): string {\n\tconst clean = rsv.startsWith(\"0x\") ? rsv.slice(2) : rsv;\n\treturn clean.slice(-2) + clean.slice(0, -2);\n}\n\n// --- Recovery ---\n\n/**\n * Recover a public key from a message hash and VRS signature.\n * @returns hex-encoded public key (33 bytes compressed, or 65 bytes uncompressed)\n */\nexport function recoverPublicKey(\n\thash: Uint8Array | string,\n\tsignature: string,\n\tcompressed = true,\n): string {\n\tconst parsed = parseSignature(signature);\n\tconst rs = parsed.r + parsed.s;\n\tconst sig = NobleSignature.fromCompact(rs).addRecoveryBit(parsed.recovery);\n\tconst msgHash = typeof hash === \"string\" ? hexToBytes(hash) : hash;\n\tconst point = sig.recoverPublicKey(msgHash);\n\treturn point.toHex(compressed);\n}\n\n/**\n * Recover a Stacks address from a message hash and VRS signature.\n * @param addressVersion defaults to MainnetSingleSig (22)\n */\nexport function recoverAddress(\n\thash: Uint8Array | string,\n\tsignature: string,\n\taddressVersion: number = AddressVersion.MainnetSingleSig,\n): string {\n\tconst pubkey = recoverPublicKey(hash, signature, true);\n\tconst pubkeyHash = hashP2PKH(hexToBytes(pubkey));\n\treturn c32address(addressVersion, pubkeyHash);\n}\n\n// --- Verification ---\n\n/**\n * Verify an ECDSA signature against a message hash and public key.\n * Accepts compact (64-byte) signature as hex or Uint8Array.\n */\nexport function verifySignature(\n\thash: Uint8Array | string,\n\tsignature: string | Uint8Array,\n\tpublicKey: string | Uint8Array,\n): boolean {\n\treturn verify(signature, hash, publicKey, { lowS: false });\n}\n\n/** Bitcoin-style varint encoding for message length prefix. */\nfunction encodeVarint(n: number): Uint8Array {\n\tif (n < 0xfd) return new Uint8Array([n]);\n\tif (n <= 0xffff) {\n\t\tconst buf = new Uint8Array(3);\n\t\tbuf[0] = 0xfd;\n\t\tbuf[1] = n & 0xff;\n\t\tbuf[2] = (n >> 8) & 0xff;\n\t\treturn buf;\n\t}\n\tconst buf = new Uint8Array(5);\n\tbuf[0] = 0xfe;\n\tbuf[1] = n & 0xff;\n\tbuf[2] = (n >> 8) & 0xff;\n\tbuf[3] = (n >> 16) & 0xff;\n\tbuf[4] = (n >> 24) & 0xff;\n\treturn buf;\n}\n\nconst STACKS_MESSAGE_PREFIX = \"\\x17Stacks Signed Message:\\n\";\nconst LEGACY_MESSAGE_PREFIX = \"\\x18Stacks Message Signing:\\n\";\n\n/** Hash a message with the Stacks structured message prefix. */\nfunction hashMessage(message: string | Uint8Array, prefix: string): Uint8Array {\n\tconst messageBytes =\n\t\ttypeof message === \"string\" ? utf8ToBytes(message) : message;\n\tconst prefixBytes = utf8ToBytes(prefix);\n\tconst lengthBytes = encodeVarint(messageBytes.length);\n\treturn sha256(concatBytes(prefixBytes, lengthBytes, messageBytes));\n}\n\n/**\n * Verify a signed Stacks message.\n * Parses a VRS signature, extracts r+s for verification.\n * Falls back to legacy prefix if standard prefix fails.\n */\nexport function verifyMessageSignature(\n\tmessage: string | Uint8Array,\n\tsignature: string,\n\tpublicKey: string,\n): boolean {\n\tconst parsed = parseSignature(signature);\n\tconst compactSig = parsed.r + parsed.s;\n\n\tconst msgHash = hashMessage(message, STACKS_MESSAGE_PREFIX);\n\tif (verify(compactSig, msgHash, publicKey, { lowS: false })) return true;\n\n\t// Fallback to legacy prefix\n\tif (typeof message === \"string\") {\n\t\tconst legacyHash = hashMessage(message, LEGACY_MESSAGE_PREFIX);\n\t\tif (verify(compactSig, legacyHash, publicKey, { lowS: false })) return true;\n\t}\n\n\treturn false;\n}\n",
6
6
  "import { Point, etc } from \"@noble/secp256k1\";\nimport { bytesToHex, hexToBytes } from \"./encoding.ts\";\n\n/** Compress a public key to 33 bytes (hex). */\nexport function compressPublicKey(publicKey: string | Uint8Array): string {\n\tconst hex = typeof publicKey === \"string\" ? publicKey : bytesToHex(publicKey);\n\treturn Point.fromHex(hex).toHex(true);\n}\n\n/** Uncompress a public key to 65 bytes (hex). */\nexport function uncompressPublicKey(publicKey: string | Uint8Array): string {\n\tconst hex = typeof publicKey === \"string\" ? publicKey : bytesToHex(publicKey);\n\treturn Point.fromHex(hex).toHex(false);\n}\n\n/** Check if a public key is in compressed format (starts with 0x02 or 0x03). */\nexport function isCompressedPublicKey(publicKey: string | Uint8Array): boolean {\n\tconst bytes =\n\t\ttypeof publicKey === \"string\" ? hexToBytes(publicKey) : publicKey;\n\treturn bytes.length === 33 && (bytes[0] === 0x02 || bytes[0] === 0x03);\n}\n\n/** Generate cryptographically secure random bytes. Defaults to 32 bytes. */\nexport function randomBytes(length?: number): Uint8Array {\n\treturn etc.randomBytes(length ?? 32);\n}\n"
7
7
  ],
8
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mBAAS;AACT,sBAAS;AAqBF,SAAS,cAAc,CAAC,KAAmC;A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O,YAAY,UAAU;AAAA,IAChC,MAAM,aAAa,YAAY,SAAS,qBAAqB;AAAA,IAC7D,IAAI,OAAO,YAAY,YAAY,WAAW,EAAE,MAAM,MAAM,CAAC;AAAA,MAAG,OAAO;AAAA,EACxE;AAAA,EAEA,OAAO;AAAA;;AC5JR;AAIO,SAAS,iBAAiB,CAAC,WAAwC;AAAA,EACzE,MAAM,MAAM,OAAO,cAAc,WAAW,YAAY,WAAW,SAAS;AAAA,EAC5E,OAAO,MAAM,QAAQ,GAAG,EAAE,MAAM,IAAI;AAAA;AAI9B,SAAS,mBAAmB,CAAC,WAAwC;AAAA,EAC3E,MAAM,MAAM,OAAO,cAAc,WAAW,YAAY,WAAW,SAAS;AAAA,EAC5E,OAAO,MAAM,QAAQ,GAAG,EAAE,MAAM,KAAK;AAAA;AAI/B,SAAS,qBAAqB,CAAC,WAAyC;AAAA,EAC9E,MAAM,QACL,OAAO,cAAc,WAAW,WAAW,SAAS,IAAI;AAAA,EACzD,OAAO,MAAM,WAAW,OAAO,MAAM,OAAO,KAAQ,MAAM,OAAO;AAAA;AAI3D,SAAS,WAAW,CAAC,QAA6B;AAAA,EACxD,OAAO,IAAI,YAAY,UAAU,EAAE;AAAA;",
9
+ "debugId": "EC0621F8EF3DEDCD64756E2164756E21",
10
10
  "names": []
11
11
  }
@@ -26,7 +26,6 @@ import {
26
26
  import {
27
27
  utf8ToBytes
28
28
  } from "../../shared/stacks-qs5fzts5.js";
29
- import"../../shared/stacks-cfazrteq.js";
30
29
 
31
30
  // src/x402/build.ts
32
31
  function buildExactTransfer(options) {
@@ -87,5 +86,5 @@ export {
87
86
  buildExactTransfer
88
87
  };
89
88
 
90
- //# debugId=E6F437861BF4CE0264756E2164756E21
89
+ //# debugId=F83B60203303BF2E64756E2164756E21
91
90
  //# sourceMappingURL=index.js.map
@@ -5,7 +5,7 @@
5
5
  "import type { StacksChain } from \"../chains/types.ts\";\nimport { Cl } from \"../clarity/values.ts\";\nimport { Pc } from \"../postconditions/builder.ts\";\nimport type { PostCondition } from \"../postconditions/types.ts\";\nimport {\n\tbuildContractCall,\n\tbuildTokenTransfer,\n} from \"../transactions/build.ts\";\nimport {\n\tMEMO_MAX_LENGTH_BYTES,\n\ttype StacksTransaction,\n} from \"../transactions/types.ts\";\nimport { parseContractId } from \"../utils/address.ts\";\nimport { type IntegerType, utf8ToBytes } from \"../utils/encoding.ts\";\n\n/**\n * The asset an x402 payment moves. Either native STX or a SIP-010 token,\n * in which case the fully-qualified contract id and the fungible-token asset\n * name (the `::<asset-name>` suffix, e.g. `sbtc-token`) are both required —\n * the asset name is not always equal to the contract name.\n */\nexport type X402Asset =\n\t| { kind: \"stx\" }\n\t| { kind: \"sip010\"; contractId: string; assetName: string };\n\nexport type BuildExactTransferOptions = {\n\t/** The asset and amount to move. */\n\tasset: X402Asset;\n\tamount: IntegerType;\n\t/** Recipient principal (the resource server's `payTo`). */\n\tpayTo: string;\n\t/** Origin/payer principal — pinned by the post-condition. */\n\tpayer: string;\n\t/** Origin compressed public key (the payer signs origin-only). */\n\tpayerPublicKey: string;\n\t/** The payer account's next nonce. */\n\taccountNonce: IntegerType;\n\t/**\n\t * The x402 challenge nonce, carried in the on-chain memo so the facilitator\n\t * can correlate the settled tx with the challenge. Bound to ≤ 34 bytes\n\t * (UTF-8) — both the STX memo and the SIP-010 `(buff 34)` memo arg cap there.\n\t */\n\tnonce: string;\n\tchain?: StacksChain;\n};\n\n/**\n * Build an exact-amount, Deny-mode, post-conditioned, **sponsored** transfer\n * (origin-only, un-broadcast). The origin sets fee `0`; the facilitator's\n * sponsor fills in + pays the fee at settle time. The Deny-mode post-condition\n * asserts EXACTLY `amount` leaves `payer` to `payTo`, so settlement aborts\n * on-chain if anything differs — the \"exact amount\" x402 guarantee is enforced\n * by Clarity, not just by facilitator simulation.\n */\nexport function buildExactTransfer(\n\toptions: BuildExactTransferOptions,\n): StacksTransaction {\n\tconst { asset, amount, payTo, payer, payerPublicKey, accountNonce, chain } =\n\t\toptions;\n\n\tif (utf8ToBytes(options.nonce).byteLength > MEMO_MAX_LENGTH_BYTES) {\n\t\tthrow new Error(\n\t\t\t`x402 nonce exceeds the ${MEMO_MAX_LENGTH_BYTES}-byte memo budget`,\n\t\t);\n\t}\n\n\tif (asset.kind === \"stx\") {\n\t\t// A TokenTransfer payload CANNOT carry post-conditions (Stacks consensus\n\t\t// rejects it: \"TokenTransfer transactions do not support post-conditions\").\n\t\t// STX exactness is inherent — the amount + recipient are in the signed\n\t\t// payload, so there is nothing a post-condition would add.\n\t\treturn buildTokenTransfer({\n\t\t\trecipient: payTo,\n\t\t\tamount,\n\t\t\tmemo: options.nonce,\n\t\t\tfee: 0,\n\t\t\tnonce: accountNonce,\n\t\t\tpublicKey: payerPublicKey,\n\t\t\tchain,\n\t\t\tsponsored: true,\n\t\t});\n\t}\n\n\tconst [contractAddress, contractName] = parseContractId(asset.contractId);\n\tconst postConditions: PostCondition[] = [\n\t\tPc.principal(payer)\n\t\t\t.willSendEq(amount)\n\t\t\t.ft(asset.contractId, asset.assetName),\n\t];\n\t// SIP-010: (transfer (amount uint) (sender principal) (recipient principal) (memo (optional (buff 34))))\n\treturn buildContractCall({\n\t\tcontractAddress,\n\t\tcontractName,\n\t\tfunctionName: \"transfer\",\n\t\tfunctionArgs: [\n\t\t\tCl.uint(amount),\n\t\t\tCl.principal(payer),\n\t\t\tCl.principal(payTo),\n\t\t\tCl.some(Cl.bufferFromUtf8(options.nonce)),\n\t\t],\n\t\tfee: 0,\n\t\tnonce: accountNonce,\n\t\tpublicKey: payerPublicKey,\n\t\tchain,\n\t\tpostConditionMode: \"deny\",\n\t\tpostConditions,\n\t\tsponsored: true,\n\t});\n}\n",
6
6
  "import type { TransactionReceipt } from \"../actions/public/txSources.ts\";\nimport { sendTransaction } from \"../actions/wallet/sendTransaction.ts\";\nimport { sponsorTransaction } from \"../actions/wallet/sponsorTransaction.ts\";\nimport type { Client } from \"../clients/types.ts\";\nimport { deserializeTransaction } from \"../transactions/wire/deserialize.ts\";\nimport type { IntegerType } from \"../utils/encoding.ts\";\n\nexport type SponsorAndBroadcastOptions = {\n\t/** Override the sponsor fee (µSTX). Defaults to a fee estimate. */\n\tfee?: IntegerType;\n\t/** Override the sponsor account nonce. Defaults to the on-chain nonce. */\n\tnonce?: IntegerType;\n\t/**\n\t * Wait for the payment to be mined before returning (`true` = 1\n\t * confirmation, a number = that many). Settlement rejects if the payment\n\t * aborts or drops, instead of reporting a txid that never lands.\n\t */\n\twait?: boolean | number;\n};\n\nexport type SponsorAndBroadcastResult = {\n\ttxid: string;\n\t/** Present when `wait` was requested. */\n\treceipt?: TransactionReceipt;\n};\n\n/**\n * Take an origin-signed, sponsored transfer (hex) from the payer, sponsor-sign\n * it with `client`'s account (paying the STX fee), and broadcast it.\n *\n * The payer never holds STX: they sign origin-only with fee `0`; this fills in\n * the sponsor spending condition + fee and POSTs to `/v2/transactions`. The\n * sponsor cannot grief the payer — amount/recipient/asset are pinned by the\n * origin signature + Deny-mode post-conditions baked into the tx.\n *\n * @param client a wallet client whose `account` is the funded sponsor signer.\n * @param signedTxHex the payer's origin-signed sponsored tx, hex-serialized.\n */\nexport async function sponsorAndBroadcast(\n\tclient: Client,\n\tsignedTxHex: string,\n\toptions: SponsorAndBroadcastOptions = {},\n): Promise<SponsorAndBroadcastResult> {\n\tconst transaction = deserializeTransaction(signedTxHex);\n\tconst sponsored = await sponsorTransaction(client, {\n\t\ttransaction,\n\t\tfee: options.fee,\n\t\tnonce: options.nonce,\n\t});\n\treturn sendTransaction(client, {\n\t\ttransaction: sponsored,\n\t\twait: options.wait,\n\t});\n}\n"
7
7
  ],
8
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDO,SAAS,kBAAkB,CACjC,SACoB;AAAA,EACpB,QAAQ,OAAO,QAAQ,OAAO,OAAO,gBAAgB,cAAc,UAClE;AAAA,EAED,IAAI,YAAY,QAAQ,KAAK,EAAE,aAAa,uBAAuB;AAAA,IAClE,MAAM,IAAI,MAC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a;AAAA,IACb,MAAM,QAAQ;AAAA,EACf,CAAC;AAAA;",
9
+ "debugId": "F83B60203303BF2E64756E2164756E21",
10
10
  "names": []
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@secondlayer/stacks",
3
- "version": "2.21.1",
3
+ "version": "3.0.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -120,7 +120,9 @@
120
120
  "require": "./dist/src/filters/index.cjs"
121
121
  }
122
122
  },
123
- "files": ["dist"],
123
+ "files": [
124
+ "dist"
125
+ ],
124
126
  "scripts": {
125
127
  "build": "bunup",
126
128
  "test": "bun test",
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/actions/public/readContract.ts"],
4
- "sourcesContent": [
5
- "import { deserializeCVBytes } from \"../../clarity/deserialize.ts\";\nimport { serializeCVBytes } from \"../../clarity/serialize.ts\";\nimport type { ClarityValue } from \"../../clarity/types.ts\";\nimport type { Client } from \"../../clients/types.ts\";\nimport { parseContractId } from \"../../utils/address.ts\";\nimport { bytesToHex, with0x } from \"../../utils/encoding.ts\";\n\nexport type ReadContractParams = {\n\tcontract: string; // \"address.name\"\n\tfunctionName: string;\n\targs?: ClarityValue[];\n\tsender?: string;\n};\n\nexport async function readContract<T extends ClarityValue = ClarityValue>(\n\tclient: Client,\n\tparams: ReadContractParams,\n): Promise<T> {\n\tconst [address, name] = parseContractId(params.contract);\n\tconst sender = params.sender ?? address;\n\n\tconst serializedArgs = (params.args ?? []).map((arg) =>\n\t\twith0x(bytesToHex(serializeCVBytes(arg))),\n\t);\n\n\tconst data = await client.request(\n\t\t`/v2/contracts/call-read/${address}/${name}/${params.functionName}`,\n\t\t{\n\t\t\tmethod: \"POST\",\n\t\t\tbody: {\n\t\t\t\tsender,\n\t\t\t\targuments: serializedArgs,\n\t\t\t},\n\t\t},\n\t);\n\n\tif (data.okay) {\n\t\treturn deserializeCVBytes<T>(data.result);\n\t}\n\tthrow new Error(data.cause ?? \"Read-only call failed\");\n}\n"
6
- ],
7
- "mappings": ";AAcA,eAAsB,YAAmD,CACxE,QACA,QACa;AAAA,EACb,OAAO,SAAS,QAAQ,gBAAgB,OAAO,QAAQ;AAAA,EACvD,MAAM,SAAS,OAAO,UAAU;AAAA,EAEhC,MAAM,kBAAkB,OAAO,QAAQ,CAAC,GAAG,IAAI,CAAC,QAC/C,OAAO,WAAW,iBAAiB,GAAG,CAAC,CAAC,CACzC;AAAA,EAEA,MAAM,OAAO,MAAM,OAAO,QACzB,2BAA2B,WAAW,QAAQ,OAAO,gBACrD;AAAA,IACC,QAAQ;AAAA,IACR,MAAM;AAAA,MACL;AAAA,MACA,WAAW;AAAA,IACZ;AAAA,EACD,CACD;AAAA,EAEA,IAAI,KAAK,MAAM;AAAA,IACd,OAAO,mBAAsB,KAAK,MAAM;AAAA,EACzC;AAAA,EACA,MAAM,IAAI,MAAM,KAAK,SAAS,uBAAuB;AAAA;",
8
- "debugId": "9736239B45D9470164756E2164756E21",
9
- "names": []
10
- }
@@ -1,20 +0,0 @@
1
- import { createRequire } from "node:module";
2
- var __defProp = Object.defineProperty;
3
- var __returnValue = (v) => v;
4
- function __exportSetter(name, newValue) {
5
- this[name] = __returnValue.bind(null, newValue);
6
- }
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, {
10
- get: all[name],
11
- enumerable: true,
12
- configurable: true,
13
- set: __exportSetter.bind(all, name)
14
- });
15
- };
16
-
17
- export { __export };
18
-
19
- //# debugId=BB9EAB269C729A1F64756E2164756E21
20
- //# sourceMappingURL=stacks-cfazrteq.js.map
@@ -1,9 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [
5
- ],
6
- "mappings": "",
7
- "debugId": "BB9EAB269C729A1F64756E2164756E21",
8
- "names": []
9
- }
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/actions/public/readContract.ts"],
4
- "sourcesContent": [
5
- "import { deserializeCVBytes } from \"../../clarity/deserialize.ts\";\nimport { serializeCVBytes } from \"../../clarity/serialize.ts\";\nimport type { ClarityValue } from \"../../clarity/types.ts\";\nimport type { Client } from \"../../clients/types.ts\";\nimport { parseContractId } from \"../../utils/address.ts\";\nimport { bytesToHex, with0x } from \"../../utils/encoding.ts\";\n\nexport type ReadContractParams = {\n\tcontract: string; // \"address.name\"\n\tfunctionName: string;\n\targs?: ClarityValue[];\n\tsender?: string;\n};\n\nexport async function readContract<T extends ClarityValue = ClarityValue>(\n\tclient: Client,\n\tparams: ReadContractParams,\n): Promise<T> {\n\tconst [address, name] = parseContractId(params.contract);\n\tconst sender = params.sender ?? address;\n\n\tconst serializedArgs = (params.args ?? []).map((arg) =>\n\t\twith0x(bytesToHex(serializeCVBytes(arg))),\n\t);\n\n\tconst data = await client.request(\n\t\t`/v2/contracts/call-read/${address}/${name}/${params.functionName}`,\n\t\t{\n\t\t\tmethod: \"POST\",\n\t\t\tbody: {\n\t\t\t\tsender,\n\t\t\t\targuments: serializedArgs,\n\t\t\t},\n\t\t},\n\t);\n\n\tif (data.okay) {\n\t\treturn deserializeCVBytes<T>(data.result);\n\t}\n\tthrow new Error(data.cause ?? \"Read-only call failed\");\n}\n"
6
- ],
7
- "mappings": ";;;;;;;;;;;;;AAcA,eAAsB,YAAmD,CACxE,QACA,QACa;AAAA,EACb,OAAO,SAAS,QAAQ,gBAAgB,OAAO,QAAQ;AAAA,EACvD,MAAM,SAAS,OAAO,UAAU;AAAA,EAEhC,MAAM,kBAAkB,OAAO,QAAQ,CAAC,GAAG,IAAI,CAAC,QAC/C,OAAO,WAAW,iBAAiB,GAAG,CAAC,CAAC,CACzC;AAAA,EAEA,MAAM,OAAO,MAAM,OAAO,QACzB,2BAA2B,WAAW,QAAQ,OAAO,gBACrD;AAAA,IACC,QAAQ;AAAA,IACR,MAAM;AAAA,MACL;AAAA,MACA,WAAW;AAAA,IACZ;AAAA,EACD,CACD;AAAA,EAEA,IAAI,KAAK,MAAM;AAAA,IACd,OAAO,mBAAsB,KAAK,MAAM;AAAA,EACzC;AAAA,EACA,MAAM,IAAI,MAAM,KAAK,SAAS,uBAAuB;AAAA;",
8
- "debugId": "46B15CD66C8EE3CB64756E2164756E21",
9
- "names": []
10
- }
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/actions/getContract.ts"],
4
- "sourcesContent": [
5
- "import type {\n\tAbiContract,\n\tAbiFunction,\n\tAbiMap,\n\tAbiType,\n\tAbiTypesOf,\n\tContractTypes,\n\tExtractFunctionArgs,\n\tExtractFunctionOutput,\n\tExtractMapKey,\n\tExtractMapNames,\n\tExtractMapValue,\n\tExtractPublicFunctions,\n\tExtractReadOnlyFunctions,\n} from \"../clarity/abi/index.ts\";\nimport { type ToCamelCase, toCamelCase } from \"../clarity/abi/utils.ts\";\nimport {\n\tclarityValueToJSUntyped,\n\tjsToClarityValue,\n} from \"../clarity/bridge.ts\";\nimport type { ClarityValue } from \"../clarity/types.ts\";\nimport type { Client } from \"../clients/types.ts\";\nimport type { PostCondition } from \"../postconditions/types.ts\";\nimport { buildContractCall } from \"../transactions/build.ts\";\nimport type { StacksTransaction } from \"../transactions/types.ts\";\nimport { publicKeyToAddress } from \"../utils/address.ts\";\nimport type { IntegerType } from \"../utils/encoding.ts\";\nimport { estimateFee } from \"./public/estimateFee.ts\";\nimport { getMapEntry } from \"./public/getMapEntry.ts\";\nimport { readContract } from \"./public/readContract.ts\";\nimport { callContract } from \"./wallet/callContract.ts\";\nimport { resolveNonce } from \"./wallet/nonceManager.ts\";\nimport { setUnsignedFee } from \"./wallet/utils.ts\";\n\n// --- Type helpers for unwrapping response types ---\n\n/**\n * Unwrap `(response ok err)` → just the `ok` branch type. Distributes over the\n * `{ ok } | { err }` union: the `err` branch maps to `never` (it throws\n * `ContractResponseError` at runtime, so it never reaches the caller).\n */\ntype UnwrapResponse<T> = T extends { ok: infer O }\n\t? O\n\t: T extends { err: unknown }\n\t\t? never\n\t\t: T;\n\ntype ReadMethodReturn<\n\tC extends AbiContract,\n\tN extends ExtractReadOnlyFunctions<C>,\n> = UnwrapResponse<ExtractFunctionOutput<C, N>>;\n\n// --- Public type for the contract instance ---\n\n/**\n * When the ABI carries a codegen brand (`TypedAbi`), method types resolve to\n * the generated named aliases — cleaner hovers and error messages. Un-branded\n * ABIs fall back to structural inference over the as-const literal.\n */\ntype TypedReadMethods<T extends ContractTypes> = {\n\t[K in keyof T[\"functions\"] as T[\"functions\"][K][\"access\"] extends \"read-only\"\n\t\t? K\n\t\t: never]: (\n\t\targs: T[\"functions\"][K][\"args\"],\n\t) => Promise<UnwrapResponse<T[\"functions\"][K][\"ret\"]>>;\n};\n\ntype TypedCallMethods<T extends ContractTypes> = {\n\t[K in keyof T[\"functions\"] as T[\"functions\"][K][\"access\"] extends \"public\"\n\t\t? K\n\t\t: never]: (\n\t\targs: T[\"functions\"][K][\"args\"],\n\t\toptions?: ContractCallOptions,\n\t) => Promise<string>;\n};\n\ntype TypedMapMethods<T extends ContractTypes> = {\n\t[K in keyof NonNullable<T[\"maps\"]>]: (\n\t\tkey: NonNullable<T[\"maps\"]>[K][\"key\"],\n\t) => Promise<NonNullable<T[\"maps\"]>[K][\"value\"] | null>;\n};\n\ntype ReadMethods<C extends AbiContract> = [AbiTypesOf<C>] extends [never]\n\t? {\n\t\t\t[N in ExtractReadOnlyFunctions<C> as ToCamelCase<N>]: (\n\t\t\t\targs: ExtractFunctionArgs<C, N>,\n\t\t\t) => Promise<ReadMethodReturn<C, N>>;\n\t\t}\n\t: TypedReadMethods<AbiTypesOf<C>>;\n\ntype CallMethods<C extends AbiContract> = [AbiTypesOf<C>] extends [never]\n\t? {\n\t\t\t[N in ExtractPublicFunctions<C> as ToCamelCase<N>]: (\n\t\t\t\targs: ExtractFunctionArgs<C, N>,\n\t\t\t\toptions?: ContractCallOptions,\n\t\t\t) => Promise<string>;\n\t\t}\n\t: TypedCallMethods<AbiTypesOf<C>>;\n\ntype MapMethods<C extends AbiContract> = [AbiTypesOf<C>] extends [never]\n\t? {\n\t\t\t[N in ExtractMapNames<C> as ToCamelCase<N>]: (\n\t\t\t\tkey: ExtractMapKey<C, N>,\n\t\t\t) => Promise<ExtractMapValue<C, N> | null>;\n\t\t}\n\t: TypedMapMethods<AbiTypesOf<C>>;\n\nexport type ContractCallOptions = {\n\tfee?: IntegerType;\n\tnonce?: IntegerType;\n\tpostConditionMode?: \"allow\" | \"deny\";\n\tpostConditions?: PostCondition[];\n};\n\n/**\n * Options for `buildCall.*` — building an unsigned transaction for\n * wallet-signs-later flows. `publicKey` defaults to the client account's\n * public key; `fee`/`nonce` are resolved from the network when omitted.\n */\nexport type ContractBuildCallOptions = ContractCallOptions & {\n\tpublicKey?: string;\n\tsponsored?: boolean;\n};\n\ntype TypedBuildCallMethods<T extends ContractTypes> = {\n\t[K in keyof T[\"functions\"] as T[\"functions\"][K][\"access\"] extends \"public\"\n\t\t? K\n\t\t: never]: (\n\t\targs: T[\"functions\"][K][\"args\"],\n\t\toptions?: ContractBuildCallOptions,\n\t) => Promise<StacksTransaction>;\n};\n\ntype BuildCallMethods<C extends AbiContract> = [AbiTypesOf<C>] extends [never]\n\t? {\n\t\t\t[N in ExtractPublicFunctions<C> as ToCamelCase<N>]: (\n\t\t\t\targs: ExtractFunctionArgs<C, N>,\n\t\t\t\toptions?: ContractBuildCallOptions,\n\t\t\t) => Promise<StacksTransaction>;\n\t\t}\n\t: TypedBuildCallMethods<AbiTypesOf<C>>;\n\nexport type ContractInstance<C extends AbiContract> = {\n\tread: ReadMethods<C>;\n\tcall: CallMethods<C>;\n\t/** Build unsigned transactions (wallet-signs-later) — never broadcasts. */\n\tbuildCall: BuildCallMethods<C>;\n\tmaps: MapMethods<C>;\n};\n\nexport type GetContractParams<C extends AbiContract> = {\n\tclient: Client;\n\taddress: string;\n\tname: string;\n\tabi: C;\n};\n\nexport function getContract<const TAbi extends AbiContract>(\n\tparams: GetContractParams<TAbi>,\n): ContractInstance<TAbi> {\n\tconst { client, address, name: contractName, abi } = params;\n\tconst contractId = `${address}.${contractName}`;\n\n\t// Index functions/maps by name for fast lookup\n\tconst fnByName = new Map<string, AbiFunction>();\n\tfor (const fn of abi.functions) {\n\t\tfnByName.set(fn.name, fn as AbiFunction);\n\t}\n\n\tconst mapByName = new Map<string, AbiMap>();\n\tif (abi.maps) {\n\t\tfor (const m of abi.maps) {\n\t\t\tmapByName.set(m.name, m as AbiMap);\n\t\t}\n\t}\n\n\t// Build kebab→camel reverse map for function/map names\n\tconst camelToKebab = new Map<string, string>();\n\tfor (const fn of abi.functions) {\n\t\tcamelToKebab.set(toCamelCase(fn.name), fn.name);\n\t}\n\tif (abi.maps) {\n\t\tfor (const m of abi.maps) {\n\t\t\tcamelToKebab.set(toCamelCase(m.name), m.name);\n\t\t}\n\t}\n\n\tconst read = new Proxy({} as ReadMethods<TAbi>, {\n\t\tget(_target, prop: string) {\n\t\t\tconst fnName = camelToKebab.get(prop) ?? prop;\n\t\t\tconst fn = fnByName.get(fnName);\n\t\t\tif (!fn || fn.access !== \"read-only\") return undefined;\n\n\t\t\treturn async (args: Record<string, unknown>) => {\n\t\t\t\tconst clarityArgs = buildFunctionArgs(fn, args);\n\t\t\t\tconst result = await readContract(client, {\n\t\t\t\t\tcontract: contractId,\n\t\t\t\t\tfunctionName: fn.name,\n\t\t\t\t\targs: clarityArgs,\n\t\t\t\t});\n\n\t\t\t\tconst jsValue = clarityValueToJSUntyped(fn.outputs as AbiType, result);\n\n\t\t\t\t// Auto-unwrap: if output is response type, unwrap ok / throw on err\n\t\t\t\tif (isResponseOutput(fn.outputs as AbiType)) {\n\t\t\t\t\tconst resp = jsValue as { ok?: unknown; err?: unknown };\n\t\t\t\t\tif (\"ok\" in resp) return resp.ok;\n\t\t\t\t\tthrow new ContractResponseError(\n\t\t\t\t\t\t`${contractId}::${fn.name} returned (err ${formatErrValue(resp.err)})`,\n\t\t\t\t\t\tresp.err,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn jsValue;\n\t\t\t};\n\t\t},\n\t});\n\n\tconst call = new Proxy({} as CallMethods<TAbi>, {\n\t\tget(_target, prop: string) {\n\t\t\tconst fnName = camelToKebab.get(prop) ?? prop;\n\t\t\tconst fn = fnByName.get(fnName);\n\t\t\tif (!fn || fn.access !== \"public\") return undefined;\n\n\t\t\treturn async (\n\t\t\t\targs: Record<string, unknown>,\n\t\t\t\toptions?: ContractCallOptions,\n\t\t\t) => {\n\t\t\t\tconst clarityArgs = buildFunctionArgs(fn, args);\n\t\t\t\treturn callContract(client, {\n\t\t\t\t\tcontract: contractId,\n\t\t\t\t\tfunctionName: fn.name,\n\t\t\t\t\tfunctionArgs: clarityArgs,\n\t\t\t\t\t...options,\n\t\t\t\t});\n\t\t\t};\n\t\t},\n\t});\n\n\tconst buildCall = new Proxy({} as BuildCallMethods<TAbi>, {\n\t\tget(_target, prop: string) {\n\t\t\tconst fnName = camelToKebab.get(prop) ?? prop;\n\t\t\tconst fn = fnByName.get(fnName);\n\t\t\tif (!fn || fn.access !== \"public\") return undefined;\n\n\t\t\treturn async (\n\t\t\t\targs: Record<string, unknown>,\n\t\t\t\toptions?: ContractBuildCallOptions,\n\t\t\t) => {\n\t\t\t\tconst publicKey = options?.publicKey ?? client.account?.publicKey;\n\t\t\t\tif (!publicKey) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\"buildCall requires a publicKey (pass options.publicKey or configure a client account)\",\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst functionArgs = buildFunctionArgs(fn, args);\n\t\t\t\tconst network = client.chain?.network ?? \"mainnet\";\n\t\t\t\tconst nonce =\n\t\t\t\t\toptions?.nonce ??\n\t\t\t\t\t(await resolveNonce(client, publicKeyToAddress(publicKey, network)));\n\n\t\t\t\tconst unsigned = buildContractCall({\n\t\t\t\t\tcontractAddress: address,\n\t\t\t\t\tcontractName,\n\t\t\t\t\tfunctionName: fn.name,\n\t\t\t\t\tfunctionArgs,\n\t\t\t\t\tfee: options?.fee ?? 0n,\n\t\t\t\t\tnonce,\n\t\t\t\t\tpublicKey,\n\t\t\t\t\tchain: client.chain,\n\t\t\t\t\tpostConditionMode: options?.postConditionMode,\n\t\t\t\t\tpostConditions: options?.postConditions,\n\t\t\t\t\tsponsored: options?.sponsored,\n\t\t\t\t});\n\n\t\t\t\tif (options?.fee === undefined) {\n\t\t\t\t\tconst estimates = await estimateFee(client, {\n\t\t\t\t\t\ttransaction: unsigned,\n\t\t\t\t\t});\n\t\t\t\t\tconst mid = estimates[1] ?? estimates[0];\n\t\t\t\t\tif (mid) {\n\t\t\t\t\t\tsetUnsignedFee(unsigned, BigInt(mid.fee));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn unsigned;\n\t\t\t};\n\t\t},\n\t});\n\n\tconst maps = new Proxy({} as MapMethods<TAbi>, {\n\t\tget(_target, prop: string) {\n\t\t\tconst mapName = camelToKebab.get(prop) ?? prop;\n\t\t\tconst map = mapByName.get(mapName);\n\t\t\tif (!map) return undefined;\n\n\t\t\treturn async (key: unknown) => {\n\t\t\t\tconst clarityKey = jsToClarityValue(map.key as AbiType, key);\n\t\t\t\tconst result = await getMapEntry(client, {\n\t\t\t\t\tcontract: contractId,\n\t\t\t\t\tmapName: map.name,\n\t\t\t\t\tkey: clarityKey,\n\t\t\t\t});\n\n\t\t\t\t// Map entries come back as (optional ...). If none, return null.\n\t\t\t\tif (result.type === \"none\") return null;\n\t\t\t\tif (result.type === \"some\") {\n\t\t\t\t\treturn clarityValueToJSUntyped(map.value as AbiType, result.value);\n\t\t\t\t}\n\t\t\t\t// Direct value (shouldn't normally happen, but handle gracefully)\n\t\t\t\treturn clarityValueToJSUntyped(map.value as AbiType, result);\n\t\t\t};\n\t\t},\n\t});\n\n\treturn { read, call, buildCall, maps };\n}\n\n/**\n * Resolve a network-keyed contract config for the client's chain. The contracts\n * map is keyed by network (\"mainnet\" | \"testnet\"), so selection is a direct\n * index — no per-call ternary. Throws if the client has no chain configured.\n */\nexport function resolveNetworkContract<\n\tT extends Record<\"mainnet\" | \"testnet\", { address: string }>,\n>(client: Client, contracts: T): T[\"mainnet\"] | T[\"testnet\"] {\n\tif (!client.chain) {\n\t\tthrow new Error(\"Client must have a chain configured\");\n\t}\n\treturn contracts[client.chain.network];\n}\n\n// --- Helpers ---\n\nfunction buildFunctionArgs(\n\tfn: AbiFunction,\n\targs: Record<string, unknown>,\n): ClarityValue[] {\n\treturn fn.args.map((arg) => {\n\t\tconst camelKey = toCamelCase(arg.name);\n\t\tconst hasOriginal = arg.name in args;\n\t\tconst hasCamel = camelKey in args;\n\t\tconst value = hasOriginal\n\t\t\t? args[arg.name]\n\t\t\t: hasCamel\n\t\t\t\t? args[camelKey]\n\t\t\t\t: undefined;\n\t\tif (value === undefined) throw new Error(`Missing argument: ${arg.name}`);\n\t\treturn jsToClarityValue(arg.type as AbiType, value);\n\t});\n}\n\nfunction isResponseOutput(type: AbiType): boolean {\n\treturn typeof type === \"object\" && type !== null && \"response\" in type;\n}\n\nfunction formatErrValue(value: unknown): string {\n\tif (typeof value === \"bigint\") return value.toString();\n\tif (typeof value === \"string\") return `\"${value}\"`;\n\treturn String(value);\n}\n\nexport class ContractResponseError extends Error {\n\toverride name = \"ContractResponseError\";\n\tconstructor(\n\t\tmessage: string,\n\t\tpublic readonly errorValue: unknown,\n\t) {\n\t\tsuper(message);\n\t}\n}\n"
6
- ],
7
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AA6JO,SAAS,WAA2C,CAC1D,QACyB;AAAA,EACzB,QAAQ,QAAQ,SAAS,MAAM,cAAc,QAAQ;AAAA,EACrD,MAAM,aAAa,GAAG,WAAW;AAAA,EAGjC,MAAM,WAAW,IAAI;AAAA,EACrB,WAAW,MAAM,IAAI,WAAW;AAAA,IAC/B,SAAS,IAAI,GAAG,MAAM,EAAiB;AAAA,EACxC;AAAA,EAEA,MAAM,YAAY,IAAI;AAAA,EACtB,IAAI,IAAI,MAAM;AAAA,IACb,WAAW,K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