@umbra-privacy/sdk 1.0.0 → 2.0.1
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/README.md +104 -25
- package/dist/{addresses-Brzgurv_.d.ts → addresses-B7HybtbJ.d.ts} +2 -1
- package/dist/{addresses-D_0YAS6B.d.cts → addresses-CTVY1oi7.d.cts} +2 -1
- package/dist/arcium-BXXlryfe.d.cts +20 -0
- package/dist/arcium-BXXlryfe.d.ts +20 -0
- package/dist/chunk-3LS5P32X.cjs +10892 -0
- package/dist/chunk-3LS5P32X.cjs.map +1 -0
- package/dist/chunk-4RHXVBNI.js +203 -0
- package/dist/chunk-4RHXVBNI.js.map +1 -0
- package/dist/chunk-4TZVXB5G.js +324 -0
- package/dist/chunk-4TZVXB5G.js.map +1 -0
- package/dist/chunk-5GUSMQ74.cjs +549 -0
- package/dist/chunk-5GUSMQ74.cjs.map +1 -0
- package/dist/chunk-5KPQXPQM.js +36 -0
- package/dist/chunk-5KPQXPQM.js.map +1 -0
- package/dist/chunk-AXD7LXYY.cjs +405 -0
- package/dist/chunk-AXD7LXYY.cjs.map +1 -0
- package/dist/{chunk-HOEXDXRC.cjs → chunk-BL6WXLPV.cjs} +32 -360
- package/dist/chunk-BL6WXLPV.cjs.map +1 -0
- package/dist/chunk-CFFLOE7D.cjs +598 -0
- package/dist/chunk-CFFLOE7D.cjs.map +1 -0
- package/dist/{chunk-BM7N6N7E.js → chunk-CFTW5WNG.js} +3 -325
- package/dist/chunk-CFTW5WNG.js.map +1 -0
- package/dist/chunk-DD2WCK4C.js +327 -0
- package/dist/chunk-DD2WCK4C.js.map +1 -0
- package/dist/chunk-DMPMQ74B.cjs +246 -0
- package/dist/chunk-DMPMQ74B.cjs.map +1 -0
- package/dist/{chunk-2Q75CQQJ.js → chunk-EEKF4553.js} +2 -2
- package/dist/chunk-EEKF4553.js.map +1 -0
- package/dist/chunk-ENVYYEM4.cjs +113 -0
- package/dist/chunk-ENVYYEM4.cjs.map +1 -0
- package/dist/chunk-FQX6ZYGJ.js +500 -0
- package/dist/chunk-FQX6ZYGJ.js.map +1 -0
- package/dist/chunk-FSK2ICMB.cjs +39 -0
- package/dist/chunk-FSK2ICMB.cjs.map +1 -0
- package/dist/chunk-FZYWLQAF.cjs +355 -0
- package/dist/chunk-FZYWLQAF.cjs.map +1 -0
- package/dist/chunk-GP26R377.js +436 -0
- package/dist/chunk-GP26R377.js.map +1 -0
- package/dist/chunk-HA5FLM63.js +393 -0
- package/dist/chunk-HA5FLM63.js.map +1 -0
- package/dist/chunk-INJ73LXQ.js +1107 -0
- package/dist/chunk-INJ73LXQ.js.map +1 -0
- package/dist/chunk-KMRROOME.js +10750 -0
- package/dist/chunk-KMRROOME.js.map +1 -0
- package/dist/{chunk-MDFSBU5W.cjs → chunk-LTCKPTZC.cjs} +2 -351
- package/dist/chunk-LTCKPTZC.cjs.map +1 -0
- package/dist/chunk-MKNCBUFA.js +564 -0
- package/dist/chunk-MKNCBUFA.js.map +1 -0
- package/dist/chunk-NKVMSABR.cjs +207 -0
- package/dist/chunk-NKVMSABR.cjs.map +1 -0
- package/dist/chunk-OFDWNWCL.js +70 -0
- package/dist/chunk-OFDWNWCL.js.map +1 -0
- package/dist/chunk-QJAUUYZU.cjs +331 -0
- package/dist/chunk-QJAUUYZU.cjs.map +1 -0
- package/dist/chunk-TLR7A64G.js +103 -0
- package/dist/chunk-TLR7A64G.js.map +1 -0
- package/dist/{chunk-MVKTV3FT.cjs → chunk-TQQZGNOI.cjs} +2 -2
- package/dist/chunk-TQQZGNOI.cjs.map +1 -0
- package/dist/chunk-UOFYS6M3.js +219 -0
- package/dist/chunk-UOFYS6M3.js.map +1 -0
- package/dist/chunk-UXMQI6B7.js +2406 -0
- package/dist/chunk-UXMQI6B7.js.map +1 -0
- package/dist/chunk-WN75ORDT.js +571 -0
- package/dist/chunk-WN75ORDT.js.map +1 -0
- package/dist/chunk-Y55PYKXH.cjs +595 -0
- package/dist/chunk-Y55PYKXH.cjs.map +1 -0
- package/dist/chunk-YEZBTYCP.cjs +77 -0
- package/dist/chunk-YEZBTYCP.cjs.map +1 -0
- package/dist/chunk-ZQOIYCGA.cjs +1126 -0
- package/dist/chunk-ZQOIYCGA.cjs.map +1 -0
- package/dist/chunk-ZY3TSHMJ.cjs +2665 -0
- package/dist/chunk-ZY3TSHMJ.cjs.map +1 -0
- package/dist/client-DkVBHMWb.d.cts +2613 -0
- package/dist/client-V4AF6Bz9.d.ts +2613 -0
- package/dist/common/pda/index.cjs +145 -0
- package/dist/common/pda/index.cjs.map +1 -0
- package/dist/common/pda/index.d.cts +1250 -0
- package/dist/common/pda/index.d.ts +1250 -0
- package/dist/common/pda/index.js +8 -0
- package/dist/common/pda/index.js.map +1 -0
- package/dist/constants/index.cjs +38 -164
- package/dist/constants/index.cjs.map +1 -1
- package/dist/constants/index.d.cts +8 -425
- package/dist/constants/index.d.ts +8 -425
- package/dist/constants/index.js +15 -124
- package/dist/constants/index.js.map +1 -1
- package/dist/crypto/index.cjs +583 -0
- package/dist/crypto/index.cjs.map +1 -0
- package/dist/crypto/index.d.cts +6731 -0
- package/dist/crypto/index.d.ts +6731 -0
- package/dist/crypto/index.js +14 -0
- package/dist/crypto/index.js.map +1 -0
- package/dist/{cryptography-BTGC72u-.d.ts → cryptography-BFSJcvi6.d.ts} +3 -2465
- package/dist/{cryptography-BTGC72u-.d.cts → cryptography-D6tPDh-Y.d.cts} +3 -2465
- package/dist/errors/index.cjs +64 -54
- package/dist/errors/index.d.cts +7 -797
- package/dist/errors/index.d.ts +7 -797
- package/dist/errors/index.js +3 -1
- package/dist/errors-B9EoPeWV.d.cts +593 -0
- package/dist/errors-B9EoPeWV.d.ts +593 -0
- package/dist/errors-DAIrstEL.d.cts +300 -0
- package/dist/errors-DPNMfyh0.d.ts +300 -0
- package/dist/index-BG0yjL7C.d.cts +6006 -0
- package/dist/index-ByynoyBO.d.ts +6006 -0
- package/dist/index.cjs +5133 -16116
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1031 -7685
- package/dist/index.d.ts +1031 -7685
- package/dist/index.js +3228 -14905
- package/dist/index.js.map +1 -1
- package/dist/interfaces/index.d.cts +14 -6
- package/dist/interfaces/index.d.ts +14 -6
- package/dist/interfaces-43cReBcS.d.cts +3346 -0
- package/dist/interfaces-B8xKNl_6.d.ts +997 -0
- package/dist/interfaces-D2NO6kDD.d.cts +997 -0
- package/dist/interfaces-z_xYJlgV.d.ts +3346 -0
- package/dist/math/index.cjs +115 -0
- package/dist/math/index.cjs.map +1 -0
- package/dist/math/index.d.cts +1327 -0
- package/dist/math/index.d.ts +1327 -0
- package/dist/math/index.js +10 -0
- package/dist/math/index.js.map +1 -0
- package/dist/networks-RMd3abPE.d.ts +44 -0
- package/dist/networks-yAoO8peQ.d.cts +44 -0
- package/dist/relayer-NRRMSMNB.js +4 -0
- package/dist/relayer-NRRMSMNB.js.map +1 -0
- package/dist/relayer-RJHEIXJG.cjs +21 -0
- package/dist/relayer-RJHEIXJG.cjs.map +1 -0
- package/dist/solana/index.cjs +56 -0
- package/dist/solana/index.cjs.map +1 -0
- package/dist/solana/index.d.cts +105 -0
- package/dist/solana/index.d.ts +105 -0
- package/dist/solana/index.js +7 -0
- package/dist/solana/index.js.map +1 -0
- package/dist/{index-CLj_zWSD.d.ts → temporal-BbRaEPoO.d.ts} +1 -1
- package/dist/{index-CX6_pIRS.d.cts → temporal-oUj7iCaq.d.cts} +1 -1
- package/dist/transaction-forwarder-5mAMTjw6.d.ts +1155 -0
- package/dist/transaction-forwarder-C6gMUG7a.d.cts +1155 -0
- package/dist/types/index.cjs +232 -231
- package/dist/types/index.d.cts +15 -1485
- package/dist/types/index.d.ts +15 -1485
- package/dist/types/index.js +2 -1
- package/dist/types-BohhvPth.d.cts +87 -0
- package/dist/types-CW0oTT0j.d.ts +87 -0
- package/dist/types-C_V_CaKK.d.cts +2468 -0
- package/dist/types-C_V_CaKK.d.ts +2468 -0
- package/dist/types-Ca7frykr.d.ts +793 -0
- package/dist/types-CuKeoI19.d.cts +1296 -0
- package/dist/types-CxfTIpN9.d.ts +1052 -0
- package/dist/{types-n-sHFcgr.d.ts → types-D1jDUjfN.d.ts} +2 -2
- package/dist/types-DKEDUlH9.d.ts +1296 -0
- package/dist/types-EKuIfxTz.d.cts +1052 -0
- package/dist/{types-BBuELtY8.d.cts → types-IMGYmlv-.d.cts} +2 -2
- package/dist/types-PwNLi_2k.d.cts +793 -0
- package/dist/utils/index.cjs +823 -525
- package/dist/utils/index.d.cts +1711 -4021
- package/dist/utils/index.d.ts +1711 -4021
- package/dist/utils/index.js +9 -3
- package/dist/{versions-D9PqsEvj.d.cts → versions-BRlR36EA.d.cts} +1 -0
- package/dist/{versions-D9PqsEvj.d.ts → versions-BRlR36EA.d.ts} +1 -0
- package/package.json +79 -18
- package/dist/chunk-2Q75CQQJ.js.map +0 -1
- package/dist/chunk-BM7N6N7E.js.map +0 -1
- package/dist/chunk-GXKSUB2U.cjs +0 -4416
- package/dist/chunk-GXKSUB2U.cjs.map +0 -1
- package/dist/chunk-HOEXDXRC.cjs.map +0 -1
- package/dist/chunk-MDFSBU5W.cjs.map +0 -1
- package/dist/chunk-MQY7HDIA.js +0 -600
- package/dist/chunk-MQY7HDIA.js.map +0 -1
- package/dist/chunk-MVKTV3FT.cjs.map +0 -1
- package/dist/chunk-PG2J6V6Y.js +0 -4094
- package/dist/chunk-PG2J6V6Y.js.map +0 -1
- package/dist/chunk-VEGLTTYQ.cjs +0 -621
- package/dist/chunk-VEGLTTYQ.cjs.map +0 -1
- package/dist/chunk-WVHQ46DD.js +0 -758
- package/dist/chunk-WVHQ46DD.js.map +0 -1
- package/dist/index-B9pDY73x.d.ts +0 -12933
- package/dist/index-D33yo0qB.d.cts +0 -12933
- package/dist/networks-C-orpSFW.d.ts +0 -65
- package/dist/networks-FxYERGD1.d.cts +0 -65
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/converters/byte-encoding.ts"],"names":["assertU8LeBytes","assertU8BeBytes","__name","assertU16LeBytes","U16_BYTE_LENGTH","assertU16BeBytes","assertU32LeBytes","U32_BYTE_LENGTH","assertU32BeBytes","assertU64LeBytes","U64_BYTE_LENGTH","assertU64BeBytes","assertU128LeBytes","U128_BYTE_LENGTH","assertU128BeBytes","assertU256LeBytes","U256_BYTE_LENGTH","assertU256BeBytes","assertU512LeBytes","U512_BYTE_LENGTH","assertU512BeBytes","assertU1024LeBytes","U1024_BYTE_LENGTH","assertU1024BeBytes","assertU8","U8_BYTE_LENGTH","assertU16","assertU32","assertU64","assertU128","assertU256","assertU512","assertU1024"],"mappings":";;;;;;AAuDO,SAAS,4BAA4B,KAAA,EAA6B;AACvE,EAAAA,iCAAA,CAAgB,KAAK,CAAA;AAErB,EAAA,MAAM,MAAA,GAAS,IAAI,UAAA,CAAW,KAAK,CAAA;AACnC,EAAAC,iCAAA,CAAgB,MAAM,CAAA;AACtB,EAAA,OAAO,MAAA;AACT;AANgBC,wBAAA,CAAA,2BAAA,EAAA,6BAAA,CAAA;AA8BT,SAAS,4BAA4B,KAAA,EAA6B;AACvE,EAAAD,iCAAA,CAAgB,KAAK,CAAA;AACrB,EAAA,MAAM,MAAA,GAAS,IAAI,UAAA,CAAW,KAAK,CAAA;AACnC,EAAAD,iCAAA,CAAgB,MAAM,CAAA;AACtB,EAAA,OAAO,MAAA;AACT;AALgBE,wBAAA,CAAA,2BAAA,EAAA,6BAAA,CAAA;AA+BT,SAAS,8BAA8B,KAAA,EAA+B;AAC3E,EAAAC,kCAAA,CAAiB,KAAK,CAAA;AACtB,EAAA,MAAM,MAAA,GAAS,IAAI,UAAA,CAAWC,iCAAe,CAAA;AAC7C,EAAA,KAAA,IAAS,KAAA,GAAQ,CAAA,EAAG,KAAA,GAAQA,iCAAA,EAAiB,KAAA,EAAA,EAAS;AACpD,IAAA,MAAA,CAAO,KAAK,CAAA,GAAI,KAAA,CAAMA,iCAAA,GAAkB,IAAI,KAAK,CAAA;AAAA,EACnD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AA;AAAA,EAC/C;AACA,EAAAU,6BAAA,CAAY,MAAM,CAAA;AAClB,EAAA,OAAO,MAAA;AACT;AARgB9B,wBAAA,CAAA,yBAAA,EAAA,2BAAA,CAAA;AAgCT,SAAS,0BAA0B,KAAA,EAA4B;AACpE,EAAAqB,oCAAA,CAAmB,KAAK,CAAA;AACxB,EAAA,IAAI,MAAA,GAAS,EAAA;AACb,EAAA,KAAA,IAAS,KAAA,GAAQ,CAAA,EAAG,KAAA,GAAQD,mCAAA,EAAmB,KAAA,EAAA,EAAS;AACtD,IAAA,MAAA,GAAU,MAAA,IAAU,EAAA,GAAM,MAAA,CAAO,KAAA,CAAM,KAAK,CAAC,CAAA;AAAA,EAC/C;AACA,EAAAU,6BAAA,CAAY,MAAM,CAAA;AAClB,EAAA,OAAO,MAAA;AACT;AARgB9B,wBAAA,CAAA,yBAAA,EAAA,2BAAA,CAAA","file":"chunk-5GUSMQ74.cjs","sourcesContent":["/**\n * Byte Encoding, Decoding, and Endianness Conversions\n *\n * Conversions between branded integer types and their byte-array representations\n * (little-endian and big-endian), plus endianness swap functions.\n *\n * @module common/converters/byte-encoding\n * @since 2.0.0\n */\n\nimport {\n type U8, type U16, type U32, type U64, type U128, type U256, type U512, type U1024,\n type U8LeBytes, type U16LeBytes, type U32LeBytes, type U64LeBytes,\n type U128LeBytes, type U256LeBytes, type U512LeBytes, type U1024LeBytes,\n type U8BeBytes, type U16BeBytes, type U32BeBytes, type U64BeBytes,\n type U128BeBytes, type U256BeBytes, type U512BeBytes, type U1024BeBytes,\n U8_BYTE_LENGTH, U16_BYTE_LENGTH, U32_BYTE_LENGTH, U64_BYTE_LENGTH,\n U128_BYTE_LENGTH, U256_BYTE_LENGTH, U512_BYTE_LENGTH, U1024_BYTE_LENGTH,\n assertU8, assertU16, assertU32, assertU64, assertU128, assertU256, assertU512, assertU1024,\n assertU8LeBytes, assertU16LeBytes, assertU32LeBytes, assertU64LeBytes,\n assertU128LeBytes, assertU256LeBytes, assertU512LeBytes, assertU1024LeBytes,\n assertU8BeBytes, assertU16BeBytes, assertU32BeBytes, assertU64BeBytes,\n assertU128BeBytes, assertU256BeBytes, assertU512BeBytes, assertU1024BeBytes,\n} from \"../types\";\n\n/* =============================================================================\n * ENDIANNESS SWAP CONVERSIONS\n *\n * Convert between little-endian and big-endian byte arrays.\n * ============================================================================= */\n\n/**\n * Converts U8LeBytes to U8BeBytes (endianness swap).\n *\n * @public\n * @param value - The 1-byte little-endian representation to convert\n * @returns The identical byte array re-branded as U8BeBytes\n *\n * @remarks\n * Input type: U8LeBytes (Uint8Array of length 1, little-endian).\n * Output type: U8BeBytes (Uint8Array of length 1, big-endian).\n * For a single byte there is no meaningful distinction between LE and BE;\n * this function copies the byte and re-brands the type, acting as a\n * type-safe no-op. The numeric value encoded is unchanged.\n *\n * @example\n * ```typescript\n * const leBytes = encodeU8ToU8LeBytes(assertU8(42n));\n * const beBytes = convertU8LeBytesToU8BeBytes(leBytes); // same content, BE brand\n * ```\n *\n * @see {@link convertU8BeBytesToU8LeBytes} for the inverse conversion\n * @see {@link encodeU8ToU8LeBytes} to produce U8LeBytes from a U8 integer\n * @see {@link decodeU8LeBytesToU8} to decode U8LeBytes back to U8\n */\nexport function convertU8LeBytesToU8BeBytes(value: U8LeBytes): U8BeBytes {\n assertU8LeBytes(value);\n // Single byte - no actual swap needed, just re-brand\n const result = new Uint8Array(value);\n assertU8BeBytes(result);\n return result;\n}\n\n/**\n * Converts U8BeBytes to U8LeBytes (endianness swap).\n *\n * @public\n * @param value - The 1-byte big-endian representation to convert\n * @returns The identical byte array re-branded as U8LeBytes\n *\n * @remarks\n * Input type: U8BeBytes (Uint8Array of length 1, big-endian).\n * Output type: U8LeBytes (Uint8Array of length 1, little-endian).\n * For a single byte this is a type-safe no-op; the byte content is copied unchanged.\n *\n * @example\n * ```typescript\n * const beBytes = encodeU8ToU8BeBytes(assertU8(42n));\n * const leBytes = convertU8BeBytesToU8LeBytes(beBytes); // same content, LE brand\n * ```\n *\n * @see {@link convertU8LeBytesToU8BeBytes} for the inverse conversion\n * @see {@link encodeU8ToU8BeBytes} to produce U8BeBytes from a U8 integer\n * @see {@link decodeU8BeBytesToU8} to decode U8BeBytes back to U8\n */\nexport function convertU8BeBytesToU8LeBytes(value: U8BeBytes): U8LeBytes {\n assertU8BeBytes(value);\n const result = new Uint8Array(value);\n assertU8LeBytes(result);\n return result;\n}\n\n/**\n * Converts U16LeBytes to U16BeBytes (endianness swap).\n *\n * @public\n * @param value - The 2-byte little-endian representation to convert\n * @returns A new Uint8Array of length 2 with bytes in reversed (big-endian) order\n *\n * @remarks\n * Input type: U16LeBytes (Uint8Array of length 2, little-endian — byte[0] is LSB).\n * Output type: U16BeBytes (Uint8Array of length 2, big-endian — byte[0] is MSB).\n * The reversal is performed by writing `value[LENGTH-1-i]` into `result[i]` for\n * each index. The encoded integer value is preserved.\n *\n * @example\n * ```typescript\n * // Encoding 0x0102 in LE: [0x02, 0x01]\n * const leBytes = encodeU16ToU16LeBytes(assertU16(0x0102n));\n * const beBytes = convertU16LeBytesToU16BeBytes(leBytes); // [0x01, 0x02]\n * ```\n *\n * @see {@link convertU16BeBytesToU16LeBytes} for the inverse conversion\n * @see {@link encodeU16ToU16LeBytes} to encode U16 to LE bytes\n * @see {@link decodeU16BeBytesToU16} to decode the resulting BE bytes back to U16\n */\nexport function convertU16LeBytesToU16BeBytes(value: U16LeBytes): U16BeBytes {\n assertU16LeBytes(value);\n const result = new Uint8Array(U16_BYTE_LENGTH);\n for (let index = 0; index < U16_BYTE_LENGTH; index++) {\n result[index] = value[U16_BYTE_LENGTH - 1 - index];\n }\n assertU16BeBytes(result);\n return result;\n}\n\n/**\n * Converts U16BeBytes to U16LeBytes (endianness swap).\n *\n * @public\n * @param value - The 2-byte big-endian representation to convert\n * @returns A new Uint8Array of length 2 with bytes in reversed (little-endian) order\n *\n * @remarks\n * Input type: U16BeBytes (Uint8Array of length 2, big-endian — byte[0] is MSB).\n * Output type: U16LeBytes (Uint8Array of length 2, little-endian — byte[0] is LSB).\n * The reversal is performed by writing `value[LENGTH-1-i]` into `result[i]`.\n * The encoded integer value is preserved.\n *\n * @example\n * ```typescript\n * // Encoding 0x0102 in BE: [0x01, 0x02]\n * const beBytes = encodeU16ToU16BeBytes(assertU16(0x0102n));\n * const leBytes = convertU16BeBytesToU16LeBytes(beBytes); // [0x02, 0x01]\n * ```\n *\n * @see {@link convertU16LeBytesToU16BeBytes} for the inverse conversion\n * @see {@link encodeU16ToU16BeBytes} to encode U16 to BE bytes\n * @see {@link decodeU16LeBytesToU16} to decode the resulting LE bytes back to U16\n */\nexport function convertU16BeBytesToU16LeBytes(value: U16BeBytes): U16LeBytes {\n assertU16BeBytes(value);\n const result = new Uint8Array(U16_BYTE_LENGTH);\n for (let index = 0; index < U16_BYTE_LENGTH; index++) {\n result[index] = value[U16_BYTE_LENGTH - 1 - index];\n }\n assertU16LeBytes(result);\n return result;\n}\n\n/**\n * Converts U32LeBytes to U32BeBytes (endianness swap).\n *\n * @public\n * @param value - The 4-byte little-endian representation to convert\n * @returns A new Uint8Array of length 4 with bytes in reversed (big-endian) order\n *\n * @remarks\n * Input type: U32LeBytes (Uint8Array of length 4, little-endian — byte[0] is LSB).\n * Output type: U32BeBytes (Uint8Array of length 4, big-endian — byte[0] is MSB).\n * Bytes are reversed by index. The encoded integer value is preserved.\n *\n * @example\n * ```typescript\n * const leBytes = encodeU32ToU32LeBytes(assertU32(0x01020304n));\n * // leBytes = [0x04, 0x03, 0x02, 0x01]\n * const beBytes = convertU32LeBytesToU32BeBytes(leBytes);\n * // beBytes = [0x01, 0x02, 0x03, 0x04]\n * ```\n *\n * @see {@link convertU32BeBytesToU32LeBytes} for the inverse conversion\n */\nexport function convertU32LeBytesToU32BeBytes(value: U32LeBytes): U32BeBytes {\n assertU32LeBytes(value);\n const result = new Uint8Array(U32_BYTE_LENGTH);\n for (let index = 0; index < U32_BYTE_LENGTH; index++) {\n result[index] = value[U32_BYTE_LENGTH - 1 - index];\n }\n assertU32BeBytes(result);\n return result;\n}\n\n/**\n * Converts U32BeBytes to U32LeBytes (endianness swap).\n *\n * @public\n * @param value - The 4-byte big-endian representation to convert\n * @returns A new Uint8Array of length 4 with bytes in reversed (little-endian) order\n *\n * @remarks\n * Input type: U32BeBytes (Uint8Array of length 4, big-endian — byte[0] is MSB).\n * Output type: U32LeBytes (Uint8Array of length 4, little-endian — byte[0] is LSB).\n * Bytes are reversed by index. The encoded integer value is preserved.\n *\n * @example\n * ```typescript\n * const beBytes = encodeU32ToU32BeBytes(assertU32(0x01020304n));\n * // beBytes = [0x01, 0x02, 0x03, 0x04]\n * const leBytes = convertU32BeBytesToU32LeBytes(beBytes);\n * // leBytes = [0x04, 0x03, 0x02, 0x01]\n * ```\n *\n * @see {@link convertU32LeBytesToU32BeBytes} for the inverse conversion\n */\nexport function convertU32BeBytesToU32LeBytes(value: U32BeBytes): U32LeBytes {\n assertU32BeBytes(value);\n const result = new Uint8Array(U32_BYTE_LENGTH);\n for (let index = 0; index < U32_BYTE_LENGTH; index++) {\n result[index] = value[U32_BYTE_LENGTH - 1 - index];\n }\n assertU32LeBytes(result);\n return result;\n}\n\n/**\n * Converts U64LeBytes to U64BeBytes (endianness swap).\n *\n * @public\n * @param value - The 8-byte little-endian representation to convert\n * @returns A new Uint8Array of length 8 with bytes in reversed (big-endian) order\n *\n * @remarks\n * Input type: U64LeBytes (Uint8Array of length 8, little-endian — byte[0] is LSB).\n * Output type: U64BeBytes (Uint8Array of length 8, big-endian — byte[0] is MSB).\n * Bytes are reversed by index. The encoded integer value is preserved.\n * U64 LE encoding is the canonical format for Solana account lamport amounts and\n * other on-chain 64-bit values; BE is used in some cross-chain message formats.\n *\n * @example\n * ```typescript\n * const leBytes = encodeU64ToU64LeBytes(assertU64(1000n));\n * const beBytes = convertU64LeBytesToU64BeBytes(leBytes);\n * ```\n *\n * @see {@link convertU64BeBytesToU64LeBytes} for the inverse conversion\n */\nexport function convertU64LeBytesToU64BeBytes(value: U64LeBytes): U64BeBytes {\n assertU64LeBytes(value);\n const result = new Uint8Array(U64_BYTE_LENGTH);\n for (let index = 0; index < U64_BYTE_LENGTH; index++) {\n result[index] = value[U64_BYTE_LENGTH - 1 - index];\n }\n assertU64BeBytes(result);\n return result;\n}\n\n/**\n * Converts U64BeBytes to U64LeBytes (endianness swap).\n *\n * @public\n * @param value - The 8-byte big-endian representation to convert\n * @returns A new Uint8Array of length 8 with bytes in reversed (little-endian) order\n *\n * @remarks\n * Input type: U64BeBytes (Uint8Array of length 8, big-endian — byte[0] is MSB).\n * Output type: U64LeBytes (Uint8Array of length 8, little-endian — byte[0] is LSB).\n * Bytes are reversed by index. The encoded integer value is preserved.\n *\n * @example\n * ```typescript\n * const beBytes = encodeU64ToU64BeBytes(assertU64(1000n));\n * const leBytes = convertU64BeBytesToU64LeBytes(beBytes);\n * ```\n *\n * @see {@link convertU64LeBytesToU64BeBytes} for the inverse conversion\n */\nexport function convertU64BeBytesToU64LeBytes(value: U64BeBytes): U64LeBytes {\n assertU64BeBytes(value);\n const result = new Uint8Array(U64_BYTE_LENGTH);\n for (let index = 0; index < U64_BYTE_LENGTH; index++) {\n result[index] = value[U64_BYTE_LENGTH - 1 - index];\n }\n assertU64LeBytes(result);\n return result;\n}\n\n/**\n * Converts U128LeBytes to U128BeBytes (endianness swap).\n *\n * @public\n * @param value - The 16-byte little-endian representation to convert\n * @returns A new Uint8Array of length 16 with bytes in reversed (big-endian) order\n *\n * @remarks\n * Input type: U128LeBytes (Uint8Array of length 16, little-endian — byte[0] is LSB).\n * Output type: U128BeBytes (Uint8Array of length 16, big-endian — byte[0] is MSB).\n * Bytes are reversed by index. The encoded integer value is preserved.\n *\n * @example\n * ```typescript\n * const leBytes = encodeU128ToU128LeBytes(assertU128(2n ** 64n));\n * const beBytes = convertU128LeBytesToU128BeBytes(leBytes);\n * ```\n *\n * @see {@link convertU128BeBytesToU128LeBytes} for the inverse conversion\n */\nexport function convertU128LeBytesToU128BeBytes(value: U128LeBytes): U128BeBytes {\n assertU128LeBytes(value);\n const result = new Uint8Array(U128_BYTE_LENGTH);\n for (let index = 0; index < U128_BYTE_LENGTH; index++) {\n result[index] = value[U128_BYTE_LENGTH - 1 - index];\n }\n assertU128BeBytes(result);\n return result;\n}\n\n/**\n * Converts U128BeBytes to U128LeBytes (endianness swap).\n *\n * @public\n * @param value - The 16-byte big-endian representation to convert\n * @returns A new Uint8Array of length 16 with bytes in reversed (little-endian) order\n *\n * @remarks\n * Input type: U128BeBytes (Uint8Array of length 16, big-endian — byte[0] is MSB).\n * Output type: U128LeBytes (Uint8Array of length 16, little-endian — byte[0] is LSB).\n * Bytes are reversed by index. The encoded integer value is preserved.\n *\n * @example\n * ```typescript\n * const beBytes = encodeU128ToU128BeBytes(assertU128(2n ** 64n));\n * const leBytes = convertU128BeBytesToU128LeBytes(beBytes);\n * ```\n *\n * @see {@link convertU128LeBytesToU128BeBytes} for the inverse conversion\n */\nexport function convertU128BeBytesToU128LeBytes(value: U128BeBytes): U128LeBytes {\n assertU128BeBytes(value);\n const result = new Uint8Array(U128_BYTE_LENGTH);\n for (let index = 0; index < U128_BYTE_LENGTH; index++) {\n result[index] = value[U128_BYTE_LENGTH - 1 - index];\n }\n assertU128LeBytes(result);\n return result;\n}\n\n/**\n * Converts U256LeBytes to U256BeBytes (endianness swap).\n *\n * @public\n * @param value - The 32-byte little-endian representation to convert\n * @returns A new Uint8Array of length 32 with bytes in reversed (big-endian) order\n *\n * @remarks\n * Input type: U256LeBytes (Uint8Array of length 32, little-endian — byte[0] is LSB).\n * Output type: U256BeBytes (Uint8Array of length 32, big-endian — byte[0] is MSB).\n * Bytes are reversed by index. The encoded integer value is preserved.\n * This conversion is commonly used when bridging between Solana's LE storage\n * format and BN254/Groth16 proof verification which expects BE field elements.\n *\n * @example\n * ```typescript\n * const leBytes = encodeU256ToU256LeBytes(assertU256(2n ** 200n));\n * const beBytes = convertU256LeBytesToU256BeBytes(leBytes);\n * ```\n *\n * @see {@link convertU256BeBytesToU256LeBytes} for the inverse conversion\n */\nexport function convertU256LeBytesToU256BeBytes(value: U256LeBytes): U256BeBytes {\n assertU256LeBytes(value);\n const result = new Uint8Array(U256_BYTE_LENGTH);\n for (let index = 0; index < U256_BYTE_LENGTH; index++) {\n result[index] = value[U256_BYTE_LENGTH - 1 - index];\n }\n assertU256BeBytes(result);\n return result;\n}\n\n/**\n * Converts U256BeBytes to U256LeBytes (endianness swap).\n *\n * @public\n * @param value - The 32-byte big-endian representation to convert\n * @returns A new Uint8Array of length 32 with bytes in reversed (little-endian) order\n *\n * @remarks\n * Input type: U256BeBytes (Uint8Array of length 32, big-endian — byte[0] is MSB).\n * Output type: U256LeBytes (Uint8Array of length 32, little-endian — byte[0] is LSB).\n * Bytes are reversed by index. The encoded integer value is preserved.\n * Commonly used after receiving a BE-encoded BN254 field element and converting\n * it to LE format for on-chain Solana storage or comparison.\n *\n * @example\n * ```typescript\n * const beBytes = encodeU256ToU256BeBytes(assertU256(2n ** 200n));\n * const leBytes = convertU256BeBytesToU256LeBytes(beBytes);\n * ```\n *\n * @see {@link convertU256LeBytesToU256BeBytes} for the inverse conversion\n */\nexport function convertU256BeBytesToU256LeBytes(value: U256BeBytes): U256LeBytes {\n assertU256BeBytes(value);\n const result = new Uint8Array(U256_BYTE_LENGTH);\n for (let index = 0; index < U256_BYTE_LENGTH; index++) {\n result[index] = value[U256_BYTE_LENGTH - 1 - index];\n }\n assertU256LeBytes(result);\n return result;\n}\n\n/**\n * Converts U512LeBytes to U512BeBytes (endianness swap).\n *\n * @public\n * @param value - The 64-byte little-endian representation to convert\n * @returns A new Uint8Array of length 64 with bytes in reversed (big-endian) order\n *\n * @remarks\n * Input type: U512LeBytes (Uint8Array of length 64, little-endian — byte[0] is LSB).\n * Output type: U512BeBytes (Uint8Array of length 64, big-endian — byte[0] is MSB).\n * Bytes are reversed by index. The encoded integer value is preserved.\n *\n * @example\n * ```typescript\n * const leBytes = encodeU512ToU512LeBytes(assertU512(2n ** 400n));\n * const beBytes = convertU512LeBytesToU512BeBytes(leBytes);\n * ```\n *\n * @see {@link convertU512BeBytesToU512LeBytes} for the inverse conversion\n */\nexport function convertU512LeBytesToU512BeBytes(value: U512LeBytes): U512BeBytes {\n assertU512LeBytes(value);\n const result = new Uint8Array(U512_BYTE_LENGTH);\n for (let index = 0; index < U512_BYTE_LENGTH; index++) {\n result[index] = value[U512_BYTE_LENGTH - 1 - index];\n }\n assertU512BeBytes(result);\n return result;\n}\n\n/**\n * Converts U512BeBytes to U512LeBytes (endianness swap).\n *\n * @public\n * @param value - The 64-byte big-endian representation to convert\n * @returns A new Uint8Array of length 64 with bytes in reversed (little-endian) order\n *\n * @remarks\n * Input type: U512BeBytes (Uint8Array of length 64, big-endian — byte[0] is MSB).\n * Output type: U512LeBytes (Uint8Array of length 64, little-endian — byte[0] is LSB).\n * Bytes are reversed by index. The encoded integer value is preserved.\n *\n * @example\n * ```typescript\n * const beBytes = encodeU512ToU512BeBytes(assertU512(2n ** 400n));\n * const leBytes = convertU512BeBytesToU512LeBytes(beBytes);\n * ```\n *\n * @see {@link convertU512LeBytesToU512BeBytes} for the inverse conversion\n */\nexport function convertU512BeBytesToU512LeBytes(value: U512BeBytes): U512LeBytes {\n assertU512BeBytes(value);\n const result = new Uint8Array(U512_BYTE_LENGTH);\n for (let index = 0; index < U512_BYTE_LENGTH; index++) {\n result[index] = value[U512_BYTE_LENGTH - 1 - index];\n }\n assertU512LeBytes(result);\n return result;\n}\n\n/**\n * Converts U1024LeBytes to U1024BeBytes (endianness swap).\n *\n * @public\n * @param value - The 128-byte little-endian representation to convert\n * @returns A new Uint8Array of length 128 with bytes in reversed (big-endian) order\n *\n * @remarks\n * Input type: U1024LeBytes (Uint8Array of length 128, little-endian — byte[0] is LSB).\n * Output type: U1024BeBytes (Uint8Array of length 128, big-endian — byte[0] is MSB).\n * Bytes are reversed by index. The encoded integer value is preserved.\n *\n * @example\n * ```typescript\n * const leBytes = encodeU1024ToU1024LeBytes(assertU1024(2n ** 900n));\n * const beBytes = convertU1024LeBytesToU1024BeBytes(leBytes);\n * ```\n *\n * @see {@link convertU1024BeBytesToU1024LeBytes} for the inverse conversion\n */\nexport function convertU1024LeBytesToU1024BeBytes(value: U1024LeBytes): U1024BeBytes {\n assertU1024LeBytes(value);\n const result = new Uint8Array(U1024_BYTE_LENGTH);\n for (let index = 0; index < U1024_BYTE_LENGTH; index++) {\n result[index] = value[U1024_BYTE_LENGTH - 1 - index];\n }\n assertU1024BeBytes(result);\n return result;\n}\n\n/**\n * Converts U1024BeBytes to U1024LeBytes (endianness swap).\n *\n * @public\n * @param value - The 128-byte big-endian representation to convert\n * @returns A new Uint8Array of length 128 with bytes in reversed (little-endian) order\n *\n * @remarks\n * Input type: U1024BeBytes (Uint8Array of length 128, big-endian — byte[0] is MSB).\n * Output type: U1024LeBytes (Uint8Array of length 128, little-endian — byte[0] is LSB).\n * Bytes are reversed by index. The encoded integer value is preserved.\n *\n * @example\n * ```typescript\n * const beBytes = encodeU1024ToU1024BeBytes(assertU1024(2n ** 900n));\n * const leBytes = convertU1024BeBytesToU1024LeBytes(beBytes);\n * ```\n *\n * @see {@link convertU1024LeBytesToU1024BeBytes} for the inverse conversion\n */\nexport function convertU1024BeBytesToU1024LeBytes(value: U1024BeBytes): U1024LeBytes {\n assertU1024BeBytes(value);\n const result = new Uint8Array(U1024_BYTE_LENGTH);\n for (let index = 0; index < U1024_BYTE_LENGTH; index++) {\n result[index] = value[U1024_BYTE_LENGTH - 1 - index];\n }\n assertU1024LeBytes(result);\n return result;\n}\n\n/* =============================================================================\n * INTEGER TO BYTE ARRAY ENCODING\n *\n * Encode integers as byte arrays in specified endianness.\n * ============================================================================= */\n\n/**\n * Encodes a U8 integer as a 1-byte little-endian byte array.\n *\n * @public\n * @param value - The U8 value to encode (range [0, 255])\n * @returns A Uint8Array of length 1 containing the single byte\n *\n * @remarks\n * Input type: U8 (bigint, range [0, 255]).\n * Output type: U8LeBytes (Uint8Array of length 1, little-endian).\n * For a single byte there is no endianness; byte[0] = value & 0xFF.\n * This is the canonical encoding for 8-bit values in Solana account data.\n *\n * @example\n * ```typescript\n * const bytes = encodeU8ToU8LeBytes(assertU8(42n)); // Uint8Array [42]\n * ```\n *\n * @see {@link decodeU8LeBytesToU8} for the inverse decoding\n * @see {@link encodeU8ToU8BeBytes} for the big-endian variant (identical for 1 byte)\n */\nexport function encodeU8ToU8LeBytes(value: U8): U8LeBytes {\n assertU8(value);\n const result = new Uint8Array(U8_BYTE_LENGTH);\n result[0] = Number(value);\n assertU8LeBytes(result);\n return result;\n}\n\n/**\n * Encodes a U8 integer as a 1-byte big-endian byte array.\n *\n * @public\n * @param value - The U8 value to encode (range [0, 255])\n * @returns A Uint8Array of length 1 containing the single byte\n *\n * @remarks\n * Input type: U8 (bigint, range [0, 255]).\n * Output type: U8BeBytes (Uint8Array of length 1, big-endian).\n * For a single byte there is no endianness; byte[0] = value & 0xFF.\n *\n * @example\n * ```typescript\n * const bytes = encodeU8ToU8BeBytes(assertU8(255n)); // Uint8Array [255]\n * ```\n *\n * @see {@link decodeU8BeBytesToU8} for the inverse decoding\n * @see {@link encodeU8ToU8LeBytes} for the little-endian variant (identical for 1 byte)\n */\nexport function encodeU8ToU8BeBytes(value: U8): U8BeBytes {\n assertU8(value);\n const result = new Uint8Array(U8_BYTE_LENGTH);\n result[0] = Number(value);\n assertU8BeBytes(result);\n return result;\n}\n\n/**\n * Encodes a U16 integer as a 2-byte little-endian byte array.\n *\n * @public\n * @param value - The U16 value to encode (range [0, 65535])\n * @returns A Uint8Array of length 2 in little-endian byte order (LSB at index 0)\n *\n * @remarks\n * Input type: U16 (bigint, range [0, 65535]).\n * Output type: U16LeBytes (Uint8Array of length 2, little-endian).\n * Encoding algorithm: iterates indices 0..1, writes `value & 0xff` to `result[index]`,\n * then shifts `value >>= 8n`. This places the least-significant byte at index 0.\n * Little-endian encoding matches Solana's on-chain data layout for u16 fields.\n *\n * @example\n * ```typescript\n * // 0x0102 = 258; LE = [0x02, 0x01]\n * const bytes = encodeU16ToU16LeBytes(assertU16(258n));\n * // bytes[0] = 2, bytes[1] = 1\n * ```\n *\n * @see {@link decodeU16LeBytesToU16} for the inverse decoding\n * @see {@link encodeU16ToU16BeBytes} for the big-endian variant\n */\nexport function encodeU16ToU16LeBytes(value: U16): U16LeBytes {\n assertU16(value);\n const result = new Uint8Array(U16_BYTE_LENGTH);\n let temporary: bigint = value;\n for (let index = 0; index < U16_BYTE_LENGTH; index++) {\n result[index] = Number(temporary & 0xffn);\n temporary >>= 8n;\n }\n assertU16LeBytes(result);\n return result;\n}\n\n/**\n * Encodes a U16 integer as a 2-byte big-endian byte array.\n *\n * @public\n * @param value - The U16 value to encode (range [0, 65535])\n * @returns A Uint8Array of length 2 in big-endian byte order (MSB at index 0)\n *\n * @remarks\n * Input type: U16 (bigint, range [0, 65535]).\n * Output type: U16BeBytes (Uint8Array of length 2, big-endian).\n * Encoding algorithm: iterates indices from LENGTH-1 down to 0, writes `value & 0xff`\n * to `result[index]`, then shifts `value >>= 8n`. This places the most-significant\n * byte at index 0.\n *\n * @example\n * ```typescript\n * // 0x0102 = 258; BE = [0x01, 0x02]\n * const bytes = encodeU16ToU16BeBytes(assertU16(258n));\n * // bytes[0] = 1, bytes[1] = 2\n * ```\n *\n * @see {@link decodeU16BeBytesToU16} for the inverse decoding\n * @see {@link encodeU16ToU16LeBytes} for the little-endian variant\n */\nexport function encodeU16ToU16BeBytes(value: U16): U16BeBytes {\n assertU16(value);\n const result = new Uint8Array(U16_BYTE_LENGTH);\n let temporary: bigint = value;\n for (let index = U16_BYTE_LENGTH - 1; index >= 0; index--) {\n result[index] = Number(temporary & 0xffn);\n temporary >>= 8n;\n }\n assertU16BeBytes(result);\n return result;\n}\n\n/**\n * Encodes a U32 integer as a 4-byte little-endian byte array.\n *\n * @public\n * @param value - The U32 value to encode (range [0, 2^32 - 1])\n * @returns A Uint8Array of length 4 in little-endian byte order (LSB at index 0)\n *\n * @remarks\n * Input type: U32 (bigint, range [0, 4294967295]).\n * Output type: U32LeBytes (Uint8Array of length 4, little-endian).\n * Iterates indices 0..3, writing low byte then shifting right by 8 bits each step.\n * This is the standard encoding for Solana u32 discriminators and lengths.\n *\n * @example\n * ```typescript\n * const bytes = encodeU32ToU32LeBytes(assertU32(0x01020304n));\n * // bytes = [0x04, 0x03, 0x02, 0x01]\n * ```\n *\n * @see {@link decodeU32LeBytesToU32} for the inverse decoding\n * @see {@link encodeU32ToU32BeBytes} for the big-endian variant\n */\nexport function encodeU32ToU32LeBytes(value: U32): U32LeBytes {\n assertU32(value);\n const result = new Uint8Array(U32_BYTE_LENGTH);\n let temporary: bigint = value;\n for (let index = 0; index < U32_BYTE_LENGTH; index++) {\n result[index] = Number(temporary & 0xffn);\n temporary >>= 8n;\n }\n assertU32LeBytes(result);\n return result;\n}\n\n/**\n * Encodes a U32 integer as a 4-byte big-endian byte array.\n *\n * @public\n * @param value - The U32 value to encode (range [0, 2^32 - 1])\n * @returns A Uint8Array of length 4 in big-endian byte order (MSB at index 0)\n *\n * @remarks\n * Input type: U32 (bigint, range [0, 4294967295]).\n * Output type: U32BeBytes (Uint8Array of length 4, big-endian).\n * Iterates indices from 3 down to 0, writing low byte then shifting right by 8 bits.\n * This places the most-significant byte at index 0.\n *\n * @example\n * ```typescript\n * const bytes = encodeU32ToU32BeBytes(assertU32(0x01020304n));\n * // bytes = [0x01, 0x02, 0x03, 0x04]\n * ```\n *\n * @see {@link decodeU32BeBytesToU32} for the inverse decoding\n * @see {@link encodeU32ToU32LeBytes} for the little-endian variant\n */\nexport function encodeU32ToU32BeBytes(value: U32): U32BeBytes {\n assertU32(value);\n const result = new Uint8Array(U32_BYTE_LENGTH);\n let temporary: bigint = value;\n for (let index = U32_BYTE_LENGTH - 1; index >= 0; index--) {\n result[index] = Number(temporary & 0xffn);\n temporary >>= 8n;\n }\n assertU32BeBytes(result);\n return result;\n}\n\n/**\n * Encodes a U64 integer as an 8-byte little-endian byte array.\n *\n * @public\n * @param value - The U64 value to encode (range [0, 2^64 - 1])\n * @returns A Uint8Array of length 8 in little-endian byte order (LSB at index 0)\n *\n * @remarks\n * Input type: U64 (bigint, range [0, 2^64 - 1]).\n * Output type: U64LeBytes (Uint8Array of length 8, little-endian).\n * Iterates indices 0..7, writing low byte then shifting right by 8 bits each step.\n * This is the canonical encoding for Solana lamport amounts, token quantities,\n * and other 64-bit on-chain values.\n *\n * @example\n * ```typescript\n * const bytes = encodeU64ToU64LeBytes(assertU64(1000000000n)); // 1 SOL in lamports\n * // bytes[0] is LSB; bytes[7] is MSB\n * ```\n *\n * @see {@link decodeU64LeBytesToU64} for the inverse decoding\n * @see {@link encodeU64ToU64BeBytes} for the big-endian variant\n */\nexport function encodeU64ToU64LeBytes(value: U64): U64LeBytes {\n assertU64(value);\n const result = new Uint8Array(U64_BYTE_LENGTH);\n let temporary: bigint = value;\n for (let index = 0; index < U64_BYTE_LENGTH; index++) {\n result[index] = Number(temporary & 0xffn);\n temporary >>= 8n;\n }\n assertU64LeBytes(result);\n return result;\n}\n\n/**\n * Encodes a U64 integer as an 8-byte big-endian byte array.\n *\n * @public\n * @param value - The U64 value to encode (range [0, 2^64 - 1])\n * @returns A Uint8Array of length 8 in big-endian byte order (MSB at index 0)\n *\n * @remarks\n * Input type: U64 (bigint, range [0, 2^64 - 1]).\n * Output type: U64BeBytes (Uint8Array of length 8, big-endian).\n * Iterates indices from 7 down to 0, writing low byte then shifting right by 8 bits.\n * MSB is at index 0.\n *\n * @example\n * ```typescript\n * const bytes = encodeU64ToU64BeBytes(assertU64(0x0102030405060708n));\n * // bytes = [0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08]\n * ```\n *\n * @see {@link decodeU64BeBytesToU64} for the inverse decoding\n * @see {@link encodeU64ToU64LeBytes} for the little-endian variant\n */\nexport function encodeU64ToU64BeBytes(value: U64): U64BeBytes {\n assertU64(value);\n const result = new Uint8Array(U64_BYTE_LENGTH);\n let temporary: bigint = value;\n for (let index = U64_BYTE_LENGTH - 1; index >= 0; index--) {\n result[index] = Number(temporary & 0xffn);\n temporary >>= 8n;\n }\n assertU64BeBytes(result);\n return result;\n}\n\n/**\n * Encodes a U128 integer as a 16-byte little-endian byte array.\n *\n * @public\n * @param value - The U128 value to encode (range [0, 2^128 - 1])\n * @returns A Uint8Array of length 16 in little-endian byte order (LSB at index 0)\n *\n * @remarks\n * Input type: U128 (bigint, range [0, 2^128 - 1]).\n * Output type: U128LeBytes (Uint8Array of length 16, little-endian).\n * Iterates indices 0..15, writing low byte then shifting right by 8 bits each step.\n * Commonly used to encode 128-bit nonces, RcEncryptionNonce values, and token amounts\n * that exceed the U64 range.\n *\n * @example\n * ```typescript\n * const bytes = encodeU128ToU128LeBytes(assertU128(2n ** 64n));\n * // bytes[8] = 1; all others = 0 (since 2^64 = 1 at byte index 8)\n * ```\n *\n * @see {@link decodeU128LeBytesToU128} for the inverse decoding\n * @see {@link encodeU128ToU128BeBytes} for the big-endian variant\n */\nexport function encodeU128ToU128LeBytes(value: U128): U128LeBytes {\n assertU128(value);\n const result = new Uint8Array(U128_BYTE_LENGTH);\n let temporary: bigint = value;\n for (let index = 0; index < U128_BYTE_LENGTH; index++) {\n result[index] = Number(temporary & 0xffn);\n temporary >>= 8n;\n }\n assertU128LeBytes(result);\n return result;\n}\n\n/**\n * Encodes a U128 integer as a 16-byte big-endian byte array.\n *\n * @public\n * @param value - The U128 value to encode (range [0, 2^128 - 1])\n * @returns A Uint8Array of length 16 in big-endian byte order (MSB at index 0)\n *\n * @remarks\n * Input type: U128 (bigint, range [0, 2^128 - 1]).\n * Output type: U128BeBytes (Uint8Array of length 16, big-endian).\n * Iterates indices from 15 down to 0, writing low byte then shifting right by 8 bits.\n * MSB is at index 0.\n *\n * @example\n * ```typescript\n * const bytes = encodeU128ToU128BeBytes(assertU128(1n));\n * // bytes = [0, 0, ..., 0, 1] (15 zero bytes then 0x01)\n * ```\n *\n * @see {@link decodeU128BeBytesToU128} for the inverse decoding\n * @see {@link encodeU128ToU128LeBytes} for the little-endian variant\n */\nexport function encodeU128ToU128BeBytes(value: U128): U128BeBytes {\n assertU128(value);\n const result = new Uint8Array(U128_BYTE_LENGTH);\n let temporary: bigint = value;\n for (let index = U128_BYTE_LENGTH - 1; index >= 0; index--) {\n result[index] = Number(temporary & 0xffn);\n temporary >>= 8n;\n }\n assertU128BeBytes(result);\n return result;\n}\n\n/**\n * Encodes a U256 integer as a 32-byte little-endian byte array.\n *\n * @public\n * @param value - The U256 value to encode (range [0, 2^256 - 1])\n * @returns A Uint8Array of length 32 in little-endian byte order (LSB at index 0)\n *\n * @remarks\n * Input type: U256 (bigint, range [0, 2^256 - 1]).\n * Output type: U256LeBytes (Uint8Array of length 32, little-endian).\n * Iterates indices 0..31, writing low byte then shifting right by 8 bits each step.\n * This is the canonical Solana on-chain encoding for 256-bit values such as\n * X25519 public keys, Poseidon hash outputs, and UTXO commitments.\n *\n * @example\n * ```typescript\n * const bytes = encodeU256ToU256LeBytes(assertU256(1n));\n * // bytes[0] = 1; bytes[1..31] = 0\n * ```\n *\n * @see {@link decodeU256LeBytesToU256} for the inverse decoding\n * @see {@link encodeU256ToU256BeBytes} for the big-endian variant\n */\nexport function encodeU256ToU256LeBytes(value: U256): U256LeBytes {\n assertU256(value);\n const result = new Uint8Array(U256_BYTE_LENGTH);\n let temporary: bigint = value;\n for (let index = 0; index < U256_BYTE_LENGTH; index++) {\n result[index] = Number(temporary & 0xffn);\n temporary >>= 8n;\n }\n assertU256LeBytes(result);\n return result;\n}\n\n/**\n * Encodes a U256 integer as a 32-byte big-endian byte array.\n *\n * @public\n * @param value - The U256 value to encode (range [0, 2^256 - 1])\n * @returns A Uint8Array of length 32 in big-endian byte order (MSB at index 0)\n *\n * @remarks\n * Input type: U256 (bigint, range [0, 2^256 - 1]).\n * Output type: U256BeBytes (Uint8Array of length 32, big-endian).\n * Iterates indices from 31 down to 0, writing low byte then shifting right by 8 bits.\n * MSB is at index 0. This is the standard format for BN254/Groth16 field elements\n * and EVM-compatible 32-byte word encoding.\n *\n * @example\n * ```typescript\n * const bytes = encodeU256ToU256BeBytes(assertU256(1n));\n * // bytes[0..30] = 0; bytes[31] = 1\n * ```\n *\n * @see {@link decodeU256BeBytesToU256} for the inverse decoding\n * @see {@link encodeU256ToU256LeBytes} for the little-endian variant\n */\nexport function encodeU256ToU256BeBytes(value: U256): U256BeBytes {\n assertU256(value);\n const result = new Uint8Array(U256_BYTE_LENGTH);\n let temporary: bigint = value;\n for (let index = U256_BYTE_LENGTH - 1; index >= 0; index--) {\n result[index] = Number(temporary & 0xffn);\n temporary >>= 8n;\n }\n assertU256BeBytes(result);\n return result;\n}\n\n/**\n * Encodes a U512 integer as a 64-byte little-endian byte array.\n *\n * @public\n * @param value - The U512 value to encode (range [0, 2^512 - 1])\n * @returns A Uint8Array of length 64 in little-endian byte order (LSB at index 0)\n *\n * @remarks\n * Input type: U512 (bigint, range [0, 2^512 - 1]).\n * Output type: U512LeBytes (Uint8Array of length 64, little-endian).\n * Iterates indices 0..63, writing low byte then shifting right by 8 bits each step.\n *\n * @example\n * ```typescript\n * const bytes = encodeU512ToU512LeBytes(assertU512(2n ** 256n));\n * // bytes[32] = 1; all others = 0\n * ```\n *\n * @see {@link decodeU512LeBytesToU512} for the inverse decoding\n * @see {@link encodeU512ToU512BeBytes} for the big-endian variant\n */\nexport function encodeU512ToU512LeBytes(value: U512): U512LeBytes {\n assertU512(value);\n const result = new Uint8Array(U512_BYTE_LENGTH);\n let temporary: bigint = value;\n for (let index = 0; index < U512_BYTE_LENGTH; index++) {\n result[index] = Number(temporary & 0xffn);\n temporary >>= 8n;\n }\n assertU512LeBytes(result);\n return result;\n}\n\n/**\n * Encodes a U512 integer as a 64-byte big-endian byte array.\n *\n * @public\n * @param value - The U512 value to encode (range [0, 2^512 - 1])\n * @returns A Uint8Array of length 64 in big-endian byte order (MSB at index 0)\n *\n * @remarks\n * Input type: U512 (bigint, range [0, 2^512 - 1]).\n * Output type: U512BeBytes (Uint8Array of length 64, big-endian).\n * Iterates indices from 63 down to 0, writing low byte then shifting right by 8 bits.\n * MSB is at index 0.\n *\n * @example\n * ```typescript\n * const bytes = encodeU512ToU512BeBytes(assertU512(1n));\n * // bytes[0..62] = 0; bytes[63] = 1\n * ```\n *\n * @see {@link decodeU512BeBytesToU512} for the inverse decoding\n * @see {@link encodeU512ToU512LeBytes} for the little-endian variant\n */\nexport function encodeU512ToU512BeBytes(value: U512): U512BeBytes {\n assertU512(value);\n const result = new Uint8Array(U512_BYTE_LENGTH);\n let temporary: bigint = value;\n for (let index = U512_BYTE_LENGTH - 1; index >= 0; index--) {\n result[index] = Number(temporary & 0xffn);\n temporary >>= 8n;\n }\n assertU512BeBytes(result);\n return result;\n}\n\n/**\n * Encodes a U1024 integer as a 128-byte little-endian byte array.\n *\n * @public\n * @param value - The U1024 value to encode (range [0, 2^1024 - 1])\n * @returns A Uint8Array of length 128 in little-endian byte order (LSB at index 0)\n *\n * @remarks\n * Input type: U1024 (bigint, range [0, 2^1024 - 1]).\n * Output type: U1024LeBytes (Uint8Array of length 128, little-endian).\n * Iterates indices 0..127, writing low byte then shifting right by 8 bits each step.\n *\n * @example\n * ```typescript\n * const bytes = encodeU1024ToU1024LeBytes(assertU1024(2n ** 512n));\n * // bytes[64] = 1; all others = 0\n * ```\n *\n * @see {@link decodeU1024LeBytesToU1024} for the inverse decoding\n * @see {@link encodeU1024ToU1024BeBytes} for the big-endian variant\n */\nexport function encodeU1024ToU1024LeBytes(value: U1024): U1024LeBytes {\n assertU1024(value);\n const result = new Uint8Array(U1024_BYTE_LENGTH);\n let temporary: bigint = value;\n for (let index = 0; index < U1024_BYTE_LENGTH; index++) {\n result[index] = Number(temporary & 0xffn);\n temporary >>= 8n;\n }\n assertU1024LeBytes(result);\n return result;\n}\n\n/**\n * Encodes a U1024 integer as a 128-byte big-endian byte array.\n *\n * @public\n * @param value - The U1024 value to encode (range [0, 2^1024 - 1])\n * @returns A Uint8Array of length 128 in big-endian byte order (MSB at index 0)\n *\n * @remarks\n * Input type: U1024 (bigint, range [0, 2^1024 - 1]).\n * Output type: U1024BeBytes (Uint8Array of length 128, big-endian).\n * Iterates indices from 127 down to 0, writing low byte then shifting right by 8 bits.\n * MSB is at index 0.\n *\n * @example\n * ```typescript\n * const bytes = encodeU1024ToU1024BeBytes(assertU1024(1n));\n * // bytes[0..126] = 0; bytes[127] = 1\n * ```\n *\n * @see {@link decodeU1024BeBytesToU1024} for the inverse decoding\n * @see {@link encodeU1024ToU1024LeBytes} for the little-endian variant\n */\nexport function encodeU1024ToU1024BeBytes(value: U1024): U1024BeBytes {\n assertU1024(value);\n const result = new Uint8Array(U1024_BYTE_LENGTH);\n let temporary: bigint = value;\n for (let index = U1024_BYTE_LENGTH - 1; index >= 0; index--) {\n result[index] = Number(temporary & 0xffn);\n temporary >>= 8n;\n }\n assertU1024BeBytes(result);\n return result;\n}\n\n/* =============================================================================\n * BYTE ARRAY TO INTEGER DECODING\n *\n * Decode byte arrays to integers from specified endianness.\n * ============================================================================= */\n\n/**\n * Decodes a 1-byte little-endian byte array to a U8 integer.\n *\n * @public\n * @param value - The U8LeBytes array (Uint8Array of length 1) to decode\n * @returns The decoded value as U8\n *\n * @remarks\n * Input type: U8LeBytes (Uint8Array of length 1, little-endian).\n * Output type: U8 (bigint, range [0, 255]).\n * Decoding: `BigInt(value[0])`. For a single byte there is no endianness ambiguity.\n *\n * @example\n * ```typescript\n * const bytes = encodeU8ToU8LeBytes(assertU8(42n));\n * const u8Value = decodeU8LeBytesToU8(bytes); // 42n\n * ```\n *\n * @see {@link encodeU8ToU8LeBytes} for the inverse encoding\n * @see {@link decodeU8BeBytesToU8} for the big-endian variant (identical result)\n */\nexport function decodeU8LeBytesToU8(value: U8LeBytes): U8 {\n assertU8LeBytes(value);\n\n const result = BigInt(value[0]);\n assertU8(result);\n return result;\n}\n\n/**\n * Decodes a 1-byte big-endian byte array to a U8 integer.\n *\n * @public\n * @param value - The U8BeBytes array (Uint8Array of length 1) to decode\n * @returns The decoded value as U8\n *\n * @remarks\n * Input type: U8BeBytes (Uint8Array of length 1, big-endian).\n * Output type: U8 (bigint, range [0, 255]).\n * Decoding: `BigInt(value[0])`. For a single byte there is no endianness ambiguity.\n *\n * @example\n * ```typescript\n * const bytes = encodeU8ToU8BeBytes(assertU8(255n));\n * const u8Value = decodeU8BeBytesToU8(bytes); // 255n\n * ```\n *\n * @see {@link encodeU8ToU8BeBytes} for the inverse encoding\n * @see {@link decodeU8LeBytesToU8} for the little-endian variant (identical result)\n */\nexport function decodeU8BeBytesToU8(value: U8BeBytes): U8 {\n assertU8BeBytes(value);\n\n const result = BigInt(value[0]);\n assertU8(result);\n return result;\n}\n\n/**\n * Decodes a 2-byte little-endian byte array to a U16 integer.\n *\n * @public\n * @param value - The U16LeBytes array (Uint8Array of length 2, LSB at index 0) to decode\n * @returns The decoded value as U16\n *\n * @remarks\n * Input type: U16LeBytes (Uint8Array of length 2, little-endian — byte[0] is LSB).\n * Output type: U16 (bigint, range [0, 65535]).\n * Decoding algorithm: iterates from index LENGTH-1 down to 0, accumulating\n * `result = (result << 8n) | BigInt(value[index])`. Starting from the high index\n * of a LE array means the first byte consumed is the most-significant byte of the\n * stored value, producing the correct big-endian accumulation.\n *\n * @example\n * ```typescript\n * // [0x02, 0x01] in LE encodes 0x0102 = 258\n * const bytes = encodeU16ToU16LeBytes(assertU16(258n));\n * const u16Value = decodeU16LeBytesToU16(bytes); // 258n\n * ```\n *\n * @see {@link encodeU16ToU16LeBytes} for the inverse encoding\n * @see {@link decodeU16BeBytesToU16} for the big-endian variant\n */\nexport function decodeU16LeBytesToU16(value: U16LeBytes): U16 {\n assertU16LeBytes(value);\n let result = 0n;\n for (let index = U16_BYTE_LENGTH - 1; index >= 0; index--) {\n result = (result << 8n) | BigInt(value[index]);\n }\n assertU16(result);\n return result;\n}\n\n/**\n * Decodes a 2-byte big-endian byte array to a U16 integer.\n *\n * @public\n * @param value - The U16BeBytes array (Uint8Array of length 2, MSB at index 0) to decode\n * @returns The decoded value as U16\n *\n * @remarks\n * Input type: U16BeBytes (Uint8Array of length 2, big-endian — byte[0] is MSB).\n * Output type: U16 (bigint, range [0, 65535]).\n * Decoding algorithm: iterates from index 0 to LENGTH-1, accumulating\n * `result = (result << 8n) | BigInt(value[index])`. Reading from the MSB first\n * produces the correct integer value.\n *\n * @example\n * ```typescript\n * // [0x01, 0x02] in BE encodes 0x0102 = 258\n * const bytes = encodeU16ToU16BeBytes(assertU16(258n));\n * const u16Value = decodeU16BeBytesToU16(bytes); // 258n\n * ```\n *\n * @see {@link encodeU16ToU16BeBytes} for the inverse encoding\n * @see {@link decodeU16LeBytesToU16} for the little-endian variant\n */\nexport function decodeU16BeBytesToU16(value: U16BeBytes): U16 {\n assertU16BeBytes(value);\n let result = 0n;\n for (let index = 0; index < U16_BYTE_LENGTH; index++) {\n result = (result << 8n) | BigInt(value[index]);\n }\n assertU16(result);\n return result;\n}\n\n/**\n * Decodes a 4-byte little-endian byte array to a U32 integer.\n *\n * @public\n * @param value - The U32LeBytes array (Uint8Array of length 4, LSB at index 0) to decode\n * @returns The decoded value as U32\n *\n * @remarks\n * Input type: U32LeBytes (Uint8Array of length 4, little-endian — byte[0] is LSB).\n * Output type: U32 (bigint, range [0, 4294967295]).\n * Decoding algorithm: iterates from index LENGTH-1 down to 0, accumulating with\n * left-shift-8 and OR at each step.\n *\n * @example\n * ```typescript\n * const bytes = encodeU32ToU32LeBytes(assertU32(0x01020304n));\n * // bytes = [0x04, 0x03, 0x02, 0x01]\n * const u32Value = decodeU32LeBytesToU32(bytes); // 0x01020304n\n * ```\n *\n * @see {@link encodeU32ToU32LeBytes} for the inverse encoding\n * @see {@link decodeU32BeBytesToU32} for the big-endian variant\n */\nexport function decodeU32LeBytesToU32(value: U32LeBytes): U32 {\n assertU32LeBytes(value);\n let result = 0n;\n for (let index = U32_BYTE_LENGTH - 1; index >= 0; index--) {\n result = (result << 8n) | BigInt(value[index]);\n }\n assertU32(result);\n return result;\n}\n\n/**\n * Decodes a 4-byte big-endian byte array to a U32 integer.\n *\n * @public\n * @param value - The U32BeBytes array (Uint8Array of length 4, MSB at index 0) to decode\n * @returns The decoded value as U32\n *\n * @remarks\n * Input type: U32BeBytes (Uint8Array of length 4, big-endian — byte[0] is MSB).\n * Output type: U32 (bigint, range [0, 4294967295]).\n * Decoding algorithm: iterates from index 0 to LENGTH-1, accumulating with\n * left-shift-8 and OR at each step.\n *\n * @example\n * ```typescript\n * const bytes = encodeU32ToU32BeBytes(assertU32(0x01020304n));\n * // bytes = [0x01, 0x02, 0x03, 0x04]\n * const u32Value = decodeU32BeBytesToU32(bytes); // 0x01020304n\n * ```\n *\n * @see {@link encodeU32ToU32BeBytes} for the inverse encoding\n * @see {@link decodeU32LeBytesToU32} for the little-endian variant\n */\nexport function decodeU32BeBytesToU32(value: U32BeBytes): U32 {\n assertU32BeBytes(value);\n let result = 0n;\n for (let index = 0; index < U32_BYTE_LENGTH; index++) {\n result = (result << 8n) | BigInt(value[index]);\n }\n assertU32(result);\n return result;\n}\n\n/**\n * Decodes an 8-byte little-endian byte array to a U64 integer.\n *\n * @public\n * @param value - The U64LeBytes array (Uint8Array of length 8, LSB at index 0) to decode\n * @returns The decoded value as U64\n *\n * @remarks\n * Input type: U64LeBytes (Uint8Array of length 8, little-endian — byte[0] is LSB).\n * Output type: U64 (bigint, range [0, 2^64 - 1]).\n * Decoding algorithm: iterates from index LENGTH-1 down to 0, accumulating with\n * left-shift-8 and OR at each step.\n * Commonly used to read Solana lamport amounts and 64-bit fields from account data.\n *\n * @example\n * ```typescript\n * const bytes = encodeU64ToU64LeBytes(assertU64(1000n));\n * const u64Value = decodeU64LeBytesToU64(bytes); // 1000n\n * ```\n *\n * @see {@link encodeU64ToU64LeBytes} for the inverse encoding\n * @see {@link decodeU64BeBytesToU64} for the big-endian variant\n */\nexport function decodeU64LeBytesToU64(value: U64LeBytes): U64 {\n assertU64LeBytes(value);\n let result = 0n;\n for (let index = U64_BYTE_LENGTH - 1; index >= 0; index--) {\n result = (result << 8n) | BigInt(value[index]);\n }\n assertU64(result);\n return result;\n}\n\n/**\n * Decodes an 8-byte big-endian byte array to a U64 integer.\n *\n * @public\n * @param value - The U64BeBytes array (Uint8Array of length 8, MSB at index 0) to decode\n * @returns The decoded value as U64\n *\n * @remarks\n * Input type: U64BeBytes (Uint8Array of length 8, big-endian — byte[0] is MSB).\n * Output type: U64 (bigint, range [0, 2^64 - 1]).\n * Decoding algorithm: iterates from index 0 to LENGTH-1, accumulating with\n * left-shift-8 and OR at each step.\n *\n * @example\n * ```typescript\n * const bytes = encodeU64ToU64BeBytes(assertU64(1000n));\n * const u64Value = decodeU64BeBytesToU64(bytes); // 1000n\n * ```\n *\n * @see {@link encodeU64ToU64BeBytes} for the inverse encoding\n * @see {@link decodeU64LeBytesToU64} for the little-endian variant\n */\nexport function decodeU64BeBytesToU64(value: U64BeBytes): U64 {\n assertU64BeBytes(value);\n let result = 0n;\n for (let index = 0; index < U64_BYTE_LENGTH; index++) {\n result = (result << 8n) | BigInt(value[index]);\n }\n assertU64(result);\n return result;\n}\n\n/**\n * Decodes a 16-byte little-endian byte array to a U128 integer.\n *\n * @public\n * @param value - The U128LeBytes array (Uint8Array of length 16, LSB at index 0) to decode\n * @returns The decoded value as U128\n *\n * @remarks\n * Input type: U128LeBytes (Uint8Array of length 16, little-endian — byte[0] is LSB).\n * Output type: U128 (bigint, range [0, 2^128 - 1]).\n * Decoding algorithm: iterates from index LENGTH-1 down to 0, accumulating with\n * left-shift-8 and OR at each step.\n * Used to decode 128-bit nonces and RcEncryptionNonce values from on-chain data.\n *\n * @example\n * ```typescript\n * const bytes = encodeU128ToU128LeBytes(assertU128(2n ** 64n));\n * const u128Value = decodeU128LeBytesToU128(bytes); // 2n ** 64n\n * ```\n *\n * @see {@link encodeU128ToU128LeBytes} for the inverse encoding\n * @see {@link decodeU128BeBytesToU128} for the big-endian variant\n */\nexport function decodeU128LeBytesToU128(value: U128LeBytes): U128 {\n assertU128LeBytes(value);\n let result = 0n;\n for (let index = U128_BYTE_LENGTH - 1; index >= 0; index--) {\n result = (result << 8n) | BigInt(value[index]);\n }\n assertU128(result);\n return result;\n}\n\n/**\n * Decodes a 16-byte big-endian byte array to a U128 integer.\n *\n * @public\n * @param value - The U128BeBytes array (Uint8Array of length 16, MSB at index 0) to decode\n * @returns The decoded value as U128\n *\n * @remarks\n * Input type: U128BeBytes (Uint8Array of length 16, big-endian — byte[0] is MSB).\n * Output type: U128 (bigint, range [0, 2^128 - 1]).\n * Decoding algorithm: iterates from index 0 to LENGTH-1, accumulating with\n * left-shift-8 and OR at each step.\n *\n * @example\n * ```typescript\n * const bytes = encodeU128ToU128BeBytes(assertU128(2n ** 64n));\n * const u128Value = decodeU128BeBytesToU128(bytes); // 2n ** 64n\n * ```\n *\n * @see {@link encodeU128ToU128BeBytes} for the inverse encoding\n * @see {@link decodeU128LeBytesToU128} for the little-endian variant\n */\nexport function decodeU128BeBytesToU128(value: U128BeBytes): U128 {\n assertU128BeBytes(value);\n let result = 0n;\n for (let index = 0; index < U128_BYTE_LENGTH; index++) {\n result = (result << 8n) | BigInt(value[index]);\n }\n assertU128(result);\n return result;\n}\n\n/**\n * Decodes a 32-byte little-endian byte array to a U256 integer.\n *\n * @public\n * @param value - The U256LeBytes array (Uint8Array of length 32, LSB at index 0) to decode\n * @returns The decoded value as U256\n *\n * @remarks\n * Input type: U256LeBytes (Uint8Array of length 32, little-endian — byte[0] is LSB).\n * Output type: U256 (bigint, range [0, 2^256 - 1]).\n * Decoding algorithm: iterates from index LENGTH-1 down to 0, accumulating with\n * left-shift-8 and OR at each step.\n * Commonly used to read X25519 public keys, Poseidon hashes, and UTXO commitments\n * from Solana account data.\n *\n * @example\n * ```typescript\n * const bytes = encodeU256ToU256LeBytes(assertU256(2n ** 200n));\n * const u256Value = decodeU256LeBytesToU256(bytes); // 2n ** 200n\n * ```\n *\n * @see {@link encodeU256ToU256LeBytes} for the inverse encoding\n * @see {@link decodeU256BeBytesToU256} for the big-endian variant\n */\nexport function decodeU256LeBytesToU256(value: U256LeBytes): U256 {\n assertU256LeBytes(value);\n let result = 0n;\n for (let index = U256_BYTE_LENGTH - 1; index >= 0; index--) {\n result = (result << 8n) | BigInt(value[index]);\n }\n assertU256(result);\n return result;\n}\n\n/**\n * Decodes a 32-byte big-endian byte array to a U256 integer.\n *\n * @public\n * @param value - The U256BeBytes array (Uint8Array of length 32, MSB at index 0) to decode\n * @returns The decoded value as U256\n *\n * @remarks\n * Input type: U256BeBytes (Uint8Array of length 32, big-endian — byte[0] is MSB).\n * Output type: U256 (bigint, range [0, 2^256 - 1]).\n * Decoding algorithm: iterates from index 0 to LENGTH-1, accumulating with\n * left-shift-8 and OR at each step.\n * Used to decode BN254/Groth16 field elements received in BE wire format.\n *\n * @example\n * ```typescript\n * const bytes = encodeU256ToU256BeBytes(assertU256(2n ** 200n));\n * const u256Value = decodeU256BeBytesToU256(bytes); // 2n ** 200n\n * ```\n *\n * @see {@link encodeU256ToU256BeBytes} for the inverse encoding\n * @see {@link decodeU256LeBytesToU256} for the little-endian variant\n */\nexport function decodeU256BeBytesToU256(value: U256BeBytes): U256 {\n assertU256BeBytes(value);\n let result = 0n;\n for (let index = 0; index < U256_BYTE_LENGTH; index++) {\n result = (result << 8n) | BigInt(value[index]);\n }\n assertU256(result);\n return result;\n}\n\n/**\n * Decodes a 64-byte little-endian byte array to a U512 integer.\n *\n * @public\n * @param value - The U512LeBytes array (Uint8Array of length 64, LSB at index 0) to decode\n * @returns The decoded value as U512\n *\n * @remarks\n * Input type: U512LeBytes (Uint8Array of length 64, little-endian — byte[0] is LSB).\n * Output type: U512 (bigint, range [0, 2^512 - 1]).\n * Decoding algorithm: iterates from index LENGTH-1 down to 0, accumulating with\n * left-shift-8 and OR at each step.\n *\n * @example\n * ```typescript\n * const bytes = encodeU512ToU512LeBytes(assertU512(2n ** 400n));\n * const u512Value = decodeU512LeBytesToU512(bytes); // 2n ** 400n\n * ```\n *\n * @see {@link encodeU512ToU512LeBytes} for the inverse encoding\n * @see {@link decodeU512BeBytesToU512} for the big-endian variant\n */\nexport function decodeU512LeBytesToU512(value: U512LeBytes): U512 {\n assertU512LeBytes(value);\n let result = 0n;\n for (let index = U512_BYTE_LENGTH - 1; index >= 0; index--) {\n result = (result << 8n) | BigInt(value[index]);\n }\n assertU512(result);\n return result;\n}\n\n/**\n * Decodes a 64-byte big-endian byte array to a U512 integer.\n *\n * @public\n * @param value - The U512BeBytes array (Uint8Array of length 64, MSB at index 0) to decode\n * @returns The decoded value as U512\n *\n * @remarks\n * Input type: U512BeBytes (Uint8Array of length 64, big-endian — byte[0] is MSB).\n * Output type: U512 (bigint, range [0, 2^512 - 1]).\n * Decoding algorithm: iterates from index 0 to LENGTH-1, accumulating with\n * left-shift-8 and OR at each step.\n *\n * @example\n * ```typescript\n * const bytes = encodeU512ToU512BeBytes(assertU512(2n ** 400n));\n * const u512Value = decodeU512BeBytesToU512(bytes); // 2n ** 400n\n * ```\n *\n * @see {@link encodeU512ToU512BeBytes} for the inverse encoding\n * @see {@link decodeU512LeBytesToU512} for the little-endian variant\n */\nexport function decodeU512BeBytesToU512(value: U512BeBytes): U512 {\n assertU512BeBytes(value);\n let result = 0n;\n for (let index = 0; index < U512_BYTE_LENGTH; index++) {\n result = (result << 8n) | BigInt(value[index]);\n }\n assertU512(result);\n return result;\n}\n\n/**\n * Decodes a 128-byte little-endian byte array to a U1024 integer.\n *\n * @public\n * @param value - The U1024LeBytes array (Uint8Array of length 128, LSB at index 0) to decode\n * @returns The decoded value as U1024\n *\n * @remarks\n * Input type: U1024LeBytes (Uint8Array of length 128, little-endian — byte[0] is LSB).\n * Output type: U1024 (bigint, range [0, 2^1024 - 1]).\n * Decoding algorithm: iterates from index LENGTH-1 down to 0, accumulating with\n * left-shift-8 and OR at each step.\n *\n * @example\n * ```typescript\n * const bytes = encodeU1024ToU1024LeBytes(assertU1024(2n ** 900n));\n * const u1024Value = decodeU1024LeBytesToU1024(bytes); // 2n ** 900n\n * ```\n *\n * @see {@link encodeU1024ToU1024LeBytes} for the inverse encoding\n * @see {@link decodeU1024BeBytesToU1024} for the big-endian variant\n */\nexport function decodeU1024LeBytesToU1024(value: U1024LeBytes): U1024 {\n assertU1024LeBytes(value);\n let result = 0n;\n for (let index = U1024_BYTE_LENGTH - 1; index >= 0; index--) {\n result = (result << 8n) | BigInt(value[index]);\n }\n assertU1024(result);\n return result;\n}\n\n/**\n * Decodes a 128-byte big-endian byte array to a U1024 integer.\n *\n * @public\n * @param value - The U1024BeBytes array (Uint8Array of length 128, MSB at index 0) to decode\n * @returns The decoded value as U1024\n *\n * @remarks\n * Input type: U1024BeBytes (Uint8Array of length 128, big-endian — byte[0] is MSB).\n * Output type: U1024 (bigint, range [0, 2^1024 - 1]).\n * Decoding algorithm: iterates from index 0 to LENGTH-1, accumulating with\n * left-shift-8 and OR at each step.\n *\n * @example\n * ```typescript\n * const bytes = encodeU1024ToU1024BeBytes(assertU1024(2n ** 900n));\n * const u1024Value = decodeU1024BeBytesToU1024(bytes); // 2n ** 900n\n * ```\n *\n * @see {@link encodeU1024ToU1024BeBytes} for the inverse encoding\n * @see {@link decodeU1024LeBytesToU1024} for the little-endian variant\n */\nexport function decodeU1024BeBytesToU1024(value: U1024BeBytes): U1024 {\n assertU1024BeBytes(value);\n let result = 0n;\n for (let index = 0; index < U1024_BYTE_LENGTH; index++) {\n result = (result << 8n) | BigInt(value[index]);\n }\n assertU1024(result);\n return result;\n}\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { UmbraError } from './chunk-4TZVXB5G.js';
|
|
2
|
+
import { __name } from './chunk-7QVYU63E.js';
|
|
3
|
+
|
|
4
|
+
// src/crypto/errors.ts
|
|
5
|
+
var CryptographyError = class extends UmbraError {
|
|
6
|
+
static {
|
|
7
|
+
__name(this, "CryptographyError");
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The cryptographic operation that failed.
|
|
11
|
+
*/
|
|
12
|
+
operation;
|
|
13
|
+
constructor(message, options) {
|
|
14
|
+
super(message, {
|
|
15
|
+
code: options?.code ?? "CRYPTOGRAPHY_ERROR",
|
|
16
|
+
...options?.context !== void 0 && {
|
|
17
|
+
context: options.context
|
|
18
|
+
},
|
|
19
|
+
...options?.cause !== void 0 && {
|
|
20
|
+
cause: options.cause
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
this.name = "CryptographyError";
|
|
24
|
+
if (options?.operation !== void 0) {
|
|
25
|
+
this.operation = options.operation;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
function isCryptographyError(error) {
|
|
30
|
+
return error instanceof CryptographyError;
|
|
31
|
+
}
|
|
32
|
+
__name(isCryptographyError, "isCryptographyError");
|
|
33
|
+
|
|
34
|
+
export { CryptographyError, isCryptographyError };
|
|
35
|
+
//# sourceMappingURL=chunk-5KPQXPQM.js.map
|
|
36
|
+
//# sourceMappingURL=chunk-5KPQXPQM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/crypto/errors.ts"],"names":[],"mappings":";;;;AA4BO,IAAM,iBAAA,GAAN,cAAgC,UAAA,CAAW;AAAA,EA5BlD;AA4BkD,IAAA,MAAA,CAAA,IAAA,EAAA,mBAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAIvC,SAAA;AAAA,EAET,WAAA,CACE,SACA,OAAA,EAMA;AACA,IAAA,KAAA,CAAM,OAAA,EAAS;AAAA,MACb,IAAA,EAAM,SAAS,IAAA,IAAQ,oBAAA;AAAA,MACvB,GAAI,OAAA,EAAS,OAAA,KAAY,MAAA,IAAa;AAAA,QACpC,SAAS,OAAA,CAAQ;AAAA,OACnB;AAAA,MACA,GAAI,OAAA,EAAS,KAAA,KAAU,MAAA,IAAa;AAAA,QAClC,OAAO,OAAA,CAAQ;AAAA;AACjB,KACD,CAAA;AACD,IAAA,IAAA,CAAK,IAAA,GAAO,mBAAA;AACZ,IAAA,IAAI,OAAA,EAAS,cAAc,MAAA,EAAW;AACpC,MAAA,IAAA,CAAK,YAAY,OAAA,CAAQ,SAAA;AAAA,IAC3B;AAAA,EACF;AACF;AAKO,SAAS,oBAAoB,KAAA,EAA4C;AAC9E,EAAA,OAAO,KAAA,YAAiB,iBAAA;AAC1B;AAFgB,MAAA,CAAA,mBAAA,EAAA,qBAAA,CAAA","file":"chunk-5KPQXPQM.js","sourcesContent":["/**\n * Cryptography Error Classes\n *\n * This module provides error classes for cryptographic operation failures\n * in the Umbra SDK.\n *\n * @module crypto/errors\n */\n\nimport { UmbraError } from \"../common/errors\";\n\n/**\n * Error thrown when a cryptographic operation fails.\n *\n * This includes key derivation failures, encryption/decryption errors,\n * hash computation failures, and ZK proof generation errors.\n *\n * @example\n * ```typescript\n * try {\n * const commitment = await generateUserCommitment(mvk, index, seed);\n * } catch (error) {\n * if (error instanceof CryptographyError) {\n * console.log('Crypto operation failed:', error.operation);\n * }\n * }\n * ```\n */\nexport class CryptographyError extends UmbraError {\n /**\n * The cryptographic operation that failed.\n */\n readonly operation?: string;\n\n constructor(\n message: string,\n options?: {\n code?: string;\n operation?: string;\n context?: Record<string, unknown>;\n cause?: unknown;\n },\n ) {\n super(message, {\n code: options?.code ?? \"CRYPTOGRAPHY_ERROR\",\n ...(options?.context !== undefined && {\n context: options.context,\n }),\n ...(options?.cause !== undefined && {\n cause: options.cause,\n }),\n });\n this.name = \"CryptographyError\";\n if (options?.operation !== undefined) {\n this.operation = options.operation;\n }\n }\n}\n\n/**\n * Type guard to check if an error is a CryptographyError.\n */\nexport function isCryptographyError(error: unknown): error is CryptographyError {\n return error instanceof CryptographyError;\n}\n"]}
|
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkENVYYEM4_cjs = require('./chunk-ENVYYEM4.cjs');
|
|
4
|
+
var chunkFZYWLQAF_cjs = require('./chunk-FZYWLQAF.cjs');
|
|
5
|
+
var chunkPK6SKIKE_cjs = require('./chunk-PK6SKIKE.cjs');
|
|
6
|
+
var kit = require('@solana/kit');
|
|
7
|
+
var walletStandardFeatures = require('@solana/wallet-standard-features');
|
|
8
|
+
|
|
9
|
+
function getRpcAccountInfoProvider(config) {
|
|
10
|
+
const { rpcUrl } = config;
|
|
11
|
+
let rpcClient = null;
|
|
12
|
+
function getRpc() {
|
|
13
|
+
rpcClient ??= kit.createSolanaRpc(rpcUrl);
|
|
14
|
+
return rpcClient;
|
|
15
|
+
}
|
|
16
|
+
chunkPK6SKIKE_cjs.__name(getRpc, "getRpc");
|
|
17
|
+
return async (addresses, options) => {
|
|
18
|
+
const commitment = options?.commitment ?? "confirmed";
|
|
19
|
+
if (addresses.length === 0) {
|
|
20
|
+
return /* @__PURE__ */ new Map();
|
|
21
|
+
}
|
|
22
|
+
const seen = /* @__PURE__ */ new Set();
|
|
23
|
+
const uniqueAddresses = [];
|
|
24
|
+
for (const addr of addresses) {
|
|
25
|
+
const key = addr.toString();
|
|
26
|
+
if (!seen.has(key)) {
|
|
27
|
+
seen.add(key);
|
|
28
|
+
uniqueAddresses.push(addr);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const rpc = getRpc();
|
|
32
|
+
const accounts = await kit.fetchEncodedAccounts(rpc, uniqueAddresses, { commitment });
|
|
33
|
+
const result = /* @__PURE__ */ new Map();
|
|
34
|
+
for (const [index, uniqueAddress] of uniqueAddresses.entries()) {
|
|
35
|
+
result.set(uniqueAddress, accounts[index]);
|
|
36
|
+
}
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
chunkPK6SKIKE_cjs.__name(getRpcAccountInfoProvider, "getRpcAccountInfoProvider");
|
|
41
|
+
function getRpcBlockhashProvider(config, deps) {
|
|
42
|
+
const { rpcUrl } = config;
|
|
43
|
+
const { createRpc = kit.createSolanaRpc } = deps ?? {};
|
|
44
|
+
const rpc = createRpc(rpcUrl);
|
|
45
|
+
return async (options) => {
|
|
46
|
+
const commitment = options?.commitment ?? "confirmed";
|
|
47
|
+
const response = await rpc.getLatestBlockhash({ commitment }).send();
|
|
48
|
+
return {
|
|
49
|
+
blockhash: response.value.blockhash,
|
|
50
|
+
lastValidBlockHeight: response.value.lastValidBlockHeight
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
chunkPK6SKIKE_cjs.__name(getRpcBlockhashProvider, "getRpcBlockhashProvider");
|
|
55
|
+
function getRpcEpochInfoProvider(config, deps) {
|
|
56
|
+
const { rpcUrl } = config;
|
|
57
|
+
const { createRpc = kit.createSolanaRpc } = deps ?? {};
|
|
58
|
+
const rpc = createRpc(rpcUrl);
|
|
59
|
+
return async (options) => {
|
|
60
|
+
const commitment = options?.commitment ?? "confirmed";
|
|
61
|
+
const response = await rpc.getEpochInfo({ commitment }).send();
|
|
62
|
+
return {
|
|
63
|
+
epoch: response.epoch,
|
|
64
|
+
slotIndex: response.slotIndex,
|
|
65
|
+
slotsInEpoch: response.slotsInEpoch,
|
|
66
|
+
absoluteSlot: response.absoluteSlot,
|
|
67
|
+
blockHeight: response.blockHeight,
|
|
68
|
+
...response.transactionCount !== null && {
|
|
69
|
+
transactionCount: response.transactionCount
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
chunkPK6SKIKE_cjs.__name(getRpcEpochInfoProvider, "getRpcEpochInfoProvider");
|
|
75
|
+
function convertSolanaKitKeypairSignerToIUmbraSigner(kps) {
|
|
76
|
+
return {
|
|
77
|
+
address: kps.address,
|
|
78
|
+
async signTransaction(transaction) {
|
|
79
|
+
const kitTx = transaction;
|
|
80
|
+
const [sigDict] = await kps.signTransactions([kitTx]);
|
|
81
|
+
return {
|
|
82
|
+
...transaction,
|
|
83
|
+
signatures: { ...transaction.signatures, ...sigDict }
|
|
84
|
+
};
|
|
85
|
+
},
|
|
86
|
+
async signTransactions(transactions) {
|
|
87
|
+
const kitTxs = transactions;
|
|
88
|
+
const sigDicts = await kps.signTransactions(kitTxs);
|
|
89
|
+
return transactions.map((tx, index) => ({
|
|
90
|
+
...tx,
|
|
91
|
+
signatures: { ...tx.signatures, ...sigDicts[index] }
|
|
92
|
+
}));
|
|
93
|
+
},
|
|
94
|
+
async signMessage(message) {
|
|
95
|
+
const signature = await kit.signBytes(kps.keyPair.privateKey, message);
|
|
96
|
+
return { message, signature, signer: kps.address };
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
chunkPK6SKIKE_cjs.__name(convertSolanaKitKeypairSignerToIUmbraSigner, "convertSolanaKitKeypairSignerToIUmbraSigner");
|
|
101
|
+
function convertWalletStandardAccountToIUmbraSigner(wallet, account) {
|
|
102
|
+
const walletFeatures = wallet.features;
|
|
103
|
+
const signTxFeature = walletFeatures[walletStandardFeatures.SolanaSignTransaction];
|
|
104
|
+
const signMessageFeature = walletFeatures[walletStandardFeatures.SolanaSignMessage];
|
|
105
|
+
if (signTxFeature === void 0) {
|
|
106
|
+
throw new Error(
|
|
107
|
+
`Wallet "${wallet.name}" does not support the "${walletStandardFeatures.SolanaSignTransaction}" feature`
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
if (signMessageFeature === void 0) {
|
|
111
|
+
throw new Error(`Wallet "${wallet.name}" does not support the "${walletStandardFeatures.SolanaSignMessage}" feature`);
|
|
112
|
+
}
|
|
113
|
+
const encoder = kit.getTransactionEncoder();
|
|
114
|
+
const decoder = kit.getTransactionDecoder();
|
|
115
|
+
return {
|
|
116
|
+
address: account.address,
|
|
117
|
+
async signTransaction(transaction) {
|
|
118
|
+
const wireBytes = encoder.encode(transaction);
|
|
119
|
+
const [output] = await signTxFeature.signTransaction({ account, transaction: wireBytes });
|
|
120
|
+
const decoded = decoder.decode(output.signedTransaction);
|
|
121
|
+
return {
|
|
122
|
+
...transaction,
|
|
123
|
+
signatures: { ...transaction.signatures, ...decoded.signatures }
|
|
124
|
+
};
|
|
125
|
+
},
|
|
126
|
+
async signTransactions(transactions) {
|
|
127
|
+
const inputs = transactions.map((tx) => ({
|
|
128
|
+
account,
|
|
129
|
+
transaction: encoder.encode(tx)
|
|
130
|
+
}));
|
|
131
|
+
const outputs = await signTxFeature.signTransaction(...inputs);
|
|
132
|
+
return transactions.map((tx, index) => {
|
|
133
|
+
const decoded = decoder.decode(outputs[index].signedTransaction);
|
|
134
|
+
return {
|
|
135
|
+
...tx,
|
|
136
|
+
signatures: { ...tx.signatures, ...decoded.signatures }
|
|
137
|
+
};
|
|
138
|
+
});
|
|
139
|
+
},
|
|
140
|
+
async signMessage(message) {
|
|
141
|
+
const [output] = await signMessageFeature.signMessage({ account, message });
|
|
142
|
+
return {
|
|
143
|
+
message,
|
|
144
|
+
// Cast required: Wallet Standard returns its own signature type,
|
|
145
|
+
// we need @solana/kit's SignatureBytes. Both are 64-byte Uint8Array.
|
|
146
|
+
signature: output.signature,
|
|
147
|
+
signer: account.address
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
chunkPK6SKIKE_cjs.__name(convertWalletStandardAccountToIUmbraSigner, "convertWalletStandardAccountToIUmbraSigner");
|
|
153
|
+
async function createInMemorySigner() {
|
|
154
|
+
const kps = await kit.generateKeyPairSigner();
|
|
155
|
+
return convertSolanaKitKeypairSignerToIUmbraSigner(kps);
|
|
156
|
+
}
|
|
157
|
+
chunkPK6SKIKE_cjs.__name(createInMemorySigner, "createInMemorySigner");
|
|
158
|
+
async function createSignerFromPrivateKeyBytes(bytes) {
|
|
159
|
+
const kps = await kit.createKeyPairSignerFromBytes(bytes);
|
|
160
|
+
return convertSolanaKitKeypairSignerToIUmbraSigner(kps);
|
|
161
|
+
}
|
|
162
|
+
chunkPK6SKIKE_cjs.__name(createSignerFromPrivateKeyBytes, "createSignerFromPrivateKeyBytes");
|
|
163
|
+
function createSignerFromKeyPair(kps) {
|
|
164
|
+
return convertSolanaKitKeypairSignerToIUmbraSigner(kps);
|
|
165
|
+
}
|
|
166
|
+
chunkPK6SKIKE_cjs.__name(createSignerFromKeyPair, "createSignerFromKeyPair");
|
|
167
|
+
function createSignerFromWalletAccount(wallet, account) {
|
|
168
|
+
return convertWalletStandardAccountToIUmbraSigner(wallet, account);
|
|
169
|
+
}
|
|
170
|
+
chunkPK6SKIKE_cjs.__name(createSignerFromWalletAccount, "createSignerFromWalletAccount");
|
|
171
|
+
function assertKitCompatibleTransaction(transaction) {
|
|
172
|
+
if (transaction.messageBytes === void 0) {
|
|
173
|
+
throw new Error("Transaction is missing messageBytes — not a valid signed transaction");
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
chunkPK6SKIKE_cjs.__name(assertKitCompatibleTransaction, "assertKitCompatibleTransaction");
|
|
177
|
+
function toTransactionSignature(signature) {
|
|
178
|
+
const sigString = signature.toString();
|
|
179
|
+
chunkFZYWLQAF_cjs.assertTransactionSignature(sigString);
|
|
180
|
+
return sigString;
|
|
181
|
+
}
|
|
182
|
+
chunkPK6SKIKE_cjs.__name(toTransactionSignature, "toTransactionSignature");
|
|
183
|
+
function getWebsocketTransactionForwarder(config, deps) {
|
|
184
|
+
const { rpcUrl, rpcSubscriptionsUrl } = config;
|
|
185
|
+
const {
|
|
186
|
+
createRpc = kit.createSolanaRpc,
|
|
187
|
+
createRpcSubscriptions = kit.createSolanaRpcSubscriptions,
|
|
188
|
+
sendAndConfirmTransactionFactory = kit.sendAndConfirmTransactionFactory
|
|
189
|
+
} = deps ?? {};
|
|
190
|
+
const rpc = createRpc(rpcUrl);
|
|
191
|
+
const rpcSubscriptions = createRpcSubscriptions(rpcSubscriptionsUrl);
|
|
192
|
+
const sendAndConfirm = sendAndConfirmTransactionFactory({
|
|
193
|
+
rpc,
|
|
194
|
+
rpcSubscriptions
|
|
195
|
+
});
|
|
196
|
+
async function sendAndConfirmTransaction(transaction, options) {
|
|
197
|
+
const commitment = options.commitment ?? "confirmed";
|
|
198
|
+
assertKitCompatibleTransaction(transaction);
|
|
199
|
+
await sendAndConfirm(transaction, {
|
|
200
|
+
commitment
|
|
201
|
+
});
|
|
202
|
+
const signature = kit.getSignatureFromTransaction(transaction);
|
|
203
|
+
return toTransactionSignature(signature);
|
|
204
|
+
}
|
|
205
|
+
chunkPK6SKIKE_cjs.__name(sendAndConfirmTransaction, "sendAndConfirmTransaction");
|
|
206
|
+
return {
|
|
207
|
+
/**
|
|
208
|
+
* Forwards transactions one at a time, waiting for each to reach the
|
|
209
|
+
* requested commitment level before submitting the next.
|
|
210
|
+
*
|
|
211
|
+
* @param transactions - Ordered array of signed transactions.
|
|
212
|
+
* @param options - Forward options (commitment). Defaults to `"confirmed"`.
|
|
213
|
+
* @returns Array of confirmed signatures in input order.
|
|
214
|
+
*/
|
|
215
|
+
forwardSequentially: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async (transactions, options = {}) => {
|
|
216
|
+
const signatures = [];
|
|
217
|
+
for (const transaction of transactions) {
|
|
218
|
+
const signature = await sendAndConfirmTransaction(transaction, options);
|
|
219
|
+
signatures.push(signature);
|
|
220
|
+
}
|
|
221
|
+
return signatures;
|
|
222
|
+
}, "forwardSequentially"),
|
|
223
|
+
/**
|
|
224
|
+
* Forwards all transactions simultaneously via `Promise.all`.
|
|
225
|
+
*
|
|
226
|
+
* Each transaction is passed to `sendAndConfirmTransaction` concurrently.
|
|
227
|
+
* Results are returned in input order regardless of confirmation order.
|
|
228
|
+
*
|
|
229
|
+
* @param transactions - Array of signed transactions to submit in parallel.
|
|
230
|
+
* @param options - Forward options (commitment). Defaults to `"confirmed"`.
|
|
231
|
+
* @returns Array of confirmed signatures in input order.
|
|
232
|
+
*/
|
|
233
|
+
forwardInParallel: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async (transactions, options = {}) => {
|
|
234
|
+
const signaturePromises = transactions.map(
|
|
235
|
+
async (tx) => sendAndConfirmTransaction(tx, options)
|
|
236
|
+
);
|
|
237
|
+
return Promise.all(signaturePromises);
|
|
238
|
+
}, "forwardInParallel"),
|
|
239
|
+
fireAndForget: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async (transaction) => {
|
|
240
|
+
const wireTransaction = kit.getBase64EncodedWireTransaction(transaction);
|
|
241
|
+
const response = await rpc.sendTransaction(wireTransaction, {
|
|
242
|
+
encoding: "base64",
|
|
243
|
+
skipPreflight: true
|
|
244
|
+
}).send();
|
|
245
|
+
return toTransactionSignature(response);
|
|
246
|
+
}, "fireAndForget")
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
chunkPK6SKIKE_cjs.__name(getWebsocketTransactionForwarder, "getWebsocketTransactionForwarder");
|
|
250
|
+
function getPollingTransactionForwarder(config, deps) {
|
|
251
|
+
const { rpcUrl } = config;
|
|
252
|
+
const { createRpc = kit.createSolanaRpc } = deps ?? {};
|
|
253
|
+
const rpc = createRpc(rpcUrl);
|
|
254
|
+
async function sendTransactionOnly(transaction, commitment) {
|
|
255
|
+
const wireTransaction = kit.getBase64EncodedWireTransaction(transaction);
|
|
256
|
+
const response = await rpc.sendTransaction(wireTransaction, {
|
|
257
|
+
encoding: "base64",
|
|
258
|
+
preflightCommitment: commitment
|
|
259
|
+
}).send();
|
|
260
|
+
return toTransactionSignature(response);
|
|
261
|
+
}
|
|
262
|
+
chunkPK6SKIKE_cjs.__name(sendTransactionOnly, "sendTransactionOnly");
|
|
263
|
+
async function waitForConfirmation(signature, commitment, timeoutMs, pollingIntervalMs) {
|
|
264
|
+
const startTime = Date.now();
|
|
265
|
+
while (Date.now() - startTime < timeoutMs) {
|
|
266
|
+
const response = await rpc.getSignatureStatuses([kit.signature(signature)], {
|
|
267
|
+
searchTransactionHistory: false
|
|
268
|
+
}).send();
|
|
269
|
+
const status = response.value[0];
|
|
270
|
+
if (status !== null) {
|
|
271
|
+
const confirmedCommitments = ["confirmed", "finalized"];
|
|
272
|
+
const finalizedCommitments = ["finalized"];
|
|
273
|
+
const confirmationStatus = status.confirmationStatus;
|
|
274
|
+
if (commitment === "processed" && confirmationStatus !== null) {
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
if (commitment === "confirmed" && confirmationStatus !== null && confirmedCommitments.includes(confirmationStatus)) {
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
if (commitment === "finalized" && confirmationStatus !== null && finalizedCommitments.includes(confirmationStatus)) {
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
if (status.err !== null) {
|
|
284
|
+
throw new Error(`Transaction failed: ${JSON.stringify(status.err)}`);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
await chunkENVYYEM4_cjs.sleep(pollingIntervalMs);
|
|
288
|
+
}
|
|
289
|
+
throw new Error(`Transaction confirmation timed out after ${String(timeoutMs)}ms`);
|
|
290
|
+
}
|
|
291
|
+
chunkPK6SKIKE_cjs.__name(waitForConfirmation, "waitForConfirmation");
|
|
292
|
+
async function sendWithRetries(transaction, commitment, maxRetries) {
|
|
293
|
+
let lastError;
|
|
294
|
+
for (let attempt = 0; attempt < maxRetries; attempt++) {
|
|
295
|
+
try {
|
|
296
|
+
return await sendTransactionOnly(transaction, commitment);
|
|
297
|
+
} catch (error) {
|
|
298
|
+
lastError = error instanceof Error ? error : new Error(String(error));
|
|
299
|
+
if (attempt < maxRetries - 1) {
|
|
300
|
+
await chunkENVYYEM4_cjs.sleep(1e3 * (attempt + 1));
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
throw lastError ?? new Error("Failed to send transaction after retries");
|
|
305
|
+
}
|
|
306
|
+
chunkPK6SKIKE_cjs.__name(sendWithRetries, "sendWithRetries");
|
|
307
|
+
return {
|
|
308
|
+
/**
|
|
309
|
+
* Forwards transactions sequentially using polling-based confirmation.
|
|
310
|
+
*
|
|
311
|
+
* @remarks
|
|
312
|
+
* For each transaction in order:
|
|
313
|
+
* 1. Sends with retries (up to `maxRetries`).
|
|
314
|
+
* 2. Polls until confirmed (up to `timeoutMs`).
|
|
315
|
+
* 3. Invokes `onTransactionConfirmed` if provided (awaited).
|
|
316
|
+
*
|
|
317
|
+
* Aborts on first failure without submitting subsequent transactions.
|
|
318
|
+
*
|
|
319
|
+
* @param transactions - Ordered array of signed transactions.
|
|
320
|
+
* @param options - Polling-specific options. All fields have defaults.
|
|
321
|
+
* @returns Array of confirmed signatures in input order.
|
|
322
|
+
*/
|
|
323
|
+
forwardSequentially: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async (transactions, options = {}) => {
|
|
324
|
+
const {
|
|
325
|
+
commitment = "confirmed",
|
|
326
|
+
timeoutMs = 6e4,
|
|
327
|
+
pollingIntervalMs = 1e3,
|
|
328
|
+
maxRetries = 3,
|
|
329
|
+
onTransactionConfirmed
|
|
330
|
+
} = options;
|
|
331
|
+
const signatures = [];
|
|
332
|
+
const totalCount = transactions.length;
|
|
333
|
+
for (const [index, transaction] of transactions.entries()) {
|
|
334
|
+
const signature = await sendWithRetries(transaction, commitment, maxRetries);
|
|
335
|
+
await waitForConfirmation(signature, commitment, timeoutMs, pollingIntervalMs);
|
|
336
|
+
signatures.push(signature);
|
|
337
|
+
if (onTransactionConfirmed !== void 0) {
|
|
338
|
+
await onTransactionConfirmed({
|
|
339
|
+
signature,
|
|
340
|
+
index,
|
|
341
|
+
totalCount
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
return signatures;
|
|
346
|
+
}, "forwardSequentially"),
|
|
347
|
+
/**
|
|
348
|
+
* Forwards all transactions in parallel using polling-based confirmation.
|
|
349
|
+
*
|
|
350
|
+
* @remarks
|
|
351
|
+
* All transactions are sent concurrently (with retries), then all
|
|
352
|
+
* confirmations are awaited concurrently. The `onTransactionConfirmed`
|
|
353
|
+
* callback is NOT invoked during parallel forwarding.
|
|
354
|
+
*
|
|
355
|
+
* @param transactions - Array of signed transactions to submit in parallel.
|
|
356
|
+
* @param options - Polling-specific options. All fields have defaults.
|
|
357
|
+
* @returns Array of confirmed signatures in input order.
|
|
358
|
+
*/
|
|
359
|
+
forwardInParallel: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async (transactions, options = {}) => {
|
|
360
|
+
const {
|
|
361
|
+
commitment = "confirmed",
|
|
362
|
+
timeoutMs = 6e4,
|
|
363
|
+
pollingIntervalMs = 1e3,
|
|
364
|
+
maxRetries = 3
|
|
365
|
+
} = options;
|
|
366
|
+
const sendPromises = transactions.map(
|
|
367
|
+
async (tx) => sendWithRetries(tx, commitment, maxRetries)
|
|
368
|
+
);
|
|
369
|
+
const signatures = await Promise.all(sendPromises);
|
|
370
|
+
const confirmationPromises = signatures.map(
|
|
371
|
+
async (sig) => waitForConfirmation(sig, commitment, timeoutMs, pollingIntervalMs)
|
|
372
|
+
);
|
|
373
|
+
await Promise.all(confirmationPromises);
|
|
374
|
+
return signatures;
|
|
375
|
+
}, "forwardInParallel"),
|
|
376
|
+
fireAndForget: /* @__PURE__ */ chunkPK6SKIKE_cjs.__name(async (transaction) => {
|
|
377
|
+
return sendTransactionOnly(transaction, "confirmed");
|
|
378
|
+
}, "fireAndForget")
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
chunkPK6SKIKE_cjs.__name(getPollingTransactionForwarder, "getPollingTransactionForwarder");
|
|
382
|
+
|
|
383
|
+
// src/solana/alt-utils.ts
|
|
384
|
+
function buildAltAddressesRecord(altEntry) {
|
|
385
|
+
return { [altEntry.altAddress]: [...altEntry.addresses] };
|
|
386
|
+
}
|
|
387
|
+
chunkPK6SKIKE_cjs.__name(buildAltAddressesRecord, "buildAltAddressesRecord");
|
|
388
|
+
function lookupAltEntry(addressLookupTables, clusterOffset, instructionName) {
|
|
389
|
+
return addressLookupTables[clusterOffset]?.[instructionName];
|
|
390
|
+
}
|
|
391
|
+
chunkPK6SKIKE_cjs.__name(lookupAltEntry, "lookupAltEntry");
|
|
392
|
+
|
|
393
|
+
exports.buildAltAddressesRecord = buildAltAddressesRecord;
|
|
394
|
+
exports.createInMemorySigner = createInMemorySigner;
|
|
395
|
+
exports.createSignerFromKeyPair = createSignerFromKeyPair;
|
|
396
|
+
exports.createSignerFromPrivateKeyBytes = createSignerFromPrivateKeyBytes;
|
|
397
|
+
exports.createSignerFromWalletAccount = createSignerFromWalletAccount;
|
|
398
|
+
exports.getPollingTransactionForwarder = getPollingTransactionForwarder;
|
|
399
|
+
exports.getRpcAccountInfoProvider = getRpcAccountInfoProvider;
|
|
400
|
+
exports.getRpcBlockhashProvider = getRpcBlockhashProvider;
|
|
401
|
+
exports.getRpcEpochInfoProvider = getRpcEpochInfoProvider;
|
|
402
|
+
exports.getWebsocketTransactionForwarder = getWebsocketTransactionForwarder;
|
|
403
|
+
exports.lookupAltEntry = lookupAltEntry;
|
|
404
|
+
//# sourceMappingURL=chunk-AXD7LXYY.cjs.map
|
|
405
|
+
//# sourceMappingURL=chunk-AXD7LXYY.cjs.map
|