@hashgraphonline/standards-sdk 0.0.77 → 0.0.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/standards-sdk.es100.js +14 -16
- package/dist/es/standards-sdk.es100.js.map +1 -1
- package/dist/es/standards-sdk.es101.js +4 -60
- package/dist/es/standards-sdk.es101.js.map +1 -1
- package/dist/es/standards-sdk.es102.js +37 -1287
- package/dist/es/standards-sdk.es102.js.map +1 -1
- package/dist/es/standards-sdk.es103.js +35 -143
- package/dist/es/standards-sdk.es103.js.map +1 -1
- package/dist/es/standards-sdk.es104.js +36 -90
- package/dist/es/standards-sdk.es104.js.map +1 -1
- package/dist/es/standards-sdk.es105.js +71 -77
- package/dist/es/standards-sdk.es105.js.map +1 -1
- package/dist/es/standards-sdk.es106.js +18 -29
- package/dist/es/standards-sdk.es106.js.map +1 -1
- package/dist/es/standards-sdk.es107.js +26 -5
- package/dist/es/standards-sdk.es107.js.map +1 -1
- package/dist/es/standards-sdk.es108.js +26 -159
- package/dist/es/standards-sdk.es108.js.map +1 -1
- package/dist/es/standards-sdk.es109.js +36 -21
- package/dist/es/standards-sdk.es109.js.map +1 -1
- package/dist/es/standards-sdk.es110.js +30 -789
- package/dist/es/standards-sdk.es110.js.map +1 -1
- package/dist/es/standards-sdk.es111.js +30 -171
- package/dist/es/standards-sdk.es111.js.map +1 -1
- package/dist/es/standards-sdk.es112.js +9 -143
- package/dist/es/standards-sdk.es112.js.map +1 -1
- package/dist/es/standards-sdk.es113.js +32 -19
- package/dist/es/standards-sdk.es113.js.map +1 -1
- package/dist/es/standards-sdk.es114.js +3 -27
- package/dist/es/standards-sdk.es114.js.map +1 -1
- package/dist/es/standards-sdk.es115.js +2 -26
- package/dist/es/standards-sdk.es115.js.map +1 -1
- package/dist/es/standards-sdk.es116.js +2 -38
- package/dist/es/standards-sdk.es116.js.map +1 -1
- package/dist/es/standards-sdk.es12.js +3 -3
- package/dist/es/standards-sdk.es12.js.map +1 -1
- package/dist/es/standards-sdk.es21.js +1 -1
- package/dist/es/standards-sdk.es23.js +1 -1
- package/dist/es/standards-sdk.es26.js +1041 -3
- package/dist/es/standards-sdk.es26.js.map +1 -1
- package/dist/es/standards-sdk.es27.js +3 -2
- package/dist/es/standards-sdk.es27.js.map +1 -1
- package/dist/es/standards-sdk.es28.js +4086 -960
- package/dist/es/standards-sdk.es28.js.map +1 -1
- package/dist/es/standards-sdk.es29.js +2 -4167
- package/dist/es/standards-sdk.es29.js.map +1 -1
- package/dist/es/standards-sdk.es33.js +1 -7133
- package/dist/es/standards-sdk.es33.js.map +1 -1
- package/dist/es/standards-sdk.es34.js +7133 -1
- package/dist/es/standards-sdk.es34.js.map +1 -1
- package/dist/es/standards-sdk.es38.js +1 -1
- package/dist/es/standards-sdk.es39.js +1 -1
- package/dist/es/standards-sdk.es4.js +1 -1
- package/dist/es/standards-sdk.es40.js +1 -1
- package/dist/es/standards-sdk.es42.js +5 -5
- package/dist/es/standards-sdk.es44.js +3 -3
- package/dist/es/standards-sdk.es54.js +1 -1
- package/dist/es/standards-sdk.es55.js +3 -3
- package/dist/es/standards-sdk.es57.js +2 -2282
- package/dist/es/standards-sdk.es57.js.map +1 -1
- package/dist/es/standards-sdk.es58.js +2281 -163
- package/dist/es/standards-sdk.es58.js.map +1 -1
- package/dist/es/standards-sdk.es59.js +159 -27
- package/dist/es/standards-sdk.es59.js.map +1 -1
- package/dist/es/standards-sdk.es60.js +25 -56
- package/dist/es/standards-sdk.es60.js.map +1 -1
- package/dist/es/standards-sdk.es61.js +58 -45
- package/dist/es/standards-sdk.es61.js.map +1 -1
- package/dist/es/standards-sdk.es62.js +48 -8
- package/dist/es/standards-sdk.es62.js.map +1 -1
- package/dist/es/standards-sdk.es63.js +8 -63
- package/dist/es/standards-sdk.es63.js.map +1 -1
- package/dist/es/standards-sdk.es64.js +64 -5
- package/dist/es/standards-sdk.es64.js.map +1 -1
- package/dist/es/standards-sdk.es65.js +6 -15
- package/dist/es/standards-sdk.es65.js.map +1 -1
- package/dist/es/standards-sdk.es66.js +15 -7
- package/dist/es/standards-sdk.es66.js.map +1 -1
- package/dist/es/standards-sdk.es67.js +6 -44
- package/dist/es/standards-sdk.es67.js.map +1 -1
- package/dist/es/standards-sdk.es68.js +45 -2
- package/dist/es/standards-sdk.es68.js.map +1 -1
- package/dist/es/standards-sdk.es69.js +2 -136
- package/dist/es/standards-sdk.es69.js.map +1 -1
- package/dist/es/standards-sdk.es7.js +1 -1
- package/dist/es/standards-sdk.es70.js +124 -160
- package/dist/es/standards-sdk.es70.js.map +1 -1
- package/dist/es/standards-sdk.es71.js +171 -12
- package/dist/es/standards-sdk.es71.js.map +1 -1
- package/dist/es/standards-sdk.es72.js +84 -13
- package/dist/es/standards-sdk.es72.js.map +1 -1
- package/dist/es/standards-sdk.es73.js +20 -29
- package/dist/es/standards-sdk.es73.js.map +1 -1
- package/dist/es/standards-sdk.es74.js +146 -13
- package/dist/es/standards-sdk.es74.js.map +1 -1
- package/dist/es/standards-sdk.es75.js +90 -3
- package/dist/es/standards-sdk.es75.js.map +1 -1
- package/dist/es/standards-sdk.es76.js +194 -3
- package/dist/es/standards-sdk.es76.js.map +1 -1
- package/dist/es/standards-sdk.es77.js +436 -14
- package/dist/es/standards-sdk.es77.js.map +1 -1
- package/dist/es/standards-sdk.es78.js +24 -4
- package/dist/es/standards-sdk.es78.js.map +1 -1
- package/dist/es/standards-sdk.es79.js +139 -39
- package/dist/es/standards-sdk.es79.js.map +1 -1
- package/dist/es/standards-sdk.es8.js +1 -1
- package/dist/es/standards-sdk.es80.js +15 -37
- package/dist/es/standards-sdk.es80.js.map +1 -1
- package/dist/es/standards-sdk.es81.js +28 -36
- package/dist/es/standards-sdk.es81.js.map +1 -1
- package/dist/es/standards-sdk.es82.js +25 -74
- package/dist/es/standards-sdk.es82.js.map +1 -1
- package/dist/es/standards-sdk.es83.js +21 -2
- package/dist/es/standards-sdk.es83.js.map +1 -1
- package/dist/es/standards-sdk.es84.js +44 -3
- package/dist/es/standards-sdk.es84.js.map +1 -1
- package/dist/es/standards-sdk.es85.js +18 -2
- package/dist/es/standards-sdk.es85.js.map +1 -1
- package/dist/es/standards-sdk.es86.js +61 -2
- package/dist/es/standards-sdk.es86.js.map +1 -1
- package/dist/es/standards-sdk.es87.js +1287 -32
- package/dist/es/standards-sdk.es87.js.map +1 -1
- package/dist/es/standards-sdk.es88.js +29 -30
- package/dist/es/standards-sdk.es88.js.map +1 -1
- package/dist/es/standards-sdk.es89.js +6 -9
- package/dist/es/standards-sdk.es89.js.map +1 -1
- package/dist/es/standards-sdk.es9.js +1 -1
- package/dist/es/standards-sdk.es90.js +155 -30
- package/dist/es/standards-sdk.es90.js.map +1 -1
- package/dist/es/standards-sdk.es91.js +766 -168
- package/dist/es/standards-sdk.es91.js.map +1 -1
- package/dist/es/standards-sdk.es92.js +125 -420
- package/dist/es/standards-sdk.es92.js.map +1 -1
- package/dist/es/standards-sdk.es93.js +170 -21
- package/dist/es/standards-sdk.es93.js.map +1 -1
- package/dist/es/standards-sdk.es94.js +13 -139
- package/dist/es/standards-sdk.es94.js.map +1 -1
- package/dist/es/standards-sdk.es95.js +13 -18
- package/dist/es/standards-sdk.es95.js.map +1 -1
- package/dist/es/standards-sdk.es96.js +30 -27
- package/dist/es/standards-sdk.es96.js.map +1 -1
- package/dist/es/standards-sdk.es97.js +14 -28
- package/dist/es/standards-sdk.es97.js.map +1 -1
- package/dist/es/standards-sdk.es98.js +3 -20
- package/dist/es/standards-sdk.es98.js.map +1 -1
- package/dist/es/standards-sdk.es99.js +3 -43
- package/dist/es/standards-sdk.es99.js.map +1 -1
- package/dist/umd/standards-sdk.umd.js +1 -1
- package/dist/umd/standards-sdk.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es91.js","sources":["../../node_modules/ethers/lib.esm/abi/abi-coder.js"],"sourcesContent":["/**\n * When sending values to or receiving values from a [[Contract]], the\n * data is generally encoded using the [ABI standard](link-solc-abi).\n *\n * The AbiCoder provides a utility to encode values to ABI data and\n * decode values from ABI data.\n *\n * Most of the time, developers should favour the [[Contract]] class,\n * which further abstracts a lot of the finer details of ABI data.\n *\n * @_section api/abi/abi-coder:ABI Encoding\n */\n// See: https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI\nimport { assertArgumentCount, assertArgument } from \"../utils/index.js\";\nimport { Reader, Writer } from \"./coders/abstract-coder.js\";\nimport { AddressCoder } from \"./coders/address.js\";\nimport { ArrayCoder } from \"./coders/array.js\";\nimport { BooleanCoder } from \"./coders/boolean.js\";\nimport { BytesCoder } from \"./coders/bytes.js\";\nimport { FixedBytesCoder } from \"./coders/fixed-bytes.js\";\nimport { NullCoder } from \"./coders/null.js\";\nimport { NumberCoder } from \"./coders/number.js\";\nimport { StringCoder } from \"./coders/string.js\";\nimport { TupleCoder } from \"./coders/tuple.js\";\nimport { ParamType } from \"./fragments.js\";\nimport { getAddress } from \"../address/index.js\";\nimport { getBytes, hexlify, makeError } from \"../utils/index.js\";\n// https://docs.soliditylang.org/en/v0.8.17/control-structures.html\nconst PanicReasons = new Map();\nPanicReasons.set(0x00, \"GENERIC_PANIC\");\nPanicReasons.set(0x01, \"ASSERT_FALSE\");\nPanicReasons.set(0x11, \"OVERFLOW\");\nPanicReasons.set(0x12, \"DIVIDE_BY_ZERO\");\nPanicReasons.set(0x21, \"ENUM_RANGE_ERROR\");\nPanicReasons.set(0x22, \"BAD_STORAGE_DATA\");\nPanicReasons.set(0x31, \"STACK_UNDERFLOW\");\nPanicReasons.set(0x32, \"ARRAY_RANGE_ERROR\");\nPanicReasons.set(0x41, \"OUT_OF_MEMORY\");\nPanicReasons.set(0x51, \"UNINITIALIZED_FUNCTION_CALL\");\nconst paramTypeBytes = new RegExp(/^bytes([0-9]*)$/);\nconst paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/);\nlet defaultCoder = null;\nlet defaultMaxInflation = 1024;\nfunction getBuiltinCallException(action, tx, data, abiCoder) {\n let message = \"missing revert data\";\n let reason = null;\n const invocation = null;\n let revert = null;\n if (data) {\n message = \"execution reverted\";\n const bytes = getBytes(data);\n data = hexlify(data);\n if (bytes.length === 0) {\n message += \" (no data present; likely require(false) occurred\";\n reason = \"require(false)\";\n }\n else if (bytes.length % 32 !== 4) {\n message += \" (could not decode reason; invalid data length)\";\n }\n else if (hexlify(bytes.slice(0, 4)) === \"0x08c379a0\") {\n // Error(string)\n try {\n reason = abiCoder.decode([\"string\"], bytes.slice(4))[0];\n revert = {\n signature: \"Error(string)\",\n name: \"Error\",\n args: [reason]\n };\n message += `: ${JSON.stringify(reason)}`;\n }\n catch (error) {\n message += \" (could not decode reason; invalid string data)\";\n }\n }\n else if (hexlify(bytes.slice(0, 4)) === \"0x4e487b71\") {\n // Panic(uint256)\n try {\n const code = Number(abiCoder.decode([\"uint256\"], bytes.slice(4))[0]);\n revert = {\n signature: \"Panic(uint256)\",\n name: \"Panic\",\n args: [code]\n };\n reason = `Panic due to ${PanicReasons.get(code) || \"UNKNOWN\"}(${code})`;\n message += `: ${reason}`;\n }\n catch (error) {\n message += \" (could not decode panic code)\";\n }\n }\n else {\n message += \" (unknown custom error)\";\n }\n }\n const transaction = {\n to: (tx.to ? getAddress(tx.to) : null),\n data: (tx.data || \"0x\")\n };\n if (tx.from) {\n transaction.from = getAddress(tx.from);\n }\n return makeError(message, \"CALL_EXCEPTION\", {\n action, data, reason, transaction, invocation, revert\n });\n}\n/**\n * The **AbiCoder** is a low-level class responsible for encoding JavaScript\n * values into binary data and decoding binary data into JavaScript values.\n */\nexport class AbiCoder {\n #getCoder(param) {\n if (param.isArray()) {\n return new ArrayCoder(this.#getCoder(param.arrayChildren), param.arrayLength, param.name);\n }\n if (param.isTuple()) {\n return new TupleCoder(param.components.map((c) => this.#getCoder(c)), param.name);\n }\n switch (param.baseType) {\n case \"address\":\n return new AddressCoder(param.name);\n case \"bool\":\n return new BooleanCoder(param.name);\n case \"string\":\n return new StringCoder(param.name);\n case \"bytes\":\n return new BytesCoder(param.name);\n case \"\":\n return new NullCoder(param.name);\n }\n // u?int[0-9]*\n let match = param.type.match(paramTypeNumber);\n if (match) {\n let size = parseInt(match[2] || \"256\");\n assertArgument(size !== 0 && size <= 256 && (size % 8) === 0, \"invalid \" + match[1] + \" bit length\", \"param\", param);\n return new NumberCoder(size / 8, (match[1] === \"int\"), param.name);\n }\n // bytes[0-9]+\n match = param.type.match(paramTypeBytes);\n if (match) {\n let size = parseInt(match[1]);\n assertArgument(size !== 0 && size <= 32, \"invalid bytes length\", \"param\", param);\n return new FixedBytesCoder(size, param.name);\n }\n assertArgument(false, \"invalid type\", \"type\", param.type);\n }\n /**\n * Get the default values for the given %%types%%.\n *\n * For example, a ``uint`` is by default ``0`` and ``bool``\n * is by default ``false``.\n */\n getDefaultValue(types) {\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.defaultValue();\n }\n /**\n * Encode the %%values%% as the %%types%% into ABI data.\n *\n * @returns DataHexstring\n */\n encode(types, values) {\n assertArgumentCount(values.length, types.length, \"types/values length mismatch\");\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = (new TupleCoder(coders, \"_\"));\n const writer = new Writer();\n coder.encode(writer, values);\n return writer.data;\n }\n /**\n * Decode the ABI %%data%% as the %%types%% into values.\n *\n * If %%loose%% decoding is enabled, then strict padding is\n * not enforced. Some older versions of Solidity incorrectly\n * padded event data emitted from ``external`` functions.\n */\n decode(types, data, loose) {\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.decode(new Reader(data, loose, defaultMaxInflation));\n }\n static _setDefaultMaxInflation(value) {\n assertArgument(typeof (value) === \"number\" && Number.isInteger(value), \"invalid defaultMaxInflation factor\", \"value\", value);\n defaultMaxInflation = value;\n }\n /**\n * Returns the shared singleton instance of a default [[AbiCoder]].\n *\n * On the first call, the instance is created internally.\n */\n static defaultAbiCoder() {\n if (defaultCoder == null) {\n defaultCoder = new AbiCoder();\n }\n return defaultCoder;\n }\n /**\n * Returns an ethers-compatible [[CallExceptionError]] Error for the given\n * result %%data%% for the [[CallExceptionAction]] %%action%% against\n * the Transaction %%tx%%.\n */\n static getBuiltinCallException(action, tx, data) {\n return getBuiltinCallException(action, tx, data, AbiCoder.defaultAbiCoder());\n }\n}\n//# sourceMappingURL=abi-coder.js.map"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AA4BA,MAAM,eAAe,oBAAI,IAAK;AAC9B,aAAa,IAAI,GAAM,eAAe;AACtC,aAAa,IAAI,GAAM,cAAc;AACrC,aAAa,IAAI,IAAM,UAAU;AACjC,aAAa,IAAI,IAAM,gBAAgB;AACvC,aAAa,IAAI,IAAM,kBAAkB;AACzC,aAAa,IAAI,IAAM,kBAAkB;AACzC,aAAa,IAAI,IAAM,iBAAiB;AACxC,aAAa,IAAI,IAAM,mBAAmB;AAC1C,aAAa,IAAI,IAAM,eAAe;AACtC,aAAa,IAAI,IAAM,6BAA6B;AACpD,MAAM,iBAAiB,IAAI,OAAO,iBAAiB;AACnD,MAAM,kBAAkB,IAAI,OAAO,mBAAmB;AACtD,IAAI,eAAe;AACnB,IAAI,sBAAsB;AAC1B,SAAS,wBAAwB,QAAQ,IAAI,MAAM,UAAU;AACzD,MAAI,UAAU;AACd,MAAI,SAAS;AACb,QAAM,aAAa;AACnB,MAAI,SAAS;AACb,MAAI,MAAM;AACN,cAAU;AACV,UAAM,QAAQ,SAAS,IAAI;AAC3B,WAAO,QAAQ,IAAI;AACnB,QAAI,MAAM,WAAW,GAAG;AACpB,iBAAW;AACX,eAAS;AAAA,IACrB,WACiB,MAAM,SAAS,OAAO,GAAG;AAC9B,iBAAW;AAAA,IACvB,WACiB,QAAQ,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,cAAc;AAElD,UAAI;AACA,iBAAS,SAAS,OAAO,CAAC,QAAQ,GAAG,MAAM,MA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MAAM,WAAW;AACjB,WAAO,IAAI,WAAW,MAAM,WAAW,IAAI,CAAC,MAAM,sBAAK,kCAAL,WAAe,EAAE,GAAG,MAAM,IAAI;AAAA,EAC5F;AACQ,UAAQ,MAAM,UAAQ;AAAA,IAClB,KAAK;AACD,aAAO,IAAI,aAAa,MAAM,IAAI;AAAA,IACtC,KAAK;AACD,aAAO,IAAI,aAAa,MAAM,IAAI;AAAA,IACtC,KAAK;AACD,aAAO,IAAI,YAAY,MAAM,IAAI;AAAA,IACrC,KAAK;AACD,aAAO,IAAI,WAAW,MAAM,IAAI;AAAA,IACpC,KAAK;AACD,aAAO,IAAI,UAAU,MAAM,IAAI;AAAA,EAC/C;AAEQ,MAAI,QAAQ,MAAM,KAAK,MAAM,eAAe;AAC5C,MAAI,OAAO;AACP,QAAI,OAAO,SAAS,MAAM,CAAC,KAAK,KAAK;AACrC,mBAAe,SAAS,KAAK,QAAQ,OAAQ,OAAO,MAAO,GAAG,aAAa,MAAM,CAAC,IAAI,eAAe,SAAS,KAAK;AACnH,WAAO,IAAI,YAAY,OAAO,GAAI,MAAM,CAAC,MAAM,OAAQ,MAAM,IAAI;AAAA,EAC7E;AAEQ,UAAQ,MAAM,KAAK,MAAM,cAAc;AACvC,MAAI,OAAO;AACP,QAAI,OAAO,SAAS,MAAM,CAAC,CAAC;AAC5B,mBAAe,SAAS,KAAK,QAAQ,IAAI,wBAAwB,SAAS,KAAK;AAC/E,WAAO,IAAI,gBAAgB,MAAM,MAAM,IAAI;AAAA,EACvD;AACQ,iBAAe,OAAO,gBAAgB,QAAQ,MAAM,IAAI;AAChE;AAnCO,IAAM,WAAN;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"standards-sdk.es91.js","sources":["../../node_modules/ethers/lib.esm/abi/typed.js"],"sourcesContent":["/**\n * A Typed object allows a value to have its type explicitly\n * specified.\n *\n * For example, in Solidity, the value ``45`` could represent a\n * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent\n * a ``bytes2`` or ``bytes``.\n *\n * Since JavaScript has no meaningful way to explicitly inform any\n * APIs which what the type is, this allows transparent interoperation\n * with Soldity.\n *\n * @_subsection: api/abi:Typed Values\n */\nimport { assertPrivate, defineProperties } from \"../utils/index.js\";\nconst _gaurd = {};\nfunction n(value, width) {\n let signed = false;\n if (width < 0) {\n signed = true;\n width *= -1;\n }\n // @TODO: Check range is valid for value\n return new Typed(_gaurd, `${signed ? \"\" : \"u\"}int${width}`, value, { signed, width });\n}\nfunction b(value, size) {\n // @TODO: Check range is valid for value\n return new Typed(_gaurd, `bytes${(size) ? size : \"\"}`, value, { size });\n}\nconst _typedSymbol = Symbol.for(\"_ethers_typed\");\n/**\n * The **Typed** class to wrap values providing explicit type information.\n */\nexport class Typed {\n /**\n * The type, as a Solidity-compatible type.\n */\n type;\n /**\n * The actual value.\n */\n value;\n #options;\n /**\n * @_ignore:\n */\n _typedSymbol;\n /**\n * @_ignore:\n */\n constructor(gaurd, type, value, options) {\n if (options == null) {\n options = null;\n }\n assertPrivate(_gaurd, gaurd, \"Typed\");\n defineProperties(this, { _typedSymbol, type, value });\n this.#options = options;\n // Check the value is valid\n this.format();\n }\n /**\n * Format the type as a Human-Readable type.\n */\n format() {\n if (this.type === \"array\") {\n throw new Error(\"\");\n }\n else if (this.type === \"dynamicArray\") {\n throw new Error(\"\");\n }\n else if (this.type === \"tuple\") {\n return `tuple(${this.value.map((v) => v.format()).join(\",\")})`;\n }\n return this.type;\n }\n /**\n * The default value returned by this type.\n */\n defaultValue() {\n return 0;\n }\n /**\n * The minimum value for numeric types.\n */\n minValue() {\n return 0;\n }\n /**\n * The maximum value for numeric types.\n */\n maxValue() {\n return 0;\n }\n /**\n * Returns ``true`` and provides a type guard is this is a [[TypedBigInt]].\n */\n isBigInt() {\n return !!(this.type.match(/^u?int[0-9]+$/));\n }\n /**\n * Returns ``true`` and provides a type guard is this is a [[TypedData]].\n */\n isData() {\n return this.type.startsWith(\"bytes\");\n }\n /**\n * Returns ``true`` and provides a type guard is this is a [[TypedString]].\n */\n isString() {\n return (this.type === \"string\");\n }\n /**\n * Returns the tuple name, if this is a tuple. Throws otherwise.\n */\n get tupleName() {\n if (this.type !== \"tuple\") {\n throw TypeError(\"not a tuple\");\n }\n return this.#options;\n }\n // Returns the length of this type as an array\n // - `null` indicates the length is unforced, it could be dynamic\n // - `-1` indicates the length is dynamic\n // - any other value indicates it is a static array and is its length\n /**\n * Returns the length of the array type or ``-1`` if it is dynamic.\n *\n * Throws if the type is not an array.\n */\n get arrayLength() {\n if (this.type !== \"array\") {\n throw TypeError(\"not an array\");\n }\n if (this.#options === true) {\n return -1;\n }\n if (this.#options === false) {\n return (this.value).length;\n }\n return null;\n }\n /**\n * Returns a new **Typed** of %%type%% with the %%value%%.\n */\n static from(type, value) {\n return new Typed(_gaurd, type, value);\n }\n /**\n * Return a new ``uint8`` type for %%v%%.\n */\n static uint8(v) { return n(v, 8); }\n /**\n * Return a new ``uint16`` type for %%v%%.\n */\n static uint16(v) { return n(v, 16); }\n /**\n * Return a new ``uint24`` type for %%v%%.\n */\n static uint24(v) { return n(v, 24); }\n /**\n * Return a new ``uint32`` type for %%v%%.\n */\n static uint32(v) { return n(v, 32); }\n /**\n * Return a new ``uint40`` type for %%v%%.\n */\n static uint40(v) { return n(v, 40); }\n /**\n * Return a new ``uint48`` type for %%v%%.\n */\n static uint48(v) { return n(v, 48); }\n /**\n * Return a new ``uint56`` type for %%v%%.\n */\n static uint56(v) { return n(v, 56); }\n /**\n * Return a new ``uint64`` type for %%v%%.\n */\n static uint64(v) { return n(v, 64); }\n /**\n * Return a new ``uint72`` type for %%v%%.\n */\n static uint72(v) { return n(v, 72); }\n /**\n * Return a new ``uint80`` type for %%v%%.\n */\n static uint80(v) { return n(v, 80); }\n /**\n * Return a new ``uint88`` type for %%v%%.\n */\n static uint88(v) { return n(v, 88); }\n /**\n * Return a new ``uint96`` type for %%v%%.\n */\n static uint96(v) { return n(v, 96); }\n /**\n * Return a new ``uint104`` type for %%v%%.\n */\n static uint104(v) { return n(v, 104); }\n /**\n * Return a new ``uint112`` type for %%v%%.\n */\n static uint112(v) { return n(v, 112); }\n /**\n * Return a new ``uint120`` type for %%v%%.\n */\n static uint120(v) { return n(v, 120); }\n /**\n * Return a new ``uint128`` type for %%v%%.\n */\n static uint128(v) { return n(v, 128); }\n /**\n * Return a new ``uint136`` type for %%v%%.\n */\n static uint136(v) { return n(v, 136); }\n /**\n * Return a new ``uint144`` type for %%v%%.\n */\n static uint144(v) { return n(v, 144); }\n /**\n * Return a new ``uint152`` type for %%v%%.\n */\n static uint152(v) { return n(v, 152); }\n /**\n * Return a new ``uint160`` type for %%v%%.\n */\n static uint160(v) { return n(v, 160); }\n /**\n * Return a new ``uint168`` type for %%v%%.\n */\n static uint168(v) { return n(v, 168); }\n /**\n * Return a new ``uint176`` type for %%v%%.\n */\n static uint176(v) { return n(v, 176); }\n /**\n * Return a new ``uint184`` type for %%v%%.\n */\n static uint184(v) { return n(v, 184); }\n /**\n * Return a new ``uint192`` type for %%v%%.\n */\n static uint192(v) { return n(v, 192); }\n /**\n * Return a new ``uint200`` type for %%v%%.\n */\n static uint200(v) { return n(v, 200); }\n /**\n * Return a new ``uint208`` type for %%v%%.\n */\n static uint208(v) { return n(v, 208); }\n /**\n * Return a new ``uint216`` type for %%v%%.\n */\n static uint216(v) { return n(v, 216); }\n /**\n * Return a new ``uint224`` type for %%v%%.\n */\n static uint224(v) { return n(v, 224); }\n /**\n * Return a new ``uint232`` type for %%v%%.\n */\n static uint232(v) { return n(v, 232); }\n /**\n * Return a new ``uint240`` type for %%v%%.\n */\n static uint240(v) { return n(v, 240); }\n /**\n * Return a new ``uint248`` type for %%v%%.\n */\n static uint248(v) { return n(v, 248); }\n /**\n * Return a new ``uint256`` type for %%v%%.\n */\n static uint256(v) { return n(v, 256); }\n /**\n * Return a new ``uint256`` type for %%v%%.\n */\n static uint(v) { return n(v, 256); }\n /**\n * Return a new ``int8`` type for %%v%%.\n */\n static int8(v) { return n(v, -8); }\n /**\n * Return a new ``int16`` type for %%v%%.\n */\n static int16(v) { return n(v, -16); }\n /**\n * Return a new ``int24`` type for %%v%%.\n */\n static int24(v) { return n(v, -24); }\n /**\n * Return a new ``int32`` type for %%v%%.\n */\n static int32(v) { return n(v, -32); }\n /**\n * Return a new ``int40`` type for %%v%%.\n */\n static int40(v) { return n(v, -40); }\n /**\n * Return a new ``int48`` type for %%v%%.\n */\n static int48(v) { return n(v, -48); }\n /**\n * Return a new ``int56`` type for %%v%%.\n */\n static int56(v) { return n(v, -56); }\n /**\n * Return a new ``int64`` type for %%v%%.\n */\n static int64(v) { return n(v, -64); }\n /**\n * Return a new ``int72`` type for %%v%%.\n */\n static int72(v) { return n(v, -72); }\n /**\n * Return a new ``int80`` type for %%v%%.\n */\n static int80(v) { return n(v, -80); }\n /**\n * Return a new ``int88`` type for %%v%%.\n */\n static int88(v) { return n(v, -88); }\n /**\n * Return a new ``int96`` type for %%v%%.\n */\n static int96(v) { return n(v, -96); }\n /**\n * Return a new ``int104`` type for %%v%%.\n */\n static int104(v) { return n(v, -104); }\n /**\n * Return a new ``int112`` type for %%v%%.\n */\n static int112(v) { return n(v, -112); }\n /**\n * Return a new ``int120`` type for %%v%%.\n */\n static int120(v) { return n(v, -120); }\n /**\n * Return a new ``int128`` type for %%v%%.\n */\n static int128(v) { return n(v, -128); }\n /**\n * Return a new ``int136`` type for %%v%%.\n */\n static int136(v) { return n(v, -136); }\n /**\n * Return a new ``int144`` type for %%v%%.\n */\n static int144(v) { return n(v, -144); }\n /**\n * Return a new ``int52`` type for %%v%%.\n */\n static int152(v) { return n(v, -152); }\n /**\n * Return a new ``int160`` type for %%v%%.\n */\n static int160(v) { return n(v, -160); }\n /**\n * Return a new ``int168`` type for %%v%%.\n */\n static int168(v) { return n(v, -168); }\n /**\n * Return a new ``int176`` type for %%v%%.\n */\n static int176(v) { return n(v, -176); }\n /**\n * Return a new ``int184`` type for %%v%%.\n */\n static int184(v) { return n(v, -184); }\n /**\n * Return a new ``int92`` type for %%v%%.\n */\n static int192(v) { return n(v, -192); }\n /**\n * Return a new ``int200`` type for %%v%%.\n */\n static int200(v) { return n(v, -200); }\n /**\n * Return a new ``int208`` type for %%v%%.\n */\n static int208(v) { return n(v, -208); }\n /**\n * Return a new ``int216`` type for %%v%%.\n */\n static int216(v) { return n(v, -216); }\n /**\n * Return a new ``int224`` type for %%v%%.\n */\n static int224(v) { return n(v, -224); }\n /**\n * Return a new ``int232`` type for %%v%%.\n */\n static int232(v) { return n(v, -232); }\n /**\n * Return a new ``int240`` type for %%v%%.\n */\n static int240(v) { return n(v, -240); }\n /**\n * Return a new ``int248`` type for %%v%%.\n */\n static int248(v) { return n(v, -248); }\n /**\n * Return a new ``int256`` type for %%v%%.\n */\n static int256(v) { return n(v, -256); }\n /**\n * Return a new ``int256`` type for %%v%%.\n */\n static int(v) { return n(v, -256); }\n /**\n * Return a new ``bytes1`` type for %%v%%.\n */\n static bytes1(v) { return b(v, 1); }\n /**\n * Return a new ``bytes2`` type for %%v%%.\n */\n static bytes2(v) { return b(v, 2); }\n /**\n * Return a new ``bytes3`` type for %%v%%.\n */\n static bytes3(v) { return b(v, 3); }\n /**\n * Return a new ``bytes4`` type for %%v%%.\n */\n static bytes4(v) { return b(v, 4); }\n /**\n * Return a new ``bytes5`` type for %%v%%.\n */\n static bytes5(v) { return b(v, 5); }\n /**\n * Return a new ``bytes6`` type for %%v%%.\n */\n static bytes6(v) { return b(v, 6); }\n /**\n * Return a new ``bytes7`` type for %%v%%.\n */\n static bytes7(v) { return b(v, 7); }\n /**\n * Return a new ``bytes8`` type for %%v%%.\n */\n static bytes8(v) { return b(v, 8); }\n /**\n * Return a new ``bytes9`` type for %%v%%.\n */\n static bytes9(v) { return b(v, 9); }\n /**\n * Return a new ``bytes10`` type for %%v%%.\n */\n static bytes10(v) { return b(v, 10); }\n /**\n * Return a new ``bytes11`` type for %%v%%.\n */\n static bytes11(v) { return b(v, 11); }\n /**\n * Return a new ``bytes12`` type for %%v%%.\n */\n static bytes12(v) { return b(v, 12); }\n /**\n * Return a new ``bytes13`` type for %%v%%.\n */\n static bytes13(v) { return b(v, 13); }\n /**\n * Return a new ``bytes14`` type for %%v%%.\n */\n static bytes14(v) { return b(v, 14); }\n /**\n * Return a new ``bytes15`` type for %%v%%.\n */\n static bytes15(v) { return b(v, 15); }\n /**\n * Return a new ``bytes16`` type for %%v%%.\n */\n static bytes16(v) { return b(v, 16); }\n /**\n * Return a new ``bytes17`` type for %%v%%.\n */\n static bytes17(v) { return b(v, 17); }\n /**\n * Return a new ``bytes18`` type for %%v%%.\n */\n static bytes18(v) { return b(v, 18); }\n /**\n * Return a new ``bytes19`` type for %%v%%.\n */\n static bytes19(v) { return b(v, 19); }\n /**\n * Return a new ``bytes20`` type for %%v%%.\n */\n static bytes20(v) { return b(v, 20); }\n /**\n * Return a new ``bytes21`` type for %%v%%.\n */\n static bytes21(v) { return b(v, 21); }\n /**\n * Return a new ``bytes22`` type for %%v%%.\n */\n static bytes22(v) { return b(v, 22); }\n /**\n * Return a new ``bytes23`` type for %%v%%.\n */\n static bytes23(v) { return b(v, 23); }\n /**\n * Return a new ``bytes24`` type for %%v%%.\n */\n static bytes24(v) { return b(v, 24); }\n /**\n * Return a new ``bytes25`` type for %%v%%.\n */\n static bytes25(v) { return b(v, 25); }\n /**\n * Return a new ``bytes26`` type for %%v%%.\n */\n static bytes26(v) { return b(v, 26); }\n /**\n * Return a new ``bytes27`` type for %%v%%.\n */\n static bytes27(v) { return b(v, 27); }\n /**\n * Return a new ``bytes28`` type for %%v%%.\n */\n static bytes28(v) { return b(v, 28); }\n /**\n * Return a new ``bytes29`` type for %%v%%.\n */\n static bytes29(v) { return b(v, 29); }\n /**\n * Return a new ``bytes30`` type for %%v%%.\n */\n static bytes30(v) { return b(v, 30); }\n /**\n * Return a new ``bytes31`` type for %%v%%.\n */\n static bytes31(v) { return b(v, 31); }\n /**\n * Return a new ``bytes32`` type for %%v%%.\n */\n static bytes32(v) { return b(v, 32); }\n /**\n * Return a new ``address`` type for %%v%%.\n */\n static address(v) { return new Typed(_gaurd, \"address\", v); }\n /**\n * Return a new ``bool`` type for %%v%%.\n */\n static bool(v) { return new Typed(_gaurd, \"bool\", !!v); }\n /**\n * Return a new ``bytes`` type for %%v%%.\n */\n static bytes(v) { return new Typed(_gaurd, \"bytes\", v); }\n /**\n * Return a new ``string`` type for %%v%%.\n */\n static string(v) { return new Typed(_gaurd, \"string\", v); }\n /**\n * Return a new ``array`` type for %%v%%, allowing %%dynamic%% length.\n */\n static array(v, dynamic) {\n throw new Error(\"not implemented yet\");\n return new Typed(_gaurd, \"array\", v, dynamic);\n }\n /**\n * Return a new ``tuple`` type for %%v%%, with the optional %%name%%.\n */\n static tuple(v, name) {\n throw new Error(\"not implemented yet\");\n return new Typed(_gaurd, \"tuple\", v, name);\n }\n /**\n * Return a new ``uint8`` type for %%v%%.\n */\n static overrides(v) {\n return new Typed(_gaurd, \"overrides\", Object.assign({}, v));\n }\n /**\n * Returns true only if %%value%% is a [[Typed]] instance.\n */\n static isTyped(value) {\n return (value\n && typeof (value) === \"object\"\n && \"_typedSymbol\" in value\n && value._typedSymbol === _typedSymbol);\n }\n /**\n * If the value is a [[Typed]] instance, validates the underlying value\n * and returns it, otherwise returns value directly.\n *\n * This is useful for functions that with to accept either a [[Typed]]\n * object or values.\n */\n static dereference(value, type) {\n if (Typed.isTyped(value)) {\n if (value.type !== type) {\n throw new Error(`invalid type: expecetd ${type}, got ${value.type}`);\n }\n return value.value;\n }\n return value;\n }\n}\n//# sourceMappingURL=typed.js.map"],"names":[],"mappings":";;;;;;;;;;;;;AAeA,MAAM,SAAS,CAAE;AACjB,SAAS,EAAE,OAAO,OAAO;AACrB,MAAI,SAAS;AACb,MAAI,QAAQ,GAAG;AACX,aAAS;AACT,aAAS;AAAA,EACjB;AAEI,SAAO,IAAI,MAAM,QAAQ,GAAG,SAAS,KAAK,GAAG,MAAM,KAAK,IAAI,OAAO,EAAE,QAAQ,MAAK,CA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I,OAAM,QAAQ,SAAS,CAAC;AAAA,EAAE;AAAA;AAAA;AAAA;AAAA,EAIvD,OAAO,OAAO,GAAG;AAAE,WAAO,IAAI,OAAM,QAAQ,UAAU,CAAC;AAAA,EAAE;AAAA;AAAA;AAAA;AAAA,EAIzD,OAAO,MAAM,GAAG,SAAS;AACrB,UAAM,IAAI,MAAM,qBAAqB;AAAA,EAE7C;AAAA;AAAA;AAAA;AAAA,EAII,OAAO,MAAM,GAAG,MAAM;AAClB,UAAM,IAAI,MAAM,qBAAqB;AAAA,EAE7C;AAAA;AAAA;AAAA;AAAA,EAII,OAAO,UAAU,GAAG;AAChB,WAAO,IAAI,OAAM,QAAQ,aAAa,OAAO,OAAO,CAAA,GAAI,CAAC,CAAC;AAAA,EAClE;AAAA;AAAA;AAAA;AAAA,EAII,OAAO,QAAQ,OAAO;AAClB,WAAQ,SACD,OAAQ,UAAW,YACnB,kBAAkB,SAClB,MAAM,iBAAiB;AAAA,EACtC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQI,OAAO,YAAY,OAAO,MAAM;AAC5B,QAAI,OAAM,QAAQ,KAAK,GAAG;AACtB,UAAI,MAAM,SAAS,MAAM;AACrB,cAAM,IAAI,MAAM,0BAA0B,IAAI,SAAS,MAAM,IAAI,EAAE;AAAA,MACnF;AACY,aAAO,MAAM;AAAA,IACzB;AACQ,WAAO;AAAA,EACf;AACA;AA9iBI;AATG,IAAM,QAAN;","x_google_ignoreList":[0]}
|
|
@@ -1,441 +1,146 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
7
|
-
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
8
|
-
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
9
|
-
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10
|
-
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
11
|
-
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
12
|
-
var _names, _data, _dataLength, _Writer_instances, writeData_fn, _data2, _offset, _bytesRead, _parent, _maxInflation, _Reader_instances, incrementBytesRead_fn, peekBytes_fn;
|
|
13
|
-
import { getNumber, toBigInt, toNumber, toBeArray } from "./standards-sdk.es108.js";
|
|
14
|
-
import { assert, assertArgument } from "./standards-sdk.es103.js";
|
|
15
|
-
import { concat, getBytesCopy, hexlify } from "./standards-sdk.es104.js";
|
|
16
|
-
import { defineProperties } from "./standards-sdk.es106.js";
|
|
17
|
-
const WordSize = 32;
|
|
18
|
-
const Padding = new Uint8Array(WordSize);
|
|
19
|
-
const passProperties = ["then"];
|
|
20
|
-
const _guard = {};
|
|
21
|
-
const resultNames = /* @__PURE__ */ new WeakMap();
|
|
22
|
-
function getNames(result) {
|
|
23
|
-
return resultNames.get(result);
|
|
24
|
-
}
|
|
25
|
-
function setNames(result, names) {
|
|
26
|
-
resultNames.set(result, names);
|
|
1
|
+
import { getBytes } from "./standards-sdk.es75.js";
|
|
2
|
+
import { assertArgument } from "./standards-sdk.es74.js";
|
|
3
|
+
function errorFunc(reason, offset, bytes, output, badCodepoint) {
|
|
4
|
+
assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, "bytes", bytes);
|
|
27
5
|
}
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (names.indexOf(null) >= 0) {
|
|
35
|
-
return items.map((item, index) => {
|
|
36
|
-
if (item instanceof Result) {
|
|
37
|
-
return toObject(getNames(item), item, deep);
|
|
38
|
-
}
|
|
39
|
-
return item;
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
return names.reduce((accum, name, index) => {
|
|
43
|
-
let item = items.getValue(name);
|
|
44
|
-
if (!(name in accum)) {
|
|
45
|
-
if (deep && item instanceof Result) {
|
|
46
|
-
item = toObject(getNames(item), item, deep);
|
|
6
|
+
function ignoreFunc(reason, offset, bytes, output, badCodepoint) {
|
|
7
|
+
if (reason === "BAD_PREFIX" || reason === "UNEXPECTED_CONTINUE") {
|
|
8
|
+
let i = 0;
|
|
9
|
+
for (let o = offset + 1; o < bytes.length; o++) {
|
|
10
|
+
if (bytes[o] >> 6 !== 2) {
|
|
11
|
+
break;
|
|
47
12
|
}
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
return accum;
|
|
51
|
-
}, {});
|
|
52
|
-
}
|
|
53
|
-
const _Result = class _Result extends Array {
|
|
54
|
-
/**
|
|
55
|
-
* @private
|
|
56
|
-
*/
|
|
57
|
-
constructor(...args) {
|
|
58
|
-
const guard = args[0];
|
|
59
|
-
let items = args[1];
|
|
60
|
-
let names = (args[2] || []).slice();
|
|
61
|
-
let wrap = true;
|
|
62
|
-
if (guard !== _guard) {
|
|
63
|
-
items = args;
|
|
64
|
-
names = [];
|
|
65
|
-
wrap = false;
|
|
13
|
+
i++;
|
|
66
14
|
}
|
|
67
|
-
|
|
68
|
-
// No longer used; but cannot be removed as it will remove the
|
|
69
|
-
// #private field from the .d.ts which may break backwards
|
|
70
|
-
// compatibility
|
|
71
|
-
__privateAdd(this, _names);
|
|
72
|
-
items.forEach((item, index) => {
|
|
73
|
-
this[index] = item;
|
|
74
|
-
});
|
|
75
|
-
const nameCounts = names.reduce((accum, name) => {
|
|
76
|
-
if (typeof name === "string") {
|
|
77
|
-
accum.set(name, (accum.get(name) || 0) + 1);
|
|
78
|
-
}
|
|
79
|
-
return accum;
|
|
80
|
-
}, /* @__PURE__ */ new Map());
|
|
81
|
-
setNames(this, Object.freeze(items.map((item, index) => {
|
|
82
|
-
const name = names[index];
|
|
83
|
-
if (name != null && nameCounts.get(name) === 1) {
|
|
84
|
-
return name;
|
|
85
|
-
}
|
|
86
|
-
return null;
|
|
87
|
-
})));
|
|
88
|
-
__privateSet(this, _names, []);
|
|
89
|
-
if (__privateGet(this, _names) == null) {
|
|
90
|
-
void __privateGet(this, _names);
|
|
91
|
-
}
|
|
92
|
-
if (!wrap) {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
Object.freeze(this);
|
|
96
|
-
const proxy = new Proxy(this, {
|
|
97
|
-
get: (target, prop, receiver) => {
|
|
98
|
-
if (typeof prop === "string") {
|
|
99
|
-
if (prop.match(/^[0-9]+$/)) {
|
|
100
|
-
const index = getNumber(prop, "%index");
|
|
101
|
-
if (index < 0 || index >= this.length) {
|
|
102
|
-
throw new RangeError("out of result range");
|
|
103
|
-
}
|
|
104
|
-
const item = target[index];
|
|
105
|
-
if (item instanceof Error) {
|
|
106
|
-
throwError(`index ${index}`, item);
|
|
107
|
-
}
|
|
108
|
-
return item;
|
|
109
|
-
}
|
|
110
|
-
if (passProperties.indexOf(prop) >= 0) {
|
|
111
|
-
return Reflect.get(target, prop, receiver);
|
|
112
|
-
}
|
|
113
|
-
const value = target[prop];
|
|
114
|
-
if (value instanceof Function) {
|
|
115
|
-
return function(...args2) {
|
|
116
|
-
return value.apply(this === receiver ? target : this, args2);
|
|
117
|
-
};
|
|
118
|
-
} else if (!(prop in target)) {
|
|
119
|
-
return target.getValue.apply(this === receiver ? target : this, [prop]);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
return Reflect.get(target, prop, receiver);
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
setNames(proxy, getNames(this));
|
|
126
|
-
return proxy;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Returns the Result as a normal Array. If %%deep%%, any children
|
|
130
|
-
* which are Result objects are also converted to a normal Array.
|
|
131
|
-
*
|
|
132
|
-
* This will throw if there are any outstanding deferred
|
|
133
|
-
* errors.
|
|
134
|
-
*/
|
|
135
|
-
toArray(deep) {
|
|
136
|
-
const result = [];
|
|
137
|
-
this.forEach((item, index) => {
|
|
138
|
-
if (item instanceof Error) {
|
|
139
|
-
throwError(`index ${index}`, item);
|
|
140
|
-
}
|
|
141
|
-
if (deep && item instanceof _Result) {
|
|
142
|
-
item = item.toArray(deep);
|
|
143
|
-
}
|
|
144
|
-
result.push(item);
|
|
145
|
-
});
|
|
146
|
-
return result;
|
|
15
|
+
return i;
|
|
147
16
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
* %%deep%%, any children which are Result objects are also
|
|
151
|
-
* converted to an Object.
|
|
152
|
-
*
|
|
153
|
-
* This will throw if any value is unnamed, or if there are
|
|
154
|
-
* any outstanding deferred errors.
|
|
155
|
-
*/
|
|
156
|
-
toObject(deep) {
|
|
157
|
-
const names = getNames(this);
|
|
158
|
-
return names.reduce((accum, name, index) => {
|
|
159
|
-
assert(name != null, `value at index ${index} unnamed`, "UNSUPPORTED_OPERATION", {
|
|
160
|
-
operation: "toObject()"
|
|
161
|
-
});
|
|
162
|
-
return toObject(names, this, deep);
|
|
163
|
-
}, {});
|
|
17
|
+
if (reason === "OVERRUN") {
|
|
18
|
+
return bytes.length - offset - 1;
|
|
164
19
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
20
|
+
return 0;
|
|
21
|
+
}
|
|
22
|
+
function replaceFunc(reason, offset, bytes, output, badCodepoint) {
|
|
23
|
+
if (reason === "OVERLONG") {
|
|
24
|
+
assertArgument(typeof badCodepoint === "number", "invalid bad code point for replacement", "badCodepoint", badCodepoint);
|
|
25
|
+
output.push(badCodepoint);
|
|
26
|
+
return 0;
|
|
27
|
+
}
|
|
28
|
+
output.push(65533);
|
|
29
|
+
return ignoreFunc(reason, offset, bytes);
|
|
30
|
+
}
|
|
31
|
+
const Utf8ErrorFuncs = Object.freeze({
|
|
32
|
+
error: errorFunc,
|
|
33
|
+
ignore: ignoreFunc,
|
|
34
|
+
replace: replaceFunc
|
|
35
|
+
});
|
|
36
|
+
function getUtf8CodePoints(_bytes, onError) {
|
|
37
|
+
if (onError == null) {
|
|
38
|
+
onError = Utf8ErrorFuncs.error;
|
|
39
|
+
}
|
|
40
|
+
const bytes = getBytes(_bytes, "bytes");
|
|
41
|
+
const result = [];
|
|
42
|
+
let i = 0;
|
|
43
|
+
while (i < bytes.length) {
|
|
44
|
+
const c = bytes[i++];
|
|
45
|
+
if (c >> 7 === 0) {
|
|
46
|
+
result.push(c);
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
let extraLength = null;
|
|
50
|
+
let overlongMask = null;
|
|
51
|
+
if ((c & 224) === 192) {
|
|
52
|
+
extraLength = 1;
|
|
53
|
+
overlongMask = 127;
|
|
54
|
+
} else if ((c & 240) === 224) {
|
|
55
|
+
extraLength = 2;
|
|
56
|
+
overlongMask = 2047;
|
|
57
|
+
} else if ((c & 248) === 240) {
|
|
58
|
+
extraLength = 3;
|
|
59
|
+
overlongMask = 65535;
|
|
60
|
+
} else {
|
|
61
|
+
if ((c & 192) === 128) {
|
|
62
|
+
i += onError("UNEXPECTED_CONTINUE", i - 1, bytes, result);
|
|
63
|
+
} else {
|
|
64
|
+
i += onError("BAD_PREFIX", i - 1, bytes, result);
|
|
176
65
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
if (i - 1 + extraLength >= bytes.length) {
|
|
69
|
+
i += onError("OVERRUN", i - 1, bytes, result);
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
let res = c & (1 << 8 - extraLength - 1) - 1;
|
|
73
|
+
for (let j = 0; j < extraLength; j++) {
|
|
74
|
+
let nextChar = bytes[i];
|
|
75
|
+
if ((nextChar & 192) != 128) {
|
|
76
|
+
i += onError("MISSING_CONTINUE", i, bytes, result);
|
|
77
|
+
res = null;
|
|
78
|
+
break;
|
|
185
79
|
}
|
|
80
|
+
res = res << 6 | nextChar & 63;
|
|
81
|
+
i++;
|
|
186
82
|
}
|
|
187
|
-
if (
|
|
188
|
-
|
|
83
|
+
if (res === null) {
|
|
84
|
+
continue;
|
|
189
85
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
result.push(this[i]);
|
|
194
|
-
names.push(_names2[i]);
|
|
86
|
+
if (res > 1114111) {
|
|
87
|
+
i += onError("OUT_OF_RANGE", i - 1 - extraLength, bytes, result, res);
|
|
88
|
+
continue;
|
|
195
89
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
* @_ignore
|
|
200
|
-
*/
|
|
201
|
-
filter(callback, thisArg) {
|
|
202
|
-
const _names2 = getNames(this);
|
|
203
|
-
const result = [], names = [];
|
|
204
|
-
for (let i = 0; i < this.length; i++) {
|
|
205
|
-
const item = this[i];
|
|
206
|
-
if (item instanceof Error) {
|
|
207
|
-
throwError(`index ${i}`, item);
|
|
208
|
-
}
|
|
209
|
-
if (callback.call(thisArg, item, i, this)) {
|
|
210
|
-
result.push(item);
|
|
211
|
-
names.push(_names2[i]);
|
|
212
|
-
}
|
|
90
|
+
if (res >= 55296 && res <= 57343) {
|
|
91
|
+
i += onError("UTF16_SURROGATE", i - 1 - extraLength, bytes, result, res);
|
|
92
|
+
continue;
|
|
213
93
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
* @_ignore
|
|
218
|
-
*/
|
|
219
|
-
map(callback, thisArg) {
|
|
220
|
-
const result = [];
|
|
221
|
-
for (let i = 0; i < this.length; i++) {
|
|
222
|
-
const item = this[i];
|
|
223
|
-
if (item instanceof Error) {
|
|
224
|
-
throwError(`index ${i}`, item);
|
|
225
|
-
}
|
|
226
|
-
result.push(callback.call(thisArg, item, i, this));
|
|
94
|
+
if (res <= overlongMask) {
|
|
95
|
+
i += onError("OVERLONG", i - 1 - extraLength, bytes, result, res);
|
|
96
|
+
continue;
|
|
227
97
|
}
|
|
228
|
-
|
|
98
|
+
result.push(res);
|
|
229
99
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
100
|
+
return result;
|
|
101
|
+
}
|
|
102
|
+
function toUtf8Bytes(str, form) {
|
|
103
|
+
assertArgument(typeof str === "string", "invalid string value", "str", str);
|
|
104
|
+
let result = [];
|
|
105
|
+
for (let i = 0; i < str.length; i++) {
|
|
106
|
+
const c = str.charCodeAt(i);
|
|
107
|
+
if (c < 128) {
|
|
108
|
+
result.push(c);
|
|
109
|
+
} else if (c < 2048) {
|
|
110
|
+
result.push(c >> 6 | 192);
|
|
111
|
+
result.push(c & 63 | 128);
|
|
112
|
+
} else if ((c & 64512) == 55296) {
|
|
113
|
+
i++;
|
|
114
|
+
const c2 = str.charCodeAt(i);
|
|
115
|
+
assertArgument(i < str.length && (c2 & 64512) === 56320, "invalid surrogate pair", "str", str);
|
|
116
|
+
const pair = 65536 + ((c & 1023) << 10) + (c2 & 1023);
|
|
117
|
+
result.push(pair >> 18 | 240);
|
|
118
|
+
result.push(pair >> 12 & 63 | 128);
|
|
119
|
+
result.push(pair >> 6 & 63 | 128);
|
|
120
|
+
result.push(pair & 63 | 128);
|
|
121
|
+
} else {
|
|
122
|
+
result.push(c >> 12 | 224);
|
|
123
|
+
result.push(c >> 6 & 63 | 128);
|
|
124
|
+
result.push(c & 63 | 128);
|
|
246
125
|
}
|
|
247
|
-
return value;
|
|
248
|
-
}
|
|
249
|
-
/**
|
|
250
|
-
* Creates a new [[Result]] for %%items%% with each entry
|
|
251
|
-
* also accessible by its corresponding name in %%keys%%.
|
|
252
|
-
*/
|
|
253
|
-
static fromItems(items, keys) {
|
|
254
|
-
return new _Result(_guard, items, keys);
|
|
255
126
|
}
|
|
256
|
-
|
|
257
|
-
_names = new WeakMap();
|
|
258
|
-
let Result = _Result;
|
|
259
|
-
function getValue(value) {
|
|
260
|
-
let bytes = toBeArray(value);
|
|
261
|
-
assert(bytes.length <= WordSize, "value out-of-bounds", "BUFFER_OVERRUN", { buffer: bytes, length: WordSize, offset: bytes.length });
|
|
262
|
-
if (bytes.length !== WordSize) {
|
|
263
|
-
bytes = getBytesCopy(concat([Padding.slice(bytes.length % WordSize), bytes]));
|
|
264
|
-
}
|
|
265
|
-
return bytes;
|
|
127
|
+
return new Uint8Array(result);
|
|
266
128
|
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
// The localName bound in the signature, in this example it is "baz":
|
|
276
|
-
// - tuple(address foo, uint bar) baz
|
|
277
|
-
__publicField(this, "localName");
|
|
278
|
-
// Whether this type is dynamic:
|
|
279
|
-
// - Dynamic: bytes, string, address[], tuple(boolean[]), etc.
|
|
280
|
-
// - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8)
|
|
281
|
-
__publicField(this, "dynamic");
|
|
282
|
-
defineProperties(this, { name, type, localName, dynamic }, {
|
|
283
|
-
name: "string",
|
|
284
|
-
type: "string",
|
|
285
|
-
localName: "string",
|
|
286
|
-
dynamic: "boolean"
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
_throwError(message, value) {
|
|
290
|
-
assertArgument(false, message, this.localName, value);
|
|
291
|
-
}
|
|
129
|
+
function _toUtf8String(codePoints) {
|
|
130
|
+
return codePoints.map((codePoint) => {
|
|
131
|
+
if (codePoint <= 65535) {
|
|
132
|
+
return String.fromCharCode(codePoint);
|
|
133
|
+
}
|
|
134
|
+
codePoint -= 65536;
|
|
135
|
+
return String.fromCharCode((codePoint >> 10 & 1023) + 55296, (codePoint & 1023) + 56320);
|
|
136
|
+
}).join("");
|
|
292
137
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
__privateAdd(this, _Writer_instances);
|
|
296
|
-
// An array of WordSize lengthed objects to concatenation
|
|
297
|
-
__privateAdd(this, _data);
|
|
298
|
-
__privateAdd(this, _dataLength);
|
|
299
|
-
__privateSet(this, _data, []);
|
|
300
|
-
__privateSet(this, _dataLength, 0);
|
|
301
|
-
}
|
|
302
|
-
get data() {
|
|
303
|
-
return concat(__privateGet(this, _data));
|
|
304
|
-
}
|
|
305
|
-
get length() {
|
|
306
|
-
return __privateGet(this, _dataLength);
|
|
307
|
-
}
|
|
308
|
-
appendWriter(writer) {
|
|
309
|
-
return __privateMethod(this, _Writer_instances, writeData_fn).call(this, getBytesCopy(writer.data));
|
|
310
|
-
}
|
|
311
|
-
// Arrayish item; pad on the right to *nearest* WordSize
|
|
312
|
-
writeBytes(value) {
|
|
313
|
-
let bytes = getBytesCopy(value);
|
|
314
|
-
const paddingOffset = bytes.length % WordSize;
|
|
315
|
-
if (paddingOffset) {
|
|
316
|
-
bytes = getBytesCopy(concat([bytes, Padding.slice(paddingOffset)]));
|
|
317
|
-
}
|
|
318
|
-
return __privateMethod(this, _Writer_instances, writeData_fn).call(this, bytes);
|
|
319
|
-
}
|
|
320
|
-
// Numeric item; pad on the left *to* WordSize
|
|
321
|
-
writeValue(value) {
|
|
322
|
-
return __privateMethod(this, _Writer_instances, writeData_fn).call(this, getValue(value));
|
|
323
|
-
}
|
|
324
|
-
// Inserts a numeric place-holder, returning a callback that can
|
|
325
|
-
// be used to asjust the value later
|
|
326
|
-
writeUpdatableValue() {
|
|
327
|
-
const offset = __privateGet(this, _data).length;
|
|
328
|
-
__privateGet(this, _data).push(Padding);
|
|
329
|
-
__privateSet(this, _dataLength, __privateGet(this, _dataLength) + WordSize);
|
|
330
|
-
return (value) => {
|
|
331
|
-
__privateGet(this, _data)[offset] = getValue(value);
|
|
332
|
-
};
|
|
333
|
-
}
|
|
138
|
+
function toUtf8String(bytes, onError) {
|
|
139
|
+
return _toUtf8String(getUtf8CodePoints(bytes, onError));
|
|
334
140
|
}
|
|
335
|
-
_data = new WeakMap();
|
|
336
|
-
_dataLength = new WeakMap();
|
|
337
|
-
_Writer_instances = new WeakSet();
|
|
338
|
-
writeData_fn = function(data) {
|
|
339
|
-
__privateGet(this, _data).push(data);
|
|
340
|
-
__privateSet(this, _dataLength, __privateGet(this, _dataLength) + data.length);
|
|
341
|
-
return data.length;
|
|
342
|
-
};
|
|
343
|
-
const _Reader = class _Reader {
|
|
344
|
-
constructor(data, allowLoose, maxInflation) {
|
|
345
|
-
__privateAdd(this, _Reader_instances);
|
|
346
|
-
// Allows incomplete unpadded data to be read; otherwise an error
|
|
347
|
-
// is raised if attempting to overrun the buffer. This is required
|
|
348
|
-
// to deal with an old Solidity bug, in which event data for
|
|
349
|
-
// external (not public thoguh) was tightly packed.
|
|
350
|
-
__publicField(this, "allowLoose");
|
|
351
|
-
__privateAdd(this, _data2);
|
|
352
|
-
__privateAdd(this, _offset);
|
|
353
|
-
__privateAdd(this, _bytesRead);
|
|
354
|
-
__privateAdd(this, _parent);
|
|
355
|
-
__privateAdd(this, _maxInflation);
|
|
356
|
-
defineProperties(this, { allowLoose: !!allowLoose });
|
|
357
|
-
__privateSet(this, _data2, getBytesCopy(data));
|
|
358
|
-
__privateSet(this, _bytesRead, 0);
|
|
359
|
-
__privateSet(this, _parent, null);
|
|
360
|
-
__privateSet(this, _maxInflation, maxInflation != null ? maxInflation : 1024);
|
|
361
|
-
__privateSet(this, _offset, 0);
|
|
362
|
-
}
|
|
363
|
-
get data() {
|
|
364
|
-
return hexlify(__privateGet(this, _data2));
|
|
365
|
-
}
|
|
366
|
-
get dataLength() {
|
|
367
|
-
return __privateGet(this, _data2).length;
|
|
368
|
-
}
|
|
369
|
-
get consumed() {
|
|
370
|
-
return __privateGet(this, _offset);
|
|
371
|
-
}
|
|
372
|
-
get bytes() {
|
|
373
|
-
return new Uint8Array(__privateGet(this, _data2));
|
|
374
|
-
}
|
|
375
|
-
// Create a sub-reader with the same underlying data, but offset
|
|
376
|
-
subReader(offset) {
|
|
377
|
-
const reader = new _Reader(__privateGet(this, _data2).slice(__privateGet(this, _offset) + offset), this.allowLoose, __privateGet(this, _maxInflation));
|
|
378
|
-
__privateSet(reader, _parent, this);
|
|
379
|
-
return reader;
|
|
380
|
-
}
|
|
381
|
-
// Read bytes
|
|
382
|
-
readBytes(length, loose) {
|
|
383
|
-
let bytes = __privateMethod(this, _Reader_instances, peekBytes_fn).call(this, 0, length, !!loose);
|
|
384
|
-
__privateMethod(this, _Reader_instances, incrementBytesRead_fn).call(this, length);
|
|
385
|
-
__privateSet(this, _offset, __privateGet(this, _offset) + bytes.length);
|
|
386
|
-
return bytes.slice(0, length);
|
|
387
|
-
}
|
|
388
|
-
// Read a numeric values
|
|
389
|
-
readValue() {
|
|
390
|
-
return toBigInt(this.readBytes(WordSize));
|
|
391
|
-
}
|
|
392
|
-
readIndex() {
|
|
393
|
-
return toNumber(this.readBytes(WordSize));
|
|
394
|
-
}
|
|
395
|
-
};
|
|
396
|
-
_data2 = new WeakMap();
|
|
397
|
-
_offset = new WeakMap();
|
|
398
|
-
_bytesRead = new WeakMap();
|
|
399
|
-
_parent = new WeakMap();
|
|
400
|
-
_maxInflation = new WeakMap();
|
|
401
|
-
_Reader_instances = new WeakSet();
|
|
402
|
-
incrementBytesRead_fn = function(count) {
|
|
403
|
-
var _a;
|
|
404
|
-
if (__privateGet(this, _parent)) {
|
|
405
|
-
return __privateMethod(_a = __privateGet(this, _parent), _Reader_instances, incrementBytesRead_fn).call(_a, count);
|
|
406
|
-
}
|
|
407
|
-
__privateSet(this, _bytesRead, __privateGet(this, _bytesRead) + count);
|
|
408
|
-
assert(__privateGet(this, _maxInflation) < 1 || __privateGet(this, _bytesRead) <= __privateGet(this, _maxInflation) * this.dataLength, `compressed ABI data exceeds inflation ratio of ${__privateGet(this, _maxInflation)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`, "BUFFER_OVERRUN", {
|
|
409
|
-
buffer: getBytesCopy(__privateGet(this, _data2)),
|
|
410
|
-
offset: __privateGet(this, _offset),
|
|
411
|
-
length: count,
|
|
412
|
-
info: {
|
|
413
|
-
bytesRead: __privateGet(this, _bytesRead),
|
|
414
|
-
dataLength: this.dataLength
|
|
415
|
-
}
|
|
416
|
-
});
|
|
417
|
-
};
|
|
418
|
-
peekBytes_fn = function(offset, length, loose) {
|
|
419
|
-
let alignedLength = Math.ceil(length / WordSize) * WordSize;
|
|
420
|
-
if (__privateGet(this, _offset) + alignedLength > __privateGet(this, _data2).length) {
|
|
421
|
-
if (this.allowLoose && loose && __privateGet(this, _offset) + length <= __privateGet(this, _data2).length) {
|
|
422
|
-
alignedLength = length;
|
|
423
|
-
} else {
|
|
424
|
-
assert(false, "data out-of-bounds", "BUFFER_OVERRUN", {
|
|
425
|
-
buffer: getBytesCopy(__privateGet(this, _data2)),
|
|
426
|
-
length: __privateGet(this, _data2).length,
|
|
427
|
-
offset: __privateGet(this, _offset) + alignedLength
|
|
428
|
-
});
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
return __privateGet(this, _data2).slice(__privateGet(this, _offset), __privateGet(this, _offset) + alignedLength);
|
|
432
|
-
};
|
|
433
|
-
let Reader = _Reader;
|
|
434
141
|
export {
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
WordSize,
|
|
439
|
-
Writer
|
|
142
|
+
Utf8ErrorFuncs,
|
|
143
|
+
toUtf8Bytes,
|
|
144
|
+
toUtf8String
|
|
440
145
|
};
|
|
441
146
|
//# sourceMappingURL=standards-sdk.es92.js.map
|