@aeternity/aepp-sdk 12.1.0 → 12.1.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"aepp-sdk.browser.js","mappings":";CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,UAAWA,QAAQ,gBAAiBA,QAAQ,OAAQA,QAAQ,QAASA,QAAQ,aAAcA,QAAQ,mBAAoBA,QAAQ,mBAAoBA,QAAQ,wDAAyDA,QAAQ,kBAAmBA,QAAQ,cAAeA,QAAQ,UAAWA,QAAQ,4BAA6BA,QAAQ,sBAAuBA,QAAQ,6BAA8BA,QAAQ,eAAgBA,QAAQ,aAAcA,QAAQ,WACjc,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,CAAC,SAAU,eAAgB,MAAO,OAAQ,YAAa,kBAAmB,kBAAmB,uDAAwD,iBAAkB,aAAc,SAAU,2BAA4B,qBAAsB,4BAA6B,cAAe,YAAa,UAAWJ,GAClS,iBAAZC,QACdA,QAAY,GAAID,EAAQG,QAAQ,UAAWA,QAAQ,gBAAiBA,QAAQ,OAAQA,QAAQ,QAASA,QAAQ,aAAcA,QAAQ,mBAAoBA,QAAQ,mBAAoBA,QAAQ,wDAAyDA,QAAQ,kBAAmBA,QAAQ,cAAeA,QAAQ,UAAWA,QAAQ,4BAA6BA,QAAQ,sBAAuBA,QAAQ,6BAA8BA,QAAQ,eAAgBA,QAAQ,aAAcA,QAAQ,WAEzdJ,EAAS,GAAIC,EAAQD,EAAa,OAAGA,EAAK,gBAAiBA,EAAU,IAAGA,EAAW,KAAGA,EAAgB,UAAGA,EAAK,mBAAoBA,EAAK,mBAAoBA,EAAK,wDAAyDA,EAAK,kBAAmBA,EAAK,cAAeA,EAAK,UAAWA,EAAK,4BAA6BA,EAAK,sBAAuBA,EAAK,6BAA8BA,EAAK,eAAgBA,EA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yC,GACVC,MAAM+xC,YAAYhyC,GAClBnN,KAAK2sC,KAAKwf,YAAYh/C,EACvB,CAED40C,cACE,OAAO/hD,KAAK2sC,KAAK8Z,UAAUoG,cAC5B","sources":["webpack://Ae/webpack/universalModuleDefinition","webpack://Ae/./node_modules/blakejs/blake2b.js","webpack://Ae/./node_modules/blakejs/util.js","webpack://Ae/./node_modules/core-js-pure/actual/object/define-property.js","webpack://Ae/./node_modules/core-js-pure/es/array/virtual/includes.js","webpack://Ae/./node_modules/core-js-pure/es/instance/includes.js","webpack://Ae/./node_modules/core-js-pure/es/object/define-property.js","webpack://Ae/./node_modules/core-js-pure/es/string/virtual/includes.js","webpack://Ae/./node_modules/core-js-pure/features/object/define-property.js","webpack://Ae/./node_modules/core-js-pure/full/object/define-property.js","webpack://Ae/./node_modules/core-js-pure/internals/a-callable.js","webpack://Ae/./node_modules/core-js-pure/internals/add-to-unscopables.js","webpack://Ae/./node_modules/core-js-pure/internals/an-object.js","webpack://Ae/./node_modules/core-js-pure/internals/array-includes.js","webpack://Ae/./node_modules/core-js-pure/internals/classof-raw.js","webpack://Ae/./node_modules/core-js-pure/internals/classof.js","webpack://Ae/./node_modules/core-js-pure/internals/correct-is-regexp-logic.js","webpack://Ae/./node_modules/core-js-pure/internals/create-non-enumerable-property.js","webpack://Ae/./node_modules/core-js-pure/internals/create-property-descriptor.js","webpack://Ae/./node_modules/core-js-pure/internals/define-global-property.js","webpack://Ae/./node_modules/core-js-pure/internals/descriptors.js","webpack://Ae/./node_modules/core-js-pure/internals/document-create-element.js","webpack://Ae/./node_modules/core-js-pure/internals/engine-user-agent.js","webpack://Ae/./node_modules/core-js-pure/internals/engine-v8-version.js","webpack://Ae/./node_modules/core-js-pure/internals/entry-virtual.js","webpack://Ae/./node_modules/core-js-pure/internals/export.js","webpack://Ae/./node_modules/core-js-pure/internals/fails.js","webpack://Ae/./node_modules/core-js-pure/internals/function-apply.js","webpack://Ae/./node_modules/core-js-pure/internals/function-bind-context.js","webpack://Ae/./node_modules/core-js-pure/internals/function-bind-native.js","webpack://Ae/./node_modules/core-js-pure/internals/function-call.js","webpack://Ae/./node_modules/core-js-pure/internals/function-uncurry-this.js","webpack://Ae/./node_modules/core-js-pure/internals/get-built-in.js","webpack://Ae/./node_modules/core-js-pure/internals/get-method.js","webpack://Ae/./node_modules/core-js-pure/internals/global.js","webpack://Ae/./node_modules/core-js-pure/internals/has-own-property.js","webpack://Ae/./node_modules/core-js-pure/internals/ie8-dom-define.js","webpack://Ae/./node_modules/core-js-pure/internals/indexed-object.js","webpack://Ae/./node_modules/core-js-pure/internals/is-callable.js","webpack://Ae/./node_modules/core-js-pure/internals/is-forced.js","webpack://Ae/./node_modules/core-js-pure/internals/is-object.js","webpack://Ae/./node_modules/core-js-pure/internals/is-pure.js","webpack://Ae/./node_modules/core-js-pure/internals/is-regexp.js","webpack://Ae/./node_modules/core-js-pure/internals/is-symbol.js","webpack://Ae/./node_modules/core-js-pure/internals/length-of-array-like.js","webpack://Ae/./node_modules/core-js-pure/internals/math-trunc.js","webpack://Ae/./node_modules/core-js-pure/internals/native-symbol.js","webpack://Ae/./node_modules/core-js-pure/internals/not-a-regexp.js","webpack://Ae/./node_modules/core-js-pure/internals/object-define-property.js","webpack://Ae/./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js","webpack://Ae/./node_modules/core-js-pure/internals/object-is-prototype-of.js","webpack://Ae/./node_modules/core-js-pure/internals/object-property-is-enumerable.js","webpack://Ae/./node_modules/core-js-pure/internals/ordinary-to-primitive.js","webpack://Ae/./node_modules/core-js-pure/internals/path.js","webpack://Ae/./node_modules/core-js-pure/internals/require-object-coercible.js","webpack://Ae/./node_modules/core-js-pure/internals/shared-store.js","webpack://Ae/./node_modules/core-js-pure/internals/shared.js","webpack://Ae/./node_modules/core-js-pure/internals/to-absolute-index.js","webpack://Ae/./node_modules/core-js-pure/internals/to-indexed-object.js","webpack://Ae/./node_modules/core-js-pure/internals/to-integer-or-infinity.js","webpack://Ae/./node_modules/core-js-pure/internals/to-length.js","webpack://Ae/./node_modules/core-js-pure/internals/to-object.js","webpack://Ae/./node_modules/core-js-pure/internals/to-primitive.js","webpack://Ae/./node_modules/core-js-pure/internals/to-property-key.js","webpack://Ae/./node_modules/core-js-pure/internals/to-string-tag-support.js","webpack://Ae/./node_modules/core-js-pure/internals/to-string.js","webpack://Ae/./node_modules/core-js-pure/internals/try-to-string.js","webpack://Ae/./node_modules/core-js-pure/internals/uid.js","webpack://Ae/./node_modules/core-js-pure/internals/use-symbol-as-uid.js","webpack://Ae/./node_modules/core-js-pure/internals/v8-prototype-define-bug.js","webpack://Ae/./node_modules/core-js-pure/internals/well-known-symbol.js","webpack://Ae/./node_modules/core-js-pure/modules/es.array.includes.js","webpack://Ae/./node_modules/core-js-pure/modules/es.object.define-property.js","webpack://Ae/./node_modules/core-js-pure/modules/es.string.includes.js","webpack://Ae/./node_modules/core-js-pure/stable/instance/includes.js","webpack://Ae/./node_modules/core-js-pure/stable/object/define-property.js","webpack://Ae/./node_modules/inherits/inherits_browser.js","webpack://Ae/./node_modules/safe-buffer/index.js","webpack://Ae/./node_modules/sha.js/hash.js","webpack://Ae/./node_modules/sha.js/sha256.js","webpack://Ae/external umd \"@aeternity/aepp-calldata\"","webpack://Ae/external umd \"@aeternity/argon2-browser/dist/argon2-bundled.min.js\"","webpack://Ae/external umd \"@aeternity/uuid\"","webpack://Ae/external umd \"@azure/core-client\"","webpack://Ae/external umd \"@azure/core-rest-pipeline\"","webpack://Ae/external umd \"aes-js\"","webpack://Ae/external umd \"bignumber.js\"","webpack://Ae/external umd \"bip32-path\"","webpack://Ae/external umd \"bs58\"","webpack://Ae/external umd \"buffer\"","webpack://Ae/external umd \"events\"","webpack://Ae/external umd \"json-bigint\"","webpack://Ae/external umd \"rlp\"","webpack://Ae/external umd \"tweetnacl\"","webpack://Ae/external umd \"tweetnacl-auth\"","webpack://Ae/external umd \"varuint-bitcoin\"","webpack://Ae/external umd \"websocket\"","webpack://Ae/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/includes.js","webpack://Ae/./node_modules/@babel/runtime-corejs3/core-js/object/define-property.js","webpack://Ae/webpack/bootstrap","webpack://Ae/webpack/runtime/compat get default export","webpack://Ae/webpack/runtime/define property getters","webpack://Ae/webpack/runtime/global","webpack://Ae/webpack/runtime/hasOwnProperty shorthand","webpack://Ae/webpack/runtime/make namespace object","webpack://Ae/./src/utils/bignumber.ts","webpack://Ae/./src/utils/errors.ts","webpack://Ae/./src/utils/amount-formatter.ts","webpack://Ae/./src/utils/string.ts","webpack://Ae/./src/utils/bytes.ts","webpack://Ae/./src/utils/other.ts","webpack://Ae/./src/utils/encoder-types.ts","webpack://Ae/./src/utils/encoder.ts","webpack://Ae/./src/utils/crypto.ts","webpack://Ae/./src/tx/builder/constants.ts","webpack://Ae/./src/tx/builder/address.ts","webpack://Ae/./src/tx/builder/helpers.ts","webpack://Ae/./src/tx/builder/field-types/u-int.ts","webpack://Ae/./src/tx/builder/field-types/short-u-int.ts","webpack://Ae/./src/tx/builder/field-types/coin-amount.ts","webpack://Ae/./src/tx/builder/field-types/deposit.ts","webpack://Ae/./src/tx/builder/field-types/fee.ts","webpack://Ae/./src/tx/builder/field-types/gas-limit.ts","webpack://Ae/./src/tx/builder/field-types/gas-price.ts","webpack://Ae/./src/tx/builder/field-types/field.ts","webpack://Ae/./src/tx/builder/field-types/name.ts","webpack://Ae/./src/tx/builder/field-types/name-fee.ts","webpack://Ae/./src/tx/builder/field-types/index.ts","webpack://Ae/./src/tx/builder/field-types/name-id.ts","webpack://Ae/./src/tx/builder/schema.ts","webpack://Ae/./src/utils/mptree.ts","webpack://Ae/./src/tx/builder/index.ts","webpack://Ae/./src/tx/validator.ts","webpack://Ae/./src/chain.ts","webpack://Ae/./src/utils/keystore.ts","webpack://Ae/./src/tx/index.ts","webpack://Ae/./src/utils/hd-wallet.ts","webpack://Ae/./src/spend.ts","webpack://Ae/./src/aens.ts","webpack://Ae/./src/contract/aci.ts","webpack://Ae/./src/contract/methods.ts","webpack://Ae/./src/oracle.ts","webpack://Ae/./src/contract/ga.ts","webpack://Ae/./src/deprecated/methods.ts","webpack://Ae/./src/deprecated/index.ts","webpack://Ae/./node_modules/@babel/runtime-corejs3/helpers/esm/defineProperty.js","webpack://Ae/./src/utils/autorest.ts","webpack://Ae/./src/utils/semver-satisfies.ts","webpack://Ae/./src/apis/node/models/mappers.ts","webpack://Ae/./src/apis/node/models/parameters.ts","webpack://Ae/./src/apis/node/node.ts","webpack://Ae/./src/Node.ts","webpack://Ae/./src/account/Base.ts","webpack://Ae/./src/account/Memory.ts","webpack://Ae/./src/apis/compiler/models/mappers.ts","webpack://Ae/./src/apis/compiler/models/parameters.ts","webpack://Ae/./src/apis/compiler/compiler.ts","webpack://Ae/./src/contract/Compiler.ts","webpack://Ae/./src/AeSdkBase.ts","webpack://Ae/./src/AeSdk.ts","webpack://Ae/./src/aepp-wallet-communication/schema.ts","webpack://Ae/./src/account/Rpc.ts","webpack://Ae/./node_modules/@babel/runtime-corejs3/helpers/esm/classExtractFieldDescriptor.js","webpack://Ae/./node_modules/@babel/runtime-corejs3/helpers/esm/classPrivateFieldGet.js","webpack://Ae/./node_modules/@babel/runtime-corejs3/helpers/esm/classApplyDescriptorGet.js","webpack://Ae/./node_modules/@babel/runtime-corejs3/helpers/esm/classPrivateFieldSet.js","webpack://Ae/./node_modules/@babel/runtime-corejs3/helpers/esm/classApplyDescriptorSet.js","webpack://Ae/./src/aepp-wallet-communication/rpc/RpcClient.ts","webpack://Ae/./src/AeSdkAepp.ts","webpack://Ae/./src/aepp-wallet-communication/rpc/types.ts","webpack://Ae/./src/utils/json-big.ts","webpack://Ae/./src/AeSdkWallet.ts","webpack://Ae/./src/channel/internal.ts","webpack://Ae/./src/channel/handlers.ts","webpack://Ae/./src/channel/index.ts","webpack://Ae/./src/aepp-wallet-communication/connection-proxy.ts","webpack://Ae/./src/aepp-wallet-communication/connection/Browser.ts","webpack://Ae/./src/aepp-wallet-communication/connection/BrowserWindowMessage.ts","webpack://Ae/./src/aepp-wallet-communication/wallet-detector.ts","webpack://Ae/./src/aepp-wallet-communication/connection/BrowserRuntime.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"buffer\"), require(\"bignumber.js\"), require(\"rlp\"), require(\"bs58\"), require(\"tweetnacl\"), require(\"varuint-bitcoin\"), require(\"@aeternity/uuid\"), require(\"@aeternity/argon2-browser/dist/argon2-bundled.min.js\"), require(\"tweetnacl-auth\"), require(\"bip32-path\"), require(\"aes-js\"), require(\"@aeternity/aepp-calldata\"), require(\"@azure/core-client\"), require(\"@azure/core-rest-pipeline\"), require(\"json-bigint\"), require(\"websocket\"), require(\"events\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"buffer\", \"bignumber.js\", \"rlp\", \"bs58\", \"tweetnacl\", \"varuint-bitcoin\", \"@aeternity/uuid\", \"@aeternity/argon2-browser/dist/argon2-bundled.min.js\", \"tweetnacl-auth\", \"bip32-path\", \"aes-js\", \"@aeternity/aepp-calldata\", \"@azure/core-client\", \"@azure/core-rest-pipeline\", \"json-bigint\", \"websocket\", \"events\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Ae\"] = factory(require(\"buffer\"), require(\"bignumber.js\"), require(\"rlp\"), require(\"bs58\"), require(\"tweetnacl\"), require(\"varuint-bitcoin\"), require(\"@aeternity/uuid\"), require(\"@aeternity/argon2-browser/dist/argon2-bundled.min.js\"), require(\"tweetnacl-auth\"), require(\"bip32-path\"), require(\"aes-js\"), require(\"@aeternity/aepp-calldata\"), require(\"@azure/core-client\"), require(\"@azure/core-rest-pipeline\"), require(\"json-bigint\"), require(\"websocket\"), require(\"events\"));\n\telse\n\t\troot[\"Ae\"] = factory(root[\"buffer\"], root[\"bignumber.js\"], root[\"rlp\"], root[\"bs58\"], root[\"tweetnacl\"], root[\"varuint-bitcoin\"], root[\"@aeternity/uuid\"], root[\"@aeternity/argon2-browser/dist/argon2-bundled.min.js\"], root[\"tweetnacl-auth\"], root[\"bip32-path\"], root[\"aes-js\"], root[\"@aeternity/aepp-calldata\"], root[\"@azure/core-client\"], root[\"@azure/core-rest-pipeline\"], root[\"json-bigint\"], root[\"websocket\"], root[\"events\"]);\n})(self, function(__WEBPACK_EXTERNAL_MODULE__9408__, __WEBPACK_EXTERNAL_MODULE__5192__, __WEBPACK_EXTERNAL_MODULE__3485__, __WEBPACK_EXTERNAL_MODULE__3783__, __WEBPACK_EXTERNAL_MODULE__79__, __WEBPACK_EXTERNAL_MODULE__7480__, __WEBPACK_EXTERNAL_MODULE__3983__, __WEBPACK_EXTERNAL_MODULE__7289__, __WEBPACK_EXTERNAL_MODULE__9882__, __WEBPACK_EXTERNAL_MODULE__1986__, __WEBPACK_EXTERNAL_MODULE__8236__, __WEBPACK_EXTERNAL_MODULE__7946__, __WEBPACK_EXTERNAL_MODULE__4711__, __WEBPACK_EXTERNAL_MODULE__5039__, __WEBPACK_EXTERNAL_MODULE__2716__, __WEBPACK_EXTERNAL_MODULE__8079__, __WEBPACK_EXTERNAL_MODULE__3735__) {\nreturn ","// Blake2B in pure Javascript\n// Adapted from the reference implementation in RFC7693\n// Ported to Javascript by DC - https://github.com/dcposch\n\nconst util = require('./util')\n\n// 64-bit unsigned addition\n// Sets v[a,a+1] += v[b,b+1]\n// v should be a Uint32Array\nfunction ADD64AA (v, a, b) {\n const o0 = v[a] + v[b]\n let o1 = v[a + 1] + v[b + 1]\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}\n\n// 64-bit unsigned addition\n// Sets v[a,a+1] += b\n// b0 is the low 32 bits of b, b1 represents the high 32 bits\nfunction ADD64AC (v, a, b0, b1) {\n let o0 = v[a] + b0\n if (b0 < 0) {\n o0 += 0x100000000\n }\n let o1 = v[a + 1] + b1\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}\n\n// Little-endian byte access\nfunction B2B_GET32 (arr, i) {\n return arr[i] ^ (arr[i + 1] << 8) ^ (arr[i + 2] << 16) ^ (arr[i + 3] << 24)\n}\n\n// G Mixing function\n// The ROTRs are inlined for speed\nfunction B2B_G (a, b, c, d, ix, iy) {\n const x0 = m[ix]\n const x1 = m[ix + 1]\n const y0 = m[iy]\n const y1 = m[iy + 1]\n\n ADD64AA(v, a, b) // v[a,a+1] += v[b,b+1] ... in JS we must store a uint64 as two uint32s\n ADD64AC(v, a, x0, x1) // v[a, a+1] += x ... x0 is the low 32 bits of x, x1 is the high 32 bits\n\n // v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated to the right by 32 bits\n let xor0 = v[d] ^ v[a]\n let xor1 = v[d + 1] ^ v[a + 1]\n v[d] = xor1\n v[d + 1] = xor0\n\n ADD64AA(v, c, d)\n\n // v[b,b+1] = (v[b,b+1] xor v[c,c+1]) rotated right by 24 bits\n xor0 = v[b] ^ v[c]\n xor1 = v[b + 1] ^ v[c + 1]\n v[b] = (xor0 >>> 24) ^ (xor1 << 8)\n v[b + 1] = (xor1 >>> 24) ^ (xor0 << 8)\n\n ADD64AA(v, a, b)\n ADD64AC(v, a, y0, y1)\n\n // v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated right by 16 bits\n xor0 = v[d] ^ v[a]\n xor1 = v[d + 1] ^ v[a + 1]\n v[d] = (xor0 >>> 16) ^ (xor1 << 16)\n v[d + 1] = (xor1 >>> 16) ^ (xor0 << 16)\n\n ADD64AA(v, c, d)\n\n // v[b,b+1] = (v[b,b+1] xor v[c,c+1]) rotated right by 63 bits\n xor0 = v[b] ^ v[c]\n xor1 = v[b + 1] ^ v[c + 1]\n v[b] = (xor1 >>> 31) ^ (xor0 << 1)\n v[b + 1] = (xor0 >>> 31) ^ (xor1 << 1)\n}\n\n// Initialization Vector\nconst BLAKE2B_IV32 = new Uint32Array([\n 0xf3bcc908, 0x6a09e667, 0x84caa73b, 0xbb67ae85, 0xfe94f82b, 0x3c6ef372,\n 0x5f1d36f1, 0xa54ff53a, 0xade682d1, 0x510e527f, 0x2b3e6c1f, 0x9b05688c,\n 0xfb41bd6b, 0x1f83d9ab, 0x137e2179, 0x5be0cd19\n])\n\nconst SIGMA8 = [\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 14, 10, 4, 8, 9, 15, 13,\n 6, 1, 12, 0, 2, 11, 7, 5, 3, 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1,\n 9, 4, 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8, 9, 0, 5, 7, 2, 4,\n 10, 15, 14, 1, 11, 12, 6, 8, 3, 13, 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5,\n 15, 14, 1, 9, 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11, 13, 11, 7,\n 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10, 6, 15, 14, 9, 11, 3, 0, 8, 12, 2,\n 13, 7, 1, 4, 10, 5, 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0, 0,\n 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 14, 10, 4, 8, 9, 15, 13, 6,\n 1, 12, 0, 2, 11, 7, 5, 3\n]\n\n// These are offsets into a uint64 buffer.\n// Multiply them all by 2 to make them offsets into a uint32 buffer,\n// because this is Javascript and we don't have uint64s\nconst SIGMA82 = new Uint8Array(\n SIGMA8.map(function (x) {\n return x * 2\n })\n)\n\n// Compression function. 'last' flag indicates last block.\n// Note we're representing 16 uint64s as 32 uint32s\nconst v = new Uint32Array(32)\nconst m = new Uint32Array(32)\nfunction blake2bCompress (ctx, last) {\n let i = 0\n\n // init work variables\n for (i = 0; i < 16; i++) {\n v[i] = ctx.h[i]\n v[i + 16] = BLAKE2B_IV32[i]\n }\n\n // low 64 bits of offset\n v[24] = v[24] ^ ctx.t\n v[25] = v[25] ^ (ctx.t / 0x100000000)\n // high 64 bits not supported, offset may not be higher than 2**53-1\n\n // last block flag set ?\n if (last) {\n v[28] = ~v[28]\n v[29] = ~v[29]\n }\n\n // get little-endian words\n for (i = 0; i < 32; i++) {\n m[i] = B2B_GET32(ctx.b, 4 * i)\n }\n\n // twelve rounds of mixing\n // uncomment the DebugPrint calls to log the computation\n // and match the RFC sample documentation\n // util.debugPrint(' m[16]', m, 64)\n for (i = 0; i < 12; i++) {\n // util.debugPrint(' (i=' + (i < 10 ? ' ' : '') + i + ') v[16]', v, 64)\n B2B_G(0, 8, 16, 24, SIGMA82[i * 16 + 0], SIGMA82[i * 16 + 1])\n B2B_G(2, 10, 18, 26, SIGMA82[i * 16 + 2], SIGMA82[i * 16 + 3])\n B2B_G(4, 12, 20, 28, SIGMA82[i * 16 + 4], SIGMA82[i * 16 + 5])\n B2B_G(6, 14, 22, 30, SIGMA82[i * 16 + 6], SIGMA82[i * 16 + 7])\n B2B_G(0, 10, 20, 30, SIGMA82[i * 16 + 8], SIGMA82[i * 16 + 9])\n B2B_G(2, 12, 22, 24, SIGMA82[i * 16 + 10], SIGMA82[i * 16 + 11])\n B2B_G(4, 14, 16, 26, SIGMA82[i * 16 + 12], SIGMA82[i * 16 + 13])\n B2B_G(6, 8, 18, 28, SIGMA82[i * 16 + 14], SIGMA82[i * 16 + 15])\n }\n // util.debugPrint(' (i=12) v[16]', v, 64)\n\n for (i = 0; i < 16; i++) {\n ctx.h[i] = ctx.h[i] ^ v[i] ^ v[i + 16]\n }\n // util.debugPrint('h[8]', ctx.h, 64)\n}\n\n// reusable parameterBlock\nconst parameterBlock = new Uint8Array([\n 0,\n 0,\n 0,\n 0, // 0: outlen, keylen, fanout, depth\n 0,\n 0,\n 0,\n 0, // 4: leaf length, sequential mode\n 0,\n 0,\n 0,\n 0, // 8: node offset\n 0,\n 0,\n 0,\n 0, // 12: node offset\n 0,\n 0,\n 0,\n 0, // 16: node depth, inner length, rfu\n 0,\n 0,\n 0,\n 0, // 20: rfu\n 0,\n 0,\n 0,\n 0, // 24: rfu\n 0,\n 0,\n 0,\n 0, // 28: rfu\n 0,\n 0,\n 0,\n 0, // 32: salt\n 0,\n 0,\n 0,\n 0, // 36: salt\n 0,\n 0,\n 0,\n 0, // 40: salt\n 0,\n 0,\n 0,\n 0, // 44: salt\n 0,\n 0,\n 0,\n 0, // 48: personal\n 0,\n 0,\n 0,\n 0, // 52: personal\n 0,\n 0,\n 0,\n 0, // 56: personal\n 0,\n 0,\n 0,\n 0 // 60: personal\n])\n\n// Creates a BLAKE2b hashing context\n// Requires an output length between 1 and 64 bytes\n// Takes an optional Uint8Array key\n// Takes an optinal Uint8Array salt\n// Takes an optinal Uint8Array personal\nfunction blake2bInit (outlen, key, salt, personal) {\n if (outlen === 0 || outlen > 64) {\n throw new Error('Illegal output length, expected 0 < length <= 64')\n }\n if (key && key.length > 64) {\n throw new Error('Illegal key, expected Uint8Array with 0 < length <= 64')\n }\n if (salt && salt.length !== 16) {\n throw new Error('Illegal salt, expected Uint8Array with length is 16')\n }\n if (personal && personal.length !== 16) {\n throw new Error('Illegal personal, expected Uint8Array with length is 16')\n }\n\n // state, 'param block'\n const ctx = {\n b: new Uint8Array(128),\n h: new Uint32Array(16),\n t: 0, // input count\n c: 0, // pointer within buffer\n outlen: outlen // output length in bytes\n }\n\n // initialize parameterBlock before usage\n parameterBlock.fill(0)\n parameterBlock[0] = outlen\n if (key) parameterBlock[1] = key.length\n parameterBlock[2] = 1 // fanout\n parameterBlock[3] = 1 // depth\n if (salt) parameterBlock.set(salt, 32)\n if (personal) parameterBlock.set(personal, 48)\n\n // initialize hash state\n for (let i = 0; i < 16; i++) {\n ctx.h[i] = BLAKE2B_IV32[i] ^ B2B_GET32(parameterBlock, i * 4)\n }\n\n // key the hash, if applicable\n if (key) {\n blake2bUpdate(ctx, key)\n // at the end\n ctx.c = 128\n }\n\n return ctx\n}\n\n// Updates a BLAKE2b streaming hash\n// Requires hash context and Uint8Array (byte array)\nfunction blake2bUpdate (ctx, input) {\n for (let i = 0; i < input.length; i++) {\n if (ctx.c === 128) {\n // buffer full ?\n ctx.t += ctx.c // add counters\n blake2bCompress(ctx, false) // compress (not last)\n ctx.c = 0 // counter to zero\n }\n ctx.b[ctx.c++] = input[i]\n }\n}\n\n// Completes a BLAKE2b streaming hash\n// Returns a Uint8Array containing the message digest\nfunction blake2bFinal (ctx) {\n ctx.t += ctx.c // mark last block offset\n\n while (ctx.c < 128) {\n // fill up with zeros\n ctx.b[ctx.c++] = 0\n }\n blake2bCompress(ctx, true) // final block flag = 1\n\n // little endian convert and store\n const out = new Uint8Array(ctx.outlen)\n for (let i = 0; i < ctx.outlen; i++) {\n out[i] = ctx.h[i >> 2] >> (8 * (i & 3))\n }\n return out\n}\n\n// Computes the BLAKE2B hash of a string or byte array, and returns a Uint8Array\n//\n// Returns a n-byte Uint8Array\n//\n// Parameters:\n// - input - the input bytes, as a string, Buffer or Uint8Array\n// - key - optional key Uint8Array, up to 64 bytes\n// - outlen - optional output length in bytes, default 64\n// - salt - optional salt bytes, string, Buffer or Uint8Array\n// - personal - optional personal bytes, string, Buffer or Uint8Array\nfunction blake2b (input, key, outlen, salt, personal) {\n // preprocess inputs\n outlen = outlen || 64\n input = util.normalizeInput(input)\n if (salt) {\n salt = util.normalizeInput(salt)\n }\n if (personal) {\n personal = util.normalizeInput(personal)\n }\n\n // do the math\n const ctx = blake2bInit(outlen, key, salt, personal)\n blake2bUpdate(ctx, input)\n return blake2bFinal(ctx)\n}\n\n// Computes the BLAKE2B hash of a string or byte array\n//\n// Returns an n-byte hash in hex, all lowercase\n//\n// Parameters:\n// - input - the input bytes, as a string, Buffer, or Uint8Array\n// - key - optional key Uint8Array, up to 64 bytes\n// - outlen - optional output length in bytes, default 64\n// - salt - optional salt bytes, string, Buffer or Uint8Array\n// - personal - optional personal bytes, string, Buffer or Uint8Array\nfunction blake2bHex (input, key, outlen, salt, personal) {\n const output = blake2b(input, key, outlen, salt, personal)\n return util.toHex(output)\n}\n\nmodule.exports = {\n blake2b: blake2b,\n blake2bHex: blake2bHex,\n blake2bInit: blake2bInit,\n blake2bUpdate: blake2bUpdate,\n blake2bFinal: blake2bFinal\n}\n","const ERROR_MSG_INPUT = 'Input must be an string, Buffer or Uint8Array'\n\n// For convenience, let people hash a string, not just a Uint8Array\nfunction normalizeInput (input) {\n let ret\n if (input instanceof Uint8Array) {\n ret = input\n } else if (typeof input === 'string') {\n const encoder = new TextEncoder()\n ret = encoder.encode(input)\n } else {\n throw new Error(ERROR_MSG_INPUT)\n }\n return ret\n}\n\n// Converts a Uint8Array to a hexadecimal string\n// For example, toHex([255, 0, 255]) returns \"ff00ff\"\nfunction toHex (bytes) {\n return Array.prototype.map\n .call(bytes, function (n) {\n return (n < 16 ? '0' : '') + n.toString(16)\n })\n .join('')\n}\n\n// Converts any value in [0...2^32-1] to an 8-character hex string\nfunction uint32ToHex (val) {\n return (0x100000000 + val).toString(16).substring(1)\n}\n\n// For debugging: prints out hash state in the same format as the RFC\n// sample computation exactly, so that you can diff\nfunction debugPrint (label, arr, size) {\n let msg = '\\n' + label + ' = '\n for (let i = 0; i < arr.length; i += 2) {\n if (size === 32) {\n msg += uint32ToHex(arr[i]).toUpperCase()\n msg += ' '\n msg += uint32ToHex(arr[i + 1]).toUpperCase()\n } else if (size === 64) {\n msg += uint32ToHex(arr[i + 1]).toUpperCase()\n msg += uint32ToHex(arr[i]).toUpperCase()\n } else throw new Error('Invalid size ' + size)\n if (i % 6 === 4) {\n msg += '\\n' + new Array(label.length + 4).join(' ')\n } else if (i < arr.length - 2) {\n msg += ' '\n }\n }\n console.log(msg)\n}\n\n// For performance testing: generates N bytes of input, hashes M times\n// Measures and prints MB/second hash performance each time\nfunction testSpeed (hashFn, N, M) {\n let startMs = new Date().getTime()\n\n const input = new Uint8Array(N)\n for (let i = 0; i < N; i++) {\n input[i] = i % 256\n }\n const genMs = new Date().getTime()\n console.log('Generated random input in ' + (genMs - startMs) + 'ms')\n startMs = genMs\n\n for (let i = 0; i < M; i++) {\n const hashHex = hashFn(input)\n const hashMs = new Date().getTime()\n const ms = hashMs - startMs\n startMs = hashMs\n console.log('Hashed in ' + ms + 'ms: ' + hashHex.substring(0, 20) + '...')\n console.log(\n Math.round((N / (1 << 20) / (ms / 1000)) * 100) / 100 + ' MB PER SECOND'\n )\n }\n}\n\nmodule.exports = {\n normalizeInput: normalizeInput,\n toHex: toHex,\n debugPrint: debugPrint,\n testSpeed: testSpeed\n}\n","var parent = require('../../stable/object/define-property');\n\nmodule.exports = parent;\n","require('../../../modules/es.array.includes');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').includes;\n","var isPrototypeOf = require('../../internals/object-is-prototype-of');\nvar arrayMethod = require('../array/virtual/includes');\nvar stringMethod = require('../string/virtual/includes');\n\nvar ArrayPrototype = Array.prototype;\nvar StringPrototype = String.prototype;\n\nmodule.exports = function (it) {\n var own = it.includes;\n if (it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.includes)) return arrayMethod;\n if (typeof it == 'string' || it === StringPrototype || (isPrototypeOf(StringPrototype, it) && own === StringPrototype.includes)) {\n return stringMethod;\n } return own;\n};\n","require('../../modules/es.object.define-property');\nvar path = require('../../internals/path');\n\nvar Object = path.Object;\n\nvar defineProperty = module.exports = function defineProperty(it, key, desc) {\n return Object.defineProperty(it, key, desc);\n};\n\nif (Object.defineProperty.sham) defineProperty.sham = true;\n","require('../../../modules/es.string.includes');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('String').includes;\n","module.exports = require('../../full/object/define-property');\n","var parent = require('../../actual/object/define-property');\n\nmodule.exports = parent;\n","var isCallable = require('../internals/is-callable');\nvar tryToString = require('../internals/try-to-string');\n\nvar $TypeError = TypeError;\n\n// `Assert: IsCallable(argument) is true`\nmodule.exports = function (argument) {\n if (isCallable(argument)) return argument;\n throw $TypeError(tryToString(argument) + ' is not a function');\n};\n","module.exports = function () { /* empty */ };\n","var isObject = require('../internals/is-object');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\n// `Assert: Type(argument) is Object`\nmodule.exports = function (argument) {\n if (isObject(argument)) return argument;\n throw $TypeError($String(argument) + ' is not an object');\n};\n","var toIndexedObject = require('../internals/to-indexed-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = lengthOfArrayLike(O);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare -- NaN check\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare -- NaN check\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.es/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.es/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nvar toString = uncurryThis({}.toString);\nvar stringSlice = uncurryThis(''.slice);\n\nmodule.exports = function (it) {\n return stringSlice(toString(it), 8, -1);\n};\n","var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar isCallable = require('../internals/is-callable');\nvar classofRaw = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar $Object = Object;\n\n// ES3 wrong here\nvar CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (error) { /* empty */ }\n};\n\n// getting tag from ES6+ `Object.prototype.toString`\nmodule.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {\n var O, tag, result;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag\n // builtinTag case\n : CORRECT_ARGUMENTS ? classofRaw(O)\n // ES3 arguments fallback\n : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar MATCH = wellKnownSymbol('match');\n\nmodule.exports = function (METHOD_NAME) {\n var regexp = /./;\n try {\n '/./'[METHOD_NAME](regexp);\n } catch (error1) {\n try {\n regexp[MATCH] = false;\n return '/./'[METHOD_NAME](regexp);\n } catch (error2) { /* empty */ }\n } return false;\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var global = require('../internals/global');\n\n// eslint-disable-next-line es-x/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\n\nmodule.exports = function (key, value) {\n try {\n defineProperty(global, key, { value: value, configurable: true, writable: true });\n } catch (error) {\n global[key] = value;\n } return value;\n};\n","var fails = require('../internals/fails');\n\n// Detect IE8's incomplete defineProperty implementation\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;\n});\n","var global = require('../internals/global');\nvar isObject = require('../internals/is-object');\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('navigator', 'userAgent') || '';\n","var global = require('../internals/global');\nvar userAgent = require('../internals/engine-user-agent');\n\nvar process = global.process;\nvar Deno = global.Deno;\nvar versions = process && process.versions || Deno && Deno.version;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n // in old Chrome, versions of V8 isn't V8 = Chrome / 10\n // but their correct versions are not interesting for us\n version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);\n}\n\n// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`\n// so check `userAgent` even if `.v8` exists, but 0\nif (!version && userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = +match[1];\n }\n}\n\nmodule.exports = version;\n","var path = require('../internals/path');\n\nmodule.exports = function (CONSTRUCTOR) {\n return path[CONSTRUCTOR + 'Prototype'];\n};\n","'use strict';\nvar global = require('../internals/global');\nvar apply = require('../internals/function-apply');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar isCallable = require('../internals/is-callable');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar isForced = require('../internals/is-forced');\nvar path = require('../internals/path');\nvar bind = require('../internals/function-bind-context');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar hasOwn = require('../internals/has-own-property');\n\nvar wrapConstructor = function (NativeConstructor) {\n var Wrapper = function (a, b, c) {\n if (this instanceof Wrapper) {\n switch (arguments.length) {\n case 0: return new NativeConstructor();\n case 1: return new NativeConstructor(a);\n case 2: return new NativeConstructor(a, b);\n } return new NativeConstructor(a, b, c);\n } return apply(NativeConstructor, this, arguments);\n };\n Wrapper.prototype = NativeConstructor.prototype;\n return Wrapper;\n};\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.dontCallGetSet - prevent calling a getter on target\n options.name - the .name of the function if it does not match the key\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var PROTO = options.proto;\n\n var nativeSource = GLOBAL ? global : STATIC ? global[TARGET] : (global[TARGET] || {}).prototype;\n\n var target = GLOBAL ? path : path[TARGET] || createNonEnumerableProperty(path, TARGET, {})[TARGET];\n var targetPrototype = target.prototype;\n\n var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;\n var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;\n\n for (key in source) {\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contains in native\n USE_NATIVE = !FORCED && nativeSource && hasOwn(nativeSource, key);\n\n targetProperty = target[key];\n\n if (USE_NATIVE) if (options.dontCallGetSet) {\n descriptor = getOwnPropertyDescriptor(nativeSource, key);\n nativeProperty = descriptor && descriptor.value;\n } else nativeProperty = nativeSource[key];\n\n // export native or implementation\n sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key];\n\n if (USE_NATIVE && typeof targetProperty == typeof sourceProperty) continue;\n\n // bind timers to global for call from export context\n if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, global);\n // wrap global constructors for prevent changs in this version\n else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);\n // make static versions for prototype methods\n else if (PROTO && isCallable(sourceProperty)) resultProperty = uncurryThis(sourceProperty);\n // default case\n else resultProperty = sourceProperty;\n\n // add a flag to not completely full polyfills\n if (options.sham || (sourceProperty && sourceProperty.sham) || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(resultProperty, 'sham', true);\n }\n\n createNonEnumerableProperty(target, key, resultProperty);\n\n if (PROTO) {\n VIRTUAL_PROTOTYPE = TARGET + 'Prototype';\n if (!hasOwn(path, VIRTUAL_PROTOTYPE)) {\n createNonEnumerableProperty(path, VIRTUAL_PROTOTYPE, {});\n }\n // export virtual prototype methods\n createNonEnumerableProperty(path[VIRTUAL_PROTOTYPE], key, sourceProperty);\n // export real prototype methods\n if (options.real && targetPrototype && !targetPrototype[key]) {\n createNonEnumerableProperty(targetPrototype, key, sourceProperty);\n }\n }\n }\n};\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n","var NATIVE_BIND = require('../internals/function-bind-native');\n\nvar FunctionPrototype = Function.prototype;\nvar apply = FunctionPrototype.apply;\nvar call = FunctionPrototype.call;\n\n// eslint-disable-next-line es-x/no-reflect -- safe\nmodule.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {\n return call.apply(apply, arguments);\n});\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar aCallable = require('../internals/a-callable');\nvar NATIVE_BIND = require('../internals/function-bind-native');\n\nvar bind = uncurryThis(uncurryThis.bind);\n\n// optional / simple context binding\nmodule.exports = function (fn, that) {\n aCallable(fn);\n return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","var fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es-x/no-function-prototype-bind -- safe\n var test = (function () { /* empty */ }).bind();\n // eslint-disable-next-line no-prototype-builtins -- safe\n return typeof test != 'function' || test.hasOwnProperty('prototype');\n});\n","var NATIVE_BIND = require('../internals/function-bind-native');\n\nvar call = Function.prototype.call;\n\nmodule.exports = NATIVE_BIND ? call.bind(call) : function () {\n return call.apply(call, arguments);\n};\n","var NATIVE_BIND = require('../internals/function-bind-native');\n\nvar FunctionPrototype = Function.prototype;\nvar bind = FunctionPrototype.bind;\nvar call = FunctionPrototype.call;\nvar uncurryThis = NATIVE_BIND && bind.bind(call, call);\n\nmodule.exports = NATIVE_BIND ? function (fn) {\n return fn && uncurryThis(fn);\n} : function (fn) {\n return fn && function () {\n return call.apply(fn, arguments);\n };\n};\n","var path = require('../internals/path');\nvar global = require('../internals/global');\nvar isCallable = require('../internals/is-callable');\n\nvar aFunction = function (variable) {\n return isCallable(variable) ? variable : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])\n : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];\n};\n","var aCallable = require('../internals/a-callable');\n\n// `GetMethod` abstract operation\n// https://tc39.es/ecma262/#sec-getmethod\nmodule.exports = function (V, P) {\n var func = V[P];\n return func == null ? undefined : aCallable(func);\n};\n","var check = function (it) {\n return it && it.Math == Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line es-x/no-global-this -- safe\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n // eslint-disable-next-line no-restricted-globals -- safe\n check(typeof self == 'object' && self) ||\n check(typeof global == 'object' && global) ||\n // eslint-disable-next-line no-new-func -- fallback\n (function () { return this; })() || Function('return this')();\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar toObject = require('../internals/to-object');\n\nvar hasOwnProperty = uncurryThis({}.hasOwnProperty);\n\n// `HasOwnProperty` abstract operation\n// https://tc39.es/ecma262/#sec-hasownproperty\n// eslint-disable-next-line es-x/no-object-hasown -- safe\nmodule.exports = Object.hasOwn || function hasOwn(it, key) {\n return hasOwnProperty(toObject(it), key);\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar createElement = require('../internals/document-create-element');\n\n// Thanks to IE8 for its funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a != 7;\n});\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\n\nvar $Object = Object;\nvar split = uncurryThis(''.split);\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins -- safe\n return !$Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) == 'String' ? split(it, '') : $Object(it);\n} : $Object;\n","// `IsCallable` abstract operation\n// https://tc39.es/ecma262/#sec-iscallable\nmodule.exports = function (argument) {\n return typeof argument == 'function';\n};\n","var fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value == POLYFILL ? true\n : value == NATIVE ? false\n : isCallable(detection) ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n","var isCallable = require('../internals/is-callable');\n\nmodule.exports = function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it);\n};\n","module.exports = true;\n","var isObject = require('../internals/is-object');\nvar classof = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar MATCH = wellKnownSymbol('match');\n\n// `IsRegExp` abstract operation\n// https://tc39.es/ecma262/#sec-isregexp\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');\n};\n","var getBuiltIn = require('../internals/get-built-in');\nvar isCallable = require('../internals/is-callable');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar $Object = Object;\n\nmodule.exports = USE_SYMBOL_AS_UID ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n var $Symbol = getBuiltIn('Symbol');\n return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));\n};\n","var toLength = require('../internals/to-length');\n\n// `LengthOfArrayLike` abstract operation\n// https://tc39.es/ecma262/#sec-lengthofarraylike\nmodule.exports = function (obj) {\n return toLength(obj.length);\n};\n","var ceil = Math.ceil;\nvar floor = Math.floor;\n\n// `Math.trunc` method\n// https://tc39.es/ecma262/#sec-math.trunc\n// eslint-disable-next-line es-x/no-math-trunc -- safe\nmodule.exports = Math.trunc || function trunc(x) {\n var n = +x;\n return (n > 0 ? floor : ceil)(n);\n};\n","/* eslint-disable es-x/no-symbol -- required for testing */\nvar V8_VERSION = require('../internals/engine-v8-version');\nvar fails = require('../internals/fails');\n\n// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n var symbol = Symbol();\n // Chrome 38 Symbol has incorrect toString conversion\n // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances\n return !String(symbol) || !(Object(symbol) instanceof Symbol) ||\n // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances\n !Symbol.sham && V8_VERSION && V8_VERSION < 41;\n});\n","var isRegExp = require('../internals/is-regexp');\n\nvar $TypeError = TypeError;\n\nmodule.exports = function (it) {\n if (isRegExp(it)) {\n throw $TypeError(\"The method doesn't accept regular expressions\");\n } return it;\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\nvar V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug');\nvar anObject = require('../internals/an-object');\nvar toPropertyKey = require('../internals/to-property-key');\n\nvar $TypeError = TypeError;\n// eslint-disable-next-line es-x/no-object-defineproperty -- safe\nvar $defineProperty = Object.defineProperty;\n// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar ENUMERABLE = 'enumerable';\nvar CONFIGURABLE = 'configurable';\nvar WRITABLE = 'writable';\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {\n var current = $getOwnPropertyDescriptor(O, P);\n if (current && current[WRITABLE]) {\n O[P] = Attributes.value;\n Attributes = {\n configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],\n enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],\n writable: false\n };\n }\n } return $defineProperty(O, P, Attributes);\n} : $defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return $defineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar call = require('../internals/function-call');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPropertyKey = require('../internals/to-property-key');\nvar hasOwn = require('../internals/has-own-property');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\n\n// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPropertyKey(P);\n if (IE8_DOM_DEFINE) try {\n return $getOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = uncurryThis({}.isPrototypeOf);\n","'use strict';\nvar $propertyIsEnumerable = {}.propertyIsEnumerable;\n// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : $propertyIsEnumerable;\n","var call = require('../internals/function-call');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\n\nvar $TypeError = TypeError;\n\n// `OrdinaryToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-ordinarytoprimitive\nmodule.exports = function (input, pref) {\n var fn, val;\n if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;\n if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n throw $TypeError(\"Can't convert object to primitive value\");\n};\n","module.exports = {};\n","var $TypeError = TypeError;\n\n// `RequireObjectCoercible` abstract operation\n// https://tc39.es/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n if (it == undefined) throw $TypeError(\"Can't call method on \" + it);\n return it;\n};\n","var global = require('../internals/global');\nvar defineGlobalProperty = require('../internals/define-global-property');\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || defineGlobalProperty(SHARED, {});\n\nmodule.exports = store;\n","var IS_PURE = require('../internals/is-pure');\nvar store = require('../internals/shared-store');\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.24.0',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',\n license: 'https://github.com/zloirock/core-js/blob/v3.24.0/LICENSE',\n source: 'https://github.com/zloirock/core-js'\n});\n","var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar max = Math.max;\nvar min = Math.min;\n\n// Helper for a popular repeating case of the spec:\n// Let integer be ? ToInteger(index).\n// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).\nmodule.exports = function (index, length) {\n var integer = toIntegerOrInfinity(index);\n return integer < 0 ? max(integer + length, 0) : min(integer, length);\n};\n","// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = require('../internals/indexed-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n","var trunc = require('../internals/math-trunc');\n\n// `ToIntegerOrInfinity` abstract operation\n// https://tc39.es/ecma262/#sec-tointegerorinfinity\nmodule.exports = function (argument) {\n var number = +argument;\n // eslint-disable-next-line no-self-compare -- NaN check\n return number !== number || number === 0 ? 0 : trunc(number);\n};\n","var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.es/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","var requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar $Object = Object;\n\n// `ToObject` abstract operation\n// https://tc39.es/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return $Object(requireObjectCoercible(argument));\n};\n","var call = require('../internals/function-call');\nvar isObject = require('../internals/is-object');\nvar isSymbol = require('../internals/is-symbol');\nvar getMethod = require('../internals/get-method');\nvar ordinaryToPrimitive = require('../internals/ordinary-to-primitive');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar $TypeError = TypeError;\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n// `ToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-toprimitive\nmodule.exports = function (input, pref) {\n if (!isObject(input) || isSymbol(input)) return input;\n var exoticToPrim = getMethod(input, TO_PRIMITIVE);\n var result;\n if (exoticToPrim) {\n if (pref === undefined) pref = 'default';\n result = call(exoticToPrim, input, pref);\n if (!isObject(result) || isSymbol(result)) return result;\n throw $TypeError(\"Can't convert object to primitive value\");\n }\n if (pref === undefined) pref = 'number';\n return ordinaryToPrimitive(input, pref);\n};\n","var toPrimitive = require('../internals/to-primitive');\nvar isSymbol = require('../internals/is-symbol');\n\n// `ToPropertyKey` abstract operation\n// https://tc39.es/ecma262/#sec-topropertykey\nmodule.exports = function (argument) {\n var key = toPrimitive(argument, 'string');\n return isSymbol(key) ? key : key + '';\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar test = {};\n\ntest[TO_STRING_TAG] = 'z';\n\nmodule.exports = String(test) === '[object z]';\n","var classof = require('../internals/classof');\n\nvar $String = String;\n\nmodule.exports = function (argument) {\n if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');\n return $String(argument);\n};\n","var $String = String;\n\nmodule.exports = function (argument) {\n try {\n return $String(argument);\n } catch (error) {\n return 'Object';\n }\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nvar id = 0;\nvar postfix = Math.random();\nvar toString = uncurryThis(1.0.toString);\n\nmodule.exports = function (key) {\n return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);\n};\n","/* eslint-disable es-x/no-symbol -- required for testing */\nvar NATIVE_SYMBOL = require('../internals/native-symbol');\n\nmodule.exports = NATIVE_SYMBOL\n && !Symbol.sham\n && typeof Symbol.iterator == 'symbol';\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\n\n// V8 ~ Chrome 36-\n// https://bugs.chromium.org/p/v8/issues/detail?id=3334\nmodule.exports = DESCRIPTORS && fails(function () {\n // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing\n return Object.defineProperty(function () { /* empty */ }, 'prototype', {\n value: 42,\n writable: false\n }).prototype != 42;\n});\n","var global = require('../internals/global');\nvar shared = require('../internals/shared');\nvar hasOwn = require('../internals/has-own-property');\nvar uid = require('../internals/uid');\nvar NATIVE_SYMBOL = require('../internals/native-symbol');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar WellKnownSymbolsStore = shared('wks');\nvar Symbol = global.Symbol;\nvar symbolFor = Symbol && Symbol['for'];\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {\n var description = 'Symbol.' + name;\n if (NATIVE_SYMBOL && hasOwn(Symbol, name)) {\n WellKnownSymbolsStore[name] = Symbol[name];\n } else if (USE_SYMBOL_AS_UID && symbolFor) {\n WellKnownSymbolsStore[name] = symbolFor(description);\n } else {\n WellKnownSymbolsStore[name] = createWellKnownSymbol(description);\n }\n } return WellKnownSymbolsStore[name];\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar $includes = require('../internals/array-includes').includes;\nvar fails = require('../internals/fails');\nvar addToUnscopables = require('../internals/add-to-unscopables');\n\n// FF99+ bug\nvar BROKEN_ON_SPARSE = fails(function () {\n return !Array(1).includes();\n});\n\n// `Array.prototype.includes` method\n// https://tc39.es/ecma262/#sec-array.prototype.includes\n$({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {\n includes: function includes(el /* , fromIndex = 0 */) {\n return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('includes');\n","var $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar defineProperty = require('../internals/object-define-property').f;\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\n// eslint-disable-next-line es-x/no-object-defineproperty -- safe\n$({ target: 'Object', stat: true, forced: Object.defineProperty !== defineProperty, sham: !DESCRIPTORS }, {\n defineProperty: defineProperty\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar notARegExp = require('../internals/not-a-regexp');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar toString = require('../internals/to-string');\nvar correctIsRegExpLogic = require('../internals/correct-is-regexp-logic');\n\nvar stringIndexOf = uncurryThis(''.indexOf);\n\n// `String.prototype.includes` method\n// https://tc39.es/ecma262/#sec-string.prototype.includes\n$({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {\n includes: function includes(searchString /* , position = 0 */) {\n return !!~stringIndexOf(\n toString(requireObjectCoercible(this)),\n toString(notARegExp(searchString)),\n arguments.length > 1 ? arguments[1] : undefined\n );\n }\n});\n","var parent = require('../../es/instance/includes');\n\nmodule.exports = parent;\n","var parent = require('../../es/object/define-property');\n\nmodule.exports = parent;\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */\n/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.prototype = Object.create(Buffer.prototype)\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","var Buffer = require('safe-buffer').Buffer\n\n// prototype class for hash functions\nfunction Hash (blockSize, finalSize) {\n this._block = Buffer.alloc(blockSize)\n this._finalSize = finalSize\n this._blockSize = blockSize\n this._len = 0\n}\n\nHash.prototype.update = function (data, enc) {\n if (typeof data === 'string') {\n enc = enc || 'utf8'\n data = Buffer.from(data, enc)\n }\n\n var block = this._block\n var blockSize = this._blockSize\n var length = data.length\n var accum = this._len\n\n for (var offset = 0; offset < length;) {\n var assigned = accum % blockSize\n var remainder = Math.min(length - offset, blockSize - assigned)\n\n for (var i = 0; i < remainder; i++) {\n block[assigned + i] = data[offset + i]\n }\n\n accum += remainder\n offset += remainder\n\n if ((accum % blockSize) === 0) {\n this._update(block)\n }\n }\n\n this._len += length\n return this\n}\n\nHash.prototype.digest = function (enc) {\n var rem = this._len % this._blockSize\n\n this._block[rem] = 0x80\n\n // zero (rem + 1) trailing bits, where (rem + 1) is the smallest\n // non-negative solution to the equation (length + 1 + (rem + 1)) === finalSize mod blockSize\n this._block.fill(0, rem + 1)\n\n if (rem >= this._finalSize) {\n this._update(this._block)\n this._block.fill(0)\n }\n\n var bits = this._len * 8\n\n // uint32\n if (bits <= 0xffffffff) {\n this._block.writeUInt32BE(bits, this._blockSize - 4)\n\n // uint64\n } else {\n var lowBits = (bits & 0xffffffff) >>> 0\n var highBits = (bits - lowBits) / 0x100000000\n\n this._block.writeUInt32BE(highBits, this._blockSize - 8)\n this._block.writeUInt32BE(lowBits, this._blockSize - 4)\n }\n\n this._update(this._block)\n var hash = this._hash()\n\n return enc ? hash.toString(enc) : hash\n}\n\nHash.prototype._update = function () {\n throw new Error('_update must be implemented by subclass')\n}\n\nmodule.exports = Hash\n","/**\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined\n * in FIPS 180-2\n * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n *\n */\n\nvar inherits = require('inherits')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar K = [\n 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,\n 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,\n 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,\n 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,\n 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,\n 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,\n 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,\n 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,\n 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,\n 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,\n 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,\n 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,\n 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,\n 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,\n 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,\n 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2\n]\n\nvar W = new Array(64)\n\nfunction Sha256 () {\n this.init()\n\n this._w = W // new Array(64)\n\n Hash.call(this, 64, 56)\n}\n\ninherits(Sha256, Hash)\n\nSha256.prototype.init = function () {\n this._a = 0x6a09e667\n this._b = 0xbb67ae85\n this._c = 0x3c6ef372\n this._d = 0xa54ff53a\n this._e = 0x510e527f\n this._f = 0x9b05688c\n this._g = 0x1f83d9ab\n this._h = 0x5be0cd19\n\n return this\n}\n\nfunction ch (x, y, z) {\n return z ^ (x & (y ^ z))\n}\n\nfunction maj (x, y, z) {\n return (x & y) | (z & (x | y))\n}\n\nfunction sigma0 (x) {\n return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10)\n}\n\nfunction sigma1 (x) {\n return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7)\n}\n\nfunction gamma0 (x) {\n return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3)\n}\n\nfunction gamma1 (x) {\n return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10)\n}\n\nSha256.prototype._update = function (M) {\n var W = this._w\n\n var a = this._a | 0\n var b = this._b | 0\n var c = this._c | 0\n var d = this._d | 0\n var e = this._e | 0\n var f = this._f | 0\n var g = this._g | 0\n var h = this._h | 0\n\n for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)\n for (; i < 64; ++i) W[i] = (gamma1(W[i - 2]) + W[i - 7] + gamma0(W[i - 15]) + W[i - 16]) | 0\n\n for (var j = 0; j < 64; ++j) {\n var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + W[j]) | 0\n var T2 = (sigma0(a) + maj(a, b, c)) | 0\n\n h = g\n g = f\n f = e\n e = (d + T1) | 0\n d = c\n c = b\n b = a\n a = (T1 + T2) | 0\n }\n\n this._a = (a + this._a) | 0\n this._b = (b + this._b) | 0\n this._c = (c + this._c) | 0\n this._d = (d + this._d) | 0\n this._e = (e + this._e) | 0\n this._f = (f + this._f) | 0\n this._g = (g + this._g) | 0\n this._h = (h + this._h) | 0\n}\n\nSha256.prototype._hash = function () {\n var H = Buffer.allocUnsafe(32)\n\n H.writeInt32BE(this._a, 0)\n H.writeInt32BE(this._b, 4)\n H.writeInt32BE(this._c, 8)\n H.writeInt32BE(this._d, 12)\n H.writeInt32BE(this._e, 16)\n H.writeInt32BE(this._f, 20)\n H.writeInt32BE(this._g, 24)\n H.writeInt32BE(this._h, 28)\n\n return H\n}\n\nmodule.exports = Sha256\n","module.exports = __WEBPACK_EXTERNAL_MODULE__7946__;","module.exports = __WEBPACK_EXTERNAL_MODULE__7289__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3983__;","module.exports = __WEBPACK_EXTERNAL_MODULE__4711__;","module.exports = __WEBPACK_EXTERNAL_MODULE__5039__;","module.exports = __WEBPACK_EXTERNAL_MODULE__8236__;","module.exports = __WEBPACK_EXTERNAL_MODULE__5192__;","module.exports = __WEBPACK_EXTERNAL_MODULE__1986__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3783__;","module.exports = __WEBPACK_EXTERNAL_MODULE__9408__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3735__;","module.exports = __WEBPACK_EXTERNAL_MODULE__2716__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3485__;","module.exports = __WEBPACK_EXTERNAL_MODULE__79__;","module.exports = __WEBPACK_EXTERNAL_MODULE__9882__;","module.exports = __WEBPACK_EXTERNAL_MODULE__7480__;","module.exports = __WEBPACK_EXTERNAL_MODULE__8079__;","module.exports = require(\"core-js-pure/stable/instance/includes\");","module.exports = require(\"core-js-pure/features/object/define-property\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Big Number Helpers\n */\nimport BigNumber from 'bignumber.js';\n\n/**\n * Check if value is BigNumber, Number, BigInt or number string representation\n * @param number - number to check\n */\nexport const isBigNumber = (number: string | number | bigint | BigNumber): boolean => {\n if (typeof number === 'bigint') return true;\n return ['number', 'object', 'string'].includes(typeof number)\n // eslint-disable-next-line no-restricted-globals\n && (!isNaN(number as number) || Number.isInteger(number) || BigNumber.isBigNumber(number));\n};\n\n/**\n * BigNumber ceil operation\n */\nexport const ceil = (bigNumber: BigNumber): BigNumber => bigNumber\n .integerValue(BigNumber.ROUND_CEIL);\n","// eslint-disable-next-line max-classes-per-file\nimport BigNumber from 'bignumber.js';\n\n/**\n * aepp-sdk originated error\n * @category exception\n */\nexport abstract class BaseError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'BaseError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AccountError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'AccountError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AensError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'AensError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AeppError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'AeppError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ChannelError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'ChannelError';\n }\n}\n\n/**\n * @category exception\n */\nexport class CompilerError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'CompilerError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ContractError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'ContractError';\n }\n}\n\n/**\n * @category exception\n */\nexport class CryptographyError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'CryptographyError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NodeError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'NodeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TransactionError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'TransactionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class WalletError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'WalletError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ArgumentError extends BaseError {\n constructor(argumentName: string, requirement: string, argumentValue: any) {\n super(`${argumentName} should be ${requirement}, got ${String(argumentValue)} instead`);\n this.name = 'ArgumentError';\n }\n}\n\n/**\n * @category exception\n */\nexport class IllegalArgumentError extends CryptographyError {\n constructor(message: string) {\n super(message);\n this.name = 'IllegalArgumentError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ArgumentCountMismatchError extends BaseError {\n constructor(functionName: string, requiredCount: number, providedCount: number) {\n super(`${functionName} expects ${requiredCount} arguments, got ${providedCount} instead`);\n this.name = 'ArgumentCountMismatchError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InsufficientBalanceError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'InsufficientBalanceError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingParamError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'MissingParamError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NoSerializerFoundError extends BaseError {\n constructor() {\n super('Byte serialization not supported');\n this.name = 'NoSerializerFoundError';\n }\n}\n\n/**\n * @category exception\n */\nexport class RequestTimedOutError extends BaseError {\n constructor(height: number) {\n super(`Giving up at height ${height}`);\n this.name = 'RequestTimedOutError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TxTimedOutError extends BaseError {\n constructor(blocks: number, th: string) {\n super([\n `Giving up after ${blocks} blocks mined`,\n `transaction hash: ${th}`,\n ].join(', '));\n this.name = 'TxTimedOutError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TypeError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'TypeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsupportedPlatformError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'UnsupportedPlatformError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsupportedProtocolError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'UnsupportedProtocolError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NotImplementedError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'NotImplementedError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsupportedVersionError extends BaseError {\n constructor(dependency: string, version: string, geVersion: string, ltVersion: string) {\n super(`Unsupported ${dependency} version ${version}. Supported: >= ${geVersion} < ${ltVersion}`);\n this.name = 'UnsupportedVersionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InternalError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'InternalError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnexpectedTsError extends InternalError {\n constructor(message = 'Expected to not happen, required for TS') {\n super(message);\n this.name = 'UnexpectedTsError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidKeypairError extends AccountError {\n constructor(message: string) {\n super(message);\n this.name = 'InvalidKeypairError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnavailableAccountError extends AccountError {\n constructor(address: string) {\n super(`Account for ${address} not available`);\n this.name = 'UnavailableAccountError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AensPointerContextError extends AensError {\n constructor(nameOrId: string, prefix: string) {\n super(`Name ${nameOrId} don't have pointers for ${prefix}`);\n this.name = 'AensPointerContextError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InsufficientNameFeeError extends AensError {\n constructor(nameFee: BigNumber, minNameFee: BigNumber) {\n super(`the provided fee ${nameFee.toString()} is not enough to execute the claim, required: ${minNameFee.toString()}`);\n this.name = 'InsufficientNameFeeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidAensNameError extends AensError {\n constructor(message: string) {\n super(message);\n this.name = 'InvalidAensNameError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidRpcMessageError extends AeppError {\n constructor(message: string) {\n super(`Received invalid message: ${message}`);\n this.name = 'InvalidRpcMessageError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingCallbackError extends AeppError {\n constructor(id: number) {\n super(`Can't find callback for this messageId ${id}`);\n this.name = 'MissingCallbackError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnAuthorizedAccountError extends AeppError {\n constructor(onAccount: string) {\n super(`You do not have access to account ${onAccount}`);\n this.name = 'UnAuthorizedAccountError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnknownRpcClientError extends AeppError {\n constructor(id: string) {\n super(`RpcClient with id ${id} do not exist`);\n this.name = 'UnknownRpcClientError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsubscribedAccountError extends AeppError {\n constructor() {\n super('You are not subscribed for an account.');\n this.name = 'UnsubscribedAccountError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ChannelCallError extends ChannelError {\n constructor(message: string) {\n super(message);\n this.name = 'ChannelCallError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ChannelConnectionError extends ChannelError {\n constructor(message: string) {\n super(message);\n this.name = 'ChannelConnectionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ChannelPingTimedOutError extends ChannelError {\n constructor() {\n super('Server pong timed out');\n this.name = 'ChannelPingTimedOutError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnexpectedChannelMessageError extends ChannelError {\n constructor(message: string) {\n super(message);\n this.name = 'UnexpectedChannelMessageError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnknownChannelStateError extends ChannelError {\n constructor() {\n super('State Channels FSM entered unknown state');\n this.name = 'UnknownChannelStateError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidAuthDataError extends CompilerError {\n constructor(message: string) {\n super(message);\n this.name = 'InvalidAuthDataError';\n }\n}\n\n/**\n * @category exception\n */\nexport class BytecodeMismatchError extends ContractError {\n constructor(source: string) {\n super(`Contract ${source} do not correspond to the bytecode deployed on the chain`);\n this.name = 'BytecodeMismatchError';\n }\n}\n\n/**\n * @category exception\n */\nexport class DuplicateContractError extends ContractError {\n constructor() {\n super('Contract already deployed');\n this.name = 'DuplicateContractError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InactiveContractError extends ContractError {\n constructor(contractAddress: string) {\n super(`Contract with address ${contractAddress} not active`);\n this.name = 'InactiveContractError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidMethodInvocationError extends ContractError {\n constructor(message: string) {\n super(message);\n this.name = 'InvalidMethodInvocationError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingContractAddressError extends ContractError {\n constructor(message: string) {\n super(message);\n this.name = 'MissingContractAddressError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingContractDefError extends ContractError {\n constructor() {\n super('Either ACI or source code is required');\n this.name = 'MissingContractDefError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingFunctionNameError extends ContractError {\n constructor() {\n super('Function name is required');\n this.name = 'MissingFunctionNameError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NodeInvocationError extends ContractError {\n transaction: string;\n\n constructor(message: string, transaction: string) {\n super(`Invocation failed${message == null ? '' : `: \"${message}\"`}`);\n this.name = 'NodeInvocationError';\n this.transaction = transaction;\n }\n}\n\n/**\n * @category exception\n */\nexport class NoSuchContractFunctionError extends ContractError {\n constructor(name: string) {\n super(`Function ${name} doesn't exist in contract`);\n this.name = 'NoSuchContractFunctionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NotPayableFunctionError extends ContractError {\n constructor(amount: string, fn: string) {\n super(\n `You try to pay \"${amount}\" to function \"${fn}\" which is not payable. `\n + 'Only payable function can accept coins',\n );\n this.name = 'NotPayableFunctionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingEventDefinitionError extends ContractError {\n constructor(eventNameHash: string, eventAddress: string) {\n super(\n `Can't find definition of ${eventNameHash} event emitted by ${eventAddress}`\n + ' (use omitUnknown option to ignore events like this)',\n );\n this.name = 'MissingEventDefinitionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AmbiguousEventDefinitionError extends ContractError {\n constructor(eventAddress: string, matchedEvents: Array<[string, string]>) {\n super(\n `Found multiple definitions of \"${matchedEvents[0][1]}\" event emitted by ${eventAddress}`\n + ` in ${matchedEvents.map(([name]) => `\"${name}\"`).join(', ')} contracts`\n + ' (use contractAddressToName option to specify contract name corresponding to address)',\n );\n this.name = 'AmbiguousEventDefinitionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidChecksumError extends CryptographyError {\n constructor() {\n super('Invalid checksum');\n this.name = 'InvalidChecksumError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidPasswordError extends CryptographyError {\n constructor() {\n super('Invalid password or nonce');\n this.name = 'InvalidPasswordError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MerkleTreeHashMismatchError extends CryptographyError {\n constructor() {\n super('Node hash is not equal to provided one');\n this.name = 'MerkleTreeHashMismatchError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingNodeInTreeError extends CryptographyError {\n constructor(message: string) {\n super(message);\n this.name = 'MissingNodeInTreeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnknownNodeLengthError extends CryptographyError {\n constructor(nodeLength: number) {\n super(`Unknown node length: ${nodeLength}`);\n this.name = 'UnknownNodeLengthError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnknownPathNibbleError extends CryptographyError {\n constructor(nibble: number) {\n super(`Unknown path nibble: ${nibble}`);\n this.name = 'UnknownPathNibbleError';\n }\n}\n\n/**\n * @category exception\n */\nexport class DuplicateNodeError extends NodeError {\n constructor(name: string) {\n super(`Node with name ${name} already exist`);\n this.name = 'DuplicateNodeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NodeNotFoundError extends NodeError {\n constructor(message: string) {\n super(message);\n this.name = 'NodeNotFoundError';\n }\n}\n\n/**\n * @category exception\n */\nexport class DecodeError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'DecodeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class PayloadLengthError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'PayloadLengthError';\n }\n}\n\n/**\n * @category exception\n */\nexport class DryRunError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'DryRunError';\n }\n}\n\n/**\n * @category exception\n */\nexport class IllegalBidFeeError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'IllegalBidFeeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidSignatureError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'InvalidSignatureError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidTxParamsError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'InvalidTxParamsError';\n }\n}\n\n/**\n * @category exception\n */\nexport class PrefixNotFoundError extends TransactionError {\n constructor(tag: number) {\n super(`Prefix for id-tag ${tag} not found.`);\n this.name = 'PrefixNotFoundError';\n }\n}\n\n/**\n * @category exception\n */\nexport class SchemaNotFoundError extends TransactionError {\n constructor(schemaName: string, key: string, version: number) {\n super(`Transaction ${schemaName} not implemented for ${key} version ${version}`);\n this.name = 'SchemaNotFoundError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TagNotFoundError extends TransactionError {\n constructor(prefix: string) {\n super(`Id tag for prefix ${prefix} not found.`);\n this.name = 'DecodeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TxNotInChainError extends TransactionError {\n constructor(txHash: string) {\n super(`Transaction ${txHash} is removed from chain`);\n this.name = 'TxNotInChainError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnknownTxError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'UnknownTxError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsupportedABIversionError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'UnsupportedABIversionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsupportedVMversionError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'UnsupportedVMversionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AlreadyConnectedError extends WalletError {\n constructor(message: string) {\n super(message);\n this.name = 'AlreadyConnectedError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NoWalletConnectedError extends WalletError {\n constructor(message: string) {\n super(message);\n this.name = 'NoWalletConnectedError';\n }\n}\n\n/**\n * @category exception\n */\nexport class RpcConnectionError extends WalletError {\n constructor(message: string) {\n super(message);\n this.name = 'RpcConnectionError';\n }\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2018 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport BigNumber from 'bignumber.js';\nimport { isBigNumber } from './bignumber';\nimport { ArgumentError } from './errors';\n\nexport enum AE_AMOUNT_FORMATS {\n AE = 'ae',\n MILI_AE = 'miliAE',\n MICRO_AE = 'microAE',\n NANO_AE = 'nanoAE',\n PICO_AE = 'picoAE',\n FEMTO_AE = 'femtoAE',\n AETTOS = 'aettos',\n}\n\n/**\n * DENOMINATION_MAGNITUDE\n */\nconst DENOMINATION_MAGNITUDE = {\n [AE_AMOUNT_FORMATS.AE]: 0,\n [AE_AMOUNT_FORMATS.MILI_AE]: -3,\n [AE_AMOUNT_FORMATS.MICRO_AE]: -6,\n [AE_AMOUNT_FORMATS.NANO_AE]: -9,\n [AE_AMOUNT_FORMATS.PICO_AE]: -12,\n [AE_AMOUNT_FORMATS.FEMTO_AE]: -15,\n [AE_AMOUNT_FORMATS.AETTOS]: -18,\n} as const;\n\n/**\n * Convert amount from one to other denomination\n * @param value - amount to convert\n * @param options - options\n * @param options.denomination - denomination of amount, can be ['ae', 'aettos']\n * @param options.targetDenomination - target denomination,\n * can be ['ae', 'aettos']\n */\nexport const formatAmount = (\n value: string | number | bigint | BigNumber,\n { denomination = AE_AMOUNT_FORMATS.AETTOS, targetDenomination = AE_AMOUNT_FORMATS.AETTOS }:\n { denomination?: AE_AMOUNT_FORMATS; targetDenomination?: AE_AMOUNT_FORMATS },\n): string => {\n if (!isBigNumber(value)) throw new ArgumentError('value', 'a number', value);\n\n return new BigNumber(typeof value === 'bigint' ? value.toString() : value)\n .shiftedBy(DENOMINATION_MAGNITUDE[denomination] - DENOMINATION_MAGNITUDE[targetDenomination])\n .toFixed();\n};\n\n/**\n * Convert amount to AE\n * @param value - amount to convert\n * @param options - options\n * @param options.denomination - denomination of amount, can be ['ae', 'aettos']\n */\nexport const toAe = (\n value: string | number | BigNumber,\n { denomination = AE_AMOUNT_FORMATS.AETTOS }: { denomination?: AE_AMOUNT_FORMATS } = {},\n): string => formatAmount(value, { denomination, targetDenomination: AE_AMOUNT_FORMATS.AE });\n\n/**\n * Convert amount to aettos\n * @param value - amount to convert\n * @param options - options\n * @param options.denomination - denomination of amount, can be ['ae', 'aettos']\n */\nexport const toAettos = (\n value: string | number | BigNumber,\n { denomination = AE_AMOUNT_FORMATS.AE }: { denomination?: AE_AMOUNT_FORMATS } = {},\n): string => formatAmount(value, { denomination });\n\ninterface Prefix {\n name: string;\n magnitude: number;\n}\n\nconst prefixes: Prefix[] = [\n { name: 'exa', magnitude: 18 },\n { name: 'giga', magnitude: 9 },\n { name: '', magnitude: 0 },\n { name: 'pico', magnitude: -12 },\n];\n\nconst getNearestPrefix = (exponent: number): Prefix => prefixes.reduce((p, n) => (\n Math.abs(n.magnitude - exponent) < Math.abs(p.magnitude - exponent) ? n : p));\n\nconst getLowerBoundPrefix = (exponent: number): Prefix => prefixes\n .find((p) => p.magnitude <= exponent) ?? prefixes[prefixes.length - 1];\n\nexport default (rawValue: string | number | BigNumber): string => {\n const value: BigNumber = new BigNumber(rawValue);\n\n const exp = value.e ?? 0;\n const { name, magnitude } = (exp < 0 ? getNearestPrefix : getLowerBoundPrefix)(exp);\n const v = value\n .shiftedBy(-magnitude)\n .precision(9 + Math.min(exp - magnitude, 0))\n .toFixed();\n return `${v}${name !== '' ? ' ' : ''}${name}`;\n};\n","/*\n * ISC License (ISC)\n * Copyright 2018 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\n/**\n * Convert string from snake_case to PascalCase\n * @param s - String to convert\n * @returns Converted string\n */\nexport function snakeToPascal(s: string): string {\n return s.replace(/_./g, (match) => match[1].toUpperCase());\n}\n\n/**\n * Convert string from PascalCase to snake_case\n * @param s - String to convert\n * @returns Converted string\n */\nexport function pascalToSnake(s: string): string {\n return s.replace(/[A-Z]/g, (match) => `_${match.toLowerCase()}`);\n}\n\n/**\n * Check whether a string is valid hex.\n * @param str - String to validate.\n * @returns True if the string is valid hex, false otherwise.\n */\nexport function isHex(str: string): boolean {\n return str.length % 2 === 0 && /^[0-9a-f]+$/i.test(str);\n}\n\n/**\n * Check whether a string is valid base-64.\n * @param str - String to validate.\n * @returns True if the string is valid base-64, false otherwise.\n */\nexport function isBase64(str: string): boolean {\n if (str.length % 4 > 0 || /[^0-9a-z+/=]/i.test(str)) return false;\n const index = str.indexOf('=');\n return index === -1 || /={1,2}/.test(str.slice(index));\n}\n","/*\n * ISC License (ISC)\n * Copyright 2018 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport BigNumber from 'bignumber.js';\nimport { NoSerializerFoundError, TypeError } from './errors';\nimport { isBase64, isHex } from './string';\n\n/**\n * Convert bignumber to byte array\n * @param x - bignumber instance\n * @returns Buffer\n */\nexport function bigNumberToByteArray(x: BigNumber): Buffer {\n if (!x.isInteger()) throw new TypeError(`Unexpected not integer value: ${x.toFixed()}`);\n let hexString = x.toString(16);\n if (hexString.length % 2 === 1) hexString = `0${hexString}`;\n return Buffer.from(hexString, 'hex');\n}\n\n/**\n * Convert string, number, or BigNumber to byte array\n * @param val - value to convert\n * @param big - enables force conversion to BigNumber\n * @returns Buffer\n */\nexport function toBytes(val?: null | string | number | BigNumber, big = false): Buffer {\n // Encode a value to bytes.\n // If the value is an int it will be encoded as bytes big endian\n // Raises ValueError if the input is not an int or string\n\n if (val === undefined || val === null) return Buffer.from([]);\n if (Number.isInteger(val) || BigNumber.isBigNumber(val) || big) {\n if (!BigNumber.isBigNumber(val)) val = new BigNumber(val);\n return bigNumberToByteArray(val);\n }\n if (typeof val === 'string') {\n return Buffer.from(val);\n }\n throw new NoSerializerFoundError();\n}\n\n/**\n * Convert a string to a Buffer. If encoding is not specified, hex-encoding\n * will be used if the input is valid hex. If the input is valid base64 but\n * not valid hex, base64 will be used. Otherwise, utf8 will be used.\n * @param str - String to be converted.\n * @param enc - Encoding of the input string.\n * @returns Buffer containing the input data.\n */\nexport function str2buf(str: string, enc?: BufferEncoding): Buffer {\n return Buffer.from(\n str,\n enc ?? (isHex(str) ? 'hex' : undefined) ?? (isBase64(str) ? 'base64' : undefined),\n );\n}\n\nexport const bytesToHex = (b: Uint8Array): string => Buffer.from(b).toString('hex');\n\nexport const hexToBytes = (s: string): Uint8Array => Buffer.from(s, 'hex');\n","export const pause = async (duration: number): Promise<void> => new Promise((resolve) => {\n setTimeout(resolve, duration);\n});\n\nexport const mapObject = <InputV, OutputV>(\n object: { [k: string]: InputV },\n fn: (\n value: [string, InputV], index: number, array: Array<[string, InputV]>\n ) => [number | string, OutputV],\n): { [k: string]: OutputV } => Object.fromEntries(Object.entries(object).map(fn));\n\n// remove after dropping webpack4 support\nconst isWebpack4Buffer = (() => {\n try {\n Buffer.concat([Uint8Array.from([])]);\n return false;\n } catch (error) {\n return true;\n }\n})();\n\nexport const concatBuffers = isWebpack4Buffer\n ? (list: readonly Uint8Array[], totalLength?: number): Buffer => (\n Buffer.concat(list.map((el) => Buffer.from(el)), totalLength)\n )\n : Buffer.concat;\n\n/**\n * Object key type guard\n * @param key - Maybe object key\n * @param object - Object\n */\nexport function isKeyOfObject<T>(key: string | number | symbol, object: T): key is keyof T {\n return key in object;\n}\n\n/**\n * Array item type guard\n * @param item - Maybe array item\n * @param array - Array\n */\nexport function isItemOfArray<T>(item: any, array: readonly T[]): item is T {\n return array.includes(item);\n}\n","/**\n * @category transaction builder\n * @see {@link https://github.com/aeternity/protocol/blob/master/node/api/api_encoding.md}\n * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_api_encoder.erl#L205-L230}\n */\nexport enum Encoding {\n KeyBlockHash = 'kh',\n MicroBlockHash = 'mh',\n BlockPofHash = 'bf',\n BlockTxHash = 'bx',\n BlockStateHash = 'bs',\n Channel = 'ch',\n ContractAddress = 'ct',\n ContractBytearray = 'cb',\n ContractStoreKey = 'ck',\n ContractStoreValue = 'cv',\n Transaction = 'tx',\n TxHash = 'th',\n OracleAddress = 'ok',\n OracleQuery = 'ov',\n OracleQueryId = 'oq',\n OracleResponse = 'or',\n AccountAddress = 'ak',\n Signature = 'sg',\n Commitment = 'cm',\n PeerPubkey = 'pp',\n Name = 'nm',\n State = 'st',\n Poi = 'pi',\n StateTrees = 'ss',\n CallStateTree = 'cs',\n Bytearray = 'ba',\n}\n\nexport type KeyBlockHash = `${Encoding.KeyBlockHash}_${string}`;\nexport type MicroBlockHash = `${Encoding.MicroBlockHash}_${string}`;\nexport type BlockPofHash = `${Encoding.BlockPofHash}_${string}`;\nexport type BlockTxHash = `${Encoding.BlockTxHash}_${string}`;\nexport type BlockStateHash = `${Encoding.BlockStateHash}_${string}`;\nexport type Channel = `${Encoding.Channel}_${string}`;\nexport type ContractAddress = `${Encoding.ContractAddress}_${string}`;\nexport type ContractBytearray = `${Encoding.ContractBytearray}_${string}`;\nexport type ContractStoreKey = `${Encoding.ContractStoreKey}_${string}`;\nexport type ContractStoreValue = `${Encoding.ContractStoreValue}_${string}`;\nexport type Transaction = `${Encoding.Transaction}_${string}`;\nexport type TxHash = `${Encoding.TxHash}_${string}`;\nexport type OracleAddress = `${Encoding.OracleAddress}_${string}`;\nexport type OracleQuery = `${Encoding.OracleQuery}_${string}`;\nexport type OracleQueryId = `${Encoding.OracleQueryId}_${string}`;\nexport type OracleResponse = `${Encoding.OracleResponse}_${string}`;\nexport type AccountAddress = `${Encoding.AccountAddress}_${string}`;\nexport type Signature = `${Encoding.Signature}_${string}`;\nexport type Commitment = `${Encoding.Commitment}_${string}`;\nexport type PeerPubkey = `${Encoding.PeerPubkey}_${string}`;\nexport type Name = `${Encoding.Name}_${string}`;\nexport type State = `${Encoding.State}_${string}`;\nexport type Poi = `${Encoding.Poi}_${string}`;\nexport type StateTrees = `${Encoding.StateTrees}_${string}`;\nexport type CallStateTree = `${Encoding.CallStateTree}_${string}`;\nexport type Bytearray = `${Encoding.Bytearray}_${string}`;\n\nexport type Generic<Type extends Encoding> = `${Type}_${string}`;\nexport type Any = `${Encoding}_${string}`;\n","import { encode as bs58Encode, decode as bs58Decode } from 'bs58';\n// js extension is required for mjs build, not importing the whole package to reduce bundle size\n// eslint-disable-next-line import/extensions\nimport Sha256 from 'sha.js/sha256.js';\nimport {\n DecodeError,\n ArgumentError,\n InvalidChecksumError,\n PayloadLengthError,\n} from './errors';\nimport { concatBuffers, isKeyOfObject } from './other';\nimport * as Encoded from './encoder-types';\nimport { Encoding } from './encoder-types';\n\nexport { Encoded, Encoding };\n\n/**\n * Calculate SHA256 hash of `input`\n * @param input - Data to hash\n * @returns Hash\n * @deprecated use `SubtleCrypto.digest` or `sha.js` package instead\n */\nexport function sha256hash(input: Uint8Array | string): Buffer {\n return new Sha256().update(input).digest();\n}\n\n/**\n * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_api_encoder.erl#L177-L202}\n */\nconst base64Types = [\n Encoding.ContractBytearray,\n Encoding.ContractStoreKey,\n Encoding.ContractStoreValue,\n Encoding.Transaction,\n Encoding.OracleQuery,\n Encoding.OracleResponse,\n Encoding.State,\n Encoding.Poi,\n Encoding.StateTrees,\n Encoding.CallStateTree,\n Encoding.Bytearray,\n] as const;\nconst base58Types = [\n Encoding.KeyBlockHash,\n Encoding.MicroBlockHash,\n Encoding.BlockPofHash,\n Encoding.BlockTxHash,\n Encoding.BlockStateHash,\n Encoding.Channel,\n Encoding.ContractAddress,\n Encoding.TxHash,\n Encoding.OracleAddress,\n Encoding.OracleQueryId,\n Encoding.AccountAddress,\n Encoding.Signature,\n Encoding.Commitment,\n Encoding.PeerPubkey,\n Encoding.Name,\n] as const;\n\n/**\n * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_api_encoder.erl#L261-L286}\n */\nconst byteSizeForType = {\n [Encoding.KeyBlockHash]: 32,\n [Encoding.MicroBlockHash]: 32,\n [Encoding.BlockPofHash]: 32,\n [Encoding.BlockTxHash]: 32,\n [Encoding.BlockStateHash]: 32,\n [Encoding.Channel]: 32,\n [Encoding.ContractAddress]: 32,\n [Encoding.TxHash]: 32,\n [Encoding.OracleAddress]: 32,\n [Encoding.OracleQueryId]: 32,\n [Encoding.AccountAddress]: 32,\n [Encoding.Signature]: 64,\n [Encoding.Commitment]: 32,\n [Encoding.PeerPubkey]: 32,\n [Encoding.State]: 32,\n} as const;\n\nfunction ensureValidLength(data: Uint8Array, type: Encoding): void {\n if (!isKeyOfObject(type, byteSizeForType)) return;\n const reqLen = byteSizeForType[type];\n if (reqLen == null || data.length === reqLen) return;\n throw new PayloadLengthError(`Payload should be ${reqLen} bytes, got ${data.length} instead`);\n}\n\nconst getChecksum = (payload: Uint8Array): Buffer => sha256hash(sha256hash(payload)).slice(0, 4);\n\nconst addChecksum = (payload: Uint8Array): Buffer => concatBuffers([payload, getChecksum(payload)]);\n\nfunction getPayload(buffer: Buffer): Buffer {\n const payload = buffer.slice(0, -4);\n if (!getChecksum(payload).equals(buffer.slice(-4))) throw new InvalidChecksumError();\n return payload;\n}\n\nconst base64 = {\n encode: (buffer: Uint8Array) => addChecksum(buffer).toString('base64'),\n decode: (string: string) => getPayload(Buffer.from(string, 'base64')),\n};\n\nconst base58 = {\n encode: (buffer: Uint8Array) => bs58Encode(addChecksum(buffer)),\n decode: (string: string) => getPayload(Buffer.from(bs58Decode(string))),\n};\n\nconst parseType = (maybeType: unknown): [Encoding, typeof base64] => {\n const base64Type = base64Types.find((t) => t === maybeType);\n if (base64Type != null) return [base64Type, base64];\n const base58Type = base58Types.find((t) => t === maybeType);\n if (base58Type != null) return [base58Type, base58];\n throw new ArgumentError('prefix', `one of ${[...base58Types, ...base64Types].join(', ')}`, maybeType);\n};\n\n/**\n * Decode data using the default encoding/decoding algorithm\n * @param data - An Base58/64check encoded and prefixed string\n * (ex tx_..., sg_..., ak_....)\n * @returns Decoded data\n */\nexport function decode(data: Encoded.Any): Buffer {\n const [prefix, encodedPayload, extra] = data.split('_');\n if (encodedPayload == null) throw new DecodeError(`Encoded string missing payload: ${data}`);\n if (extra != null) throw new DecodeError(`Encoded string have extra parts: ${data}`);\n const [type, encoder] = parseType(prefix);\n const payload = encoder.decode(encodedPayload);\n ensureValidLength(payload, type);\n return payload;\n}\n\n/**\n * Encode data using the default encoding/decoding algorithm\n * @param data - An decoded data\n * @param type - Prefix of Transaction\n * @returns Encoded string Base58check or Base64check data\n */\nexport function encode<Type extends Encoding>(\n data: Uint8Array,\n type: Type,\n): Encoded.Generic<Type> {\n const [, encoder] = parseType(type);\n ensureValidLength(data, type);\n return `${type}_${encoder.encode(data)}`;\n}\n","/*\n * ISC License (ISC)\n * Copyright 2018 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport nacl, { SignKeyPair } from 'tweetnacl';\n// js extension is required for mjs build, not importing the whole package to reduce bundle size\n// eslint-disable-next-line import/extensions\nimport { blake2b } from 'blakejs/blake2b.js';\nimport { encode as varuintEncode } from 'varuint-bitcoin';\n\nimport { str2buf } from './bytes';\nimport { concatBuffers } from './other';\nimport {\n decode, encode, Encoded, Encoding,\n} from './encoder';\n\n/**\n * Generate address from secret key\n * @param secret - Private key\n * @returns Public key encoded as address\n */\nexport function getAddressFromPriv(secret: string | Uint8Array): Encoded.AccountAddress {\n const secretBuffer = typeof secret === 'string' ? str2buf(secret) : secret;\n const keys = nacl.sign.keyPair.fromSecretKey(secretBuffer);\n return encode(keys.publicKey, Encoding.AccountAddress);\n}\n\n/**\n * Check if address is valid\n * @param address - Address\n * @param prefix - Transaction prefix. Default: 'ak'\n * @returns is valid\n */\nexport function isAddressValid(\n address: string,\n prefix: Encoding = Encoding.AccountAddress,\n): boolean {\n try {\n decode(address as Encoded.Generic<typeof prefix>);\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Generate a random salt (positive integer)\n * @returns random salt\n */\nexport function genSalt(): number {\n return Math.floor(Math.random() * Math.floor(Number.MAX_SAFE_INTEGER));\n}\n\n/**\n * Converts a positive integer to the smallest possible\n * representation in a binary digit representation\n * @param value - Value to encode\n * @returns Encoded number\n */\nexport function encodeUnsigned(value: number): Buffer {\n const binary = Buffer.allocUnsafe(4);\n binary.writeUInt32BE(value);\n return binary.slice(binary.findIndex((i) => i !== 0));\n}\n\n/**\n * Calculate 256bits Blake2b hash of `input`\n * @param input - Data to hash\n * @returns Hash\n */\nexport function hash(input: string | Uint8Array): Buffer {\n return Buffer.from(blake2b(input, undefined, 32)); // 256 bits\n}\n\n// Todo Duplicated in tx builder. remove\n/**\n * Compute contract address\n * @category contract\n * @param owner - Address of contract owner\n * @param nonce - Round when contract was created\n * @returns Contract address\n */\nexport function encodeContractAddress(\n owner: Encoded.AccountAddress,\n nonce: number,\n): Encoded.ContractAddress {\n const publicKey = decode(owner);\n const binary = concatBuffers([publicKey, encodeUnsigned(nonce)]);\n return encode(hash(binary), Encoding.ContractAddress);\n}\n\n// KEY-PAIR HELPERS\n\n/**\n * Generate keyPair from secret key\n * @param secret - secret key\n * @returns Object with Private(privateKey) and Public(publicKey) keys\n */\nexport function generateKeyPairFromSecret(secret: Uint8Array): SignKeyPair {\n return nacl.sign.keyPair.fromSecretKey(secret);\n}\n\n/**\n * Generate a random ED25519 keypair\n * @param raw - Whether to return raw (binary) keys\n * @returns Key pair\n */\nexport function generateKeyPair(raw: true): { publicKey: Buffer; secretKey: Buffer };\nexport function generateKeyPair(raw?: false): {\n publicKey: Encoded.AccountAddress; secretKey: string;\n};\nexport function generateKeyPair(raw = false): {\n publicKey: Encoded.AccountAddress | Buffer;\n secretKey: string | Buffer;\n} {\n const keyPair = nacl.sign.keyPair();\n const publicBuffer = Buffer.from(keyPair.publicKey);\n const secretBuffer = Buffer.from(keyPair.secretKey);\n\n if (raw) {\n return {\n publicKey: publicBuffer,\n secretKey: secretBuffer,\n };\n }\n return {\n publicKey: encode(publicBuffer, Encoding.AccountAddress),\n secretKey: secretBuffer.toString('hex'),\n };\n}\n\n// SIGNATURES\n\n/**\n * Generate signature\n * @param data - Data to sign\n * @param privateKey - Key to sign with\n * @returns Signature\n */\nexport function sign(data: string | Uint8Array, privateKey: string | Uint8Array): Uint8Array {\n return nacl.sign.detached(Buffer.from(data), Buffer.from(privateKey));\n}\n\n/**\n * Verify that signature was signed by public key\n * @param data - Data to verify\n * @param signature - Signature to verify\n * @param publicKey - Key to verify against\n * @returns Valid?\n */\nexport function verify(\n data: Uint8Array,\n signature: Uint8Array,\n publicKey: string | Uint8Array,\n): boolean {\n const publicKeyBuffer = typeof publicKey === 'string' ? str2buf(publicKey) : publicKey;\n return nacl.sign.detached.verify(data, signature, publicKeyBuffer);\n}\n\nexport function messageToHash(message: string): Buffer {\n const p = Buffer.from('aeternity Signed Message:\\n', 'utf8');\n const msg = Buffer.from(message, 'utf8');\n return hash(concatBuffers([varuintEncode(p.length), p, varuintEncode(msg.length), msg]));\n}\n\nexport function signMessage(message: string, privateKey: string | Buffer): Uint8Array {\n return sign(messageToHash(message), privateKey);\n}\n\nexport function verifyMessage(\n str: string,\n signature: Uint8Array,\n publicKey: string | Uint8Array,\n): boolean {\n return verify(messageToHash(str), signature, publicKey);\n}\n\n/**\n * Check key pair for validity\n *\n * Sign a message, and then verifying that signature\n * @param privateKey - Private key to verify\n * @param publicKey - Public key to verify\n * @returns Valid?\n */\nexport function isValidKeypair(\n privateKey: string | Uint8Array,\n publicKey: string | Uint8Array,\n): boolean {\n const message = Buffer.from('TheMessage');\n const signature = sign(message, privateKey);\n return verify(message, signature, publicKey);\n}\n","import BigNumber from 'bignumber.js';\nimport { mapObject } from '../../utils/other';\n\n// # AENS\nexport type AensName = `${string}.chain`;\nexport const NAME_TTL = 180000;\n// # max number of block into the future that the name is going to be available\n// # https://github.com/aeternity/protocol/blob/epoch-v0.22.0/AENS.md#update\n// # https://github.com/aeternity/protocol/blob/44a93d3aab957ca820183c3520b9daf6b0fedff4/AENS.md#aens-entry\nexport const NAME_MAX_TTL = 36000;\nexport const NAME_MAX_CLIENT_TTL = 84600;\nexport const CLIENT_TTL = NAME_MAX_CLIENT_TTL;\nexport const MIN_GAS_PRICE = 1e9;\n// # see https://github.com/aeternity/aeternity/blob/72e440b8731422e335f879a31ecbbee7ac23a1cf/apps/aecore/src/aec_governance.erl#L67\nexport const NAME_FEE_MULTIPLIER = 1e14; // 100000000000000\nexport const NAME_FEE_BID_INCREMENT = 0.05; // # the increment is in percentage\n// # see https://github.com/aeternity/aeternity/blob/72e440b8731422e335f879a31ecbbee7ac23a1cf/apps/aecore/src/aec_governance.erl#L272\nexport const NAME_BID_TIMEOUT_BLOCKS = 480; // # ~1 day\n// # this is the max length for a domain that requires a base fee to be paid\nexport const NAME_MAX_LENGTH_FEE = 31;\nexport const NAME_BID_MAX_LENGTH = 12; // # this is the max length for a domain to be part of a bid\n// # https://github.com/aeternity/aeternity/blob/72e440b8731422e335f879a31ecbbee7ac23a1cf/apps/aecore/src/aec_governance.erl#L290\n// # https://github.com/aeternity/protocol/blob/master/AENS.md#protocol-fees-and-protection-times\n// # bid ranges:\nexport const NAME_BID_RANGES = mapObject({\n 31: 3,\n 30: 5,\n 29: 8,\n 28: 13,\n 27: 21,\n 26: 34,\n 25: 55,\n 24: 89,\n 23: 144,\n 22: 233,\n 21: 377,\n 20: 610,\n 19: 987,\n 18: 1597,\n 17: 2584,\n 16: 4181,\n 15: 6765,\n 14: 10946,\n 13: 17711,\n 12: 28657,\n 11: 46368,\n 10: 75025,\n 9: 121393,\n 8: 196418,\n 7: 317811,\n 6: 514229,\n 5: 832040,\n 4: 1346269,\n 3: 2178309,\n 2: 3524578,\n 1: 5702887,\n}, ([key, value]) => [key, new BigNumber(value).times(NAME_FEE_MULTIPLIER)]);\n\n/**\n * Enum with tag types\n * @category transaction builder\n * @see {@link https://github.com/aeternity/protocol/blob/0f6dee3d9d1e8e2469816798f5c7587a6c918f94/serializations.md#binary-serialization}\n * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_chain_objects.erl#L39-L97}\n */\n// TODO: implement serialisation for commented-out tags\nexport enum Tag {\n Account = 10,\n SignedTx = 11,\n SpendTx = 12,\n // Oracle = 20,\n // OracleQuery = 21,\n OracleRegisterTx = 22,\n OracleQueryTx = 23,\n OracleResponseTx = 24,\n OracleExtendTx = 25,\n // Name = 30,\n // NameCommitment = 31,\n NameClaimTx = 32,\n NamePreclaimTx = 33,\n NameUpdateTx = 34,\n NameRevokeTx = 35,\n NameTransferTx = 36,\n // NameAuction = 37,\n Contract = 40,\n ContractCall = 41,\n ContractCreateTx = 42,\n ContractCallTx = 43,\n ChannelCreateTx = 50,\n // ChannelSetDelegatesTx = 501,\n ChannelDepositTx = 51,\n ChannelWithdrawTx = 52,\n ChannelForceProgressTx = 521,\n ChannelCloseMutualTx = 53,\n ChannelCloseSoloTx = 54,\n ChannelSlashTx = 55,\n ChannelSettleTx = 56,\n ChannelOffChainTx = 57,\n ChannelOffChainUpdateTransfer = 570,\n ChannelOffChainUpdateDeposit = 571,\n ChannelOffChainUpdateWithdraw = 572,\n ChannelOffChainUpdateCreateContract = 573,\n ChannelOffChainUpdateCallContract = 574,\n // ChannelOffChainUpdateMeta = 576,\n ChannelClientReconnectTx = 575,\n Channel = 58,\n ChannelSnapshotSoloTx = 59,\n TreesPoi = 60,\n // TreesDb = 61,\n StateTrees = 62,\n Mtree = 63,\n MtreeValue = 64,\n ContractsMtree = 621,\n CallsMtree = 622,\n ChannelsMtree = 623,\n NameserviceMtree = 624,\n OraclesMtree = 625,\n AccountsMtree = 626,\n CompilerSophia = 70,\n GaAttachTx = 80,\n GaMetaTx = 81,\n PayingForTx = 82,\n // KeyBlock = 100,\n // MicroBlock = 101,\n // LightMicroBlock = 102,\n // Pof = 200,\n}\n","import { ArgumentError, PrefixNotFoundError, TagNotFoundError } from '../../utils/errors';\nimport { toBytes } from '../../utils/bytes';\nimport {\n decode, encode, Encoded, Encoding,\n} from '../../utils/encoder';\nimport { isItemOfArray } from '../../utils/other';\n\n/**\n * Map of prefix to ID tag constant\n * @see {@link https://github.com/aeternity/protocol/blob/master/serializations.md#the-id-type}\n * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_id.erl#L97-L102}\n * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_api_encoder.erl#L163-L168}\n */\nconst idTagToEncoding = [\n Encoding.AccountAddress,\n Encoding.Name,\n Encoding.Commitment,\n Encoding.OracleAddress,\n Encoding.ContractAddress,\n Encoding.Channel,\n] as const;\n\ntype AddressEncodings = typeof idTagToEncoding[number];\n\n/**\n * Utility function to create and _id type\n * @category transaction builder\n * @param hashId - Encoded hash\n * @returns Buffer Buffer with ID tag and decoded HASh\n */\nexport function writeId(hashId: Encoded.Generic<AddressEncodings>): Buffer {\n if (typeof hashId !== 'string') throw new ArgumentError('hashId', 'a string', hashId);\n const encoding = hashId.slice(0, 2);\n if (!isItemOfArray(encoding, idTagToEncoding)) throw new TagNotFoundError(encoding);\n const idTag = idTagToEncoding.indexOf(encoding) + 1;\n return Buffer.from([...toBytes(idTag), ...decode(hashId)]);\n}\n\n/**\n * Utility function to read and _id type\n * @category transaction builder\n * @param buf - Data\n * @returns Encoided hash string with prefix\n */\nexport function readId(buf: Buffer): Encoded.Generic<AddressEncodings> {\n const idTag = Buffer.from(buf).readUIntBE(0, 1);\n const encoding = idTagToEncoding[idTag - 1];\n if (encoding == null) throw new PrefixNotFoundError(idTag);\n return encode(buf.slice(1, buf.length), encoding);\n}\n","import BigNumber from 'bignumber.js';\nimport { genSalt, hash } from '../../utils/crypto';\nimport {\n decode, encode, Encoded, Encoding,\n} from '../../utils/encoder';\nimport { toBytes } from '../../utils/bytes';\nimport { concatBuffers } from '../../utils/other';\nimport {\n AensName,\n NAME_BID_RANGES,\n NAME_BID_TIMEOUT_BLOCKS,\n NAME_FEE_BID_INCREMENT,\n NAME_MAX_LENGTH_FEE,\n} from './constants';\nimport { ceil } from '../../utils/bignumber';\nimport { ArgumentError, IllegalBidFeeError } from '../../utils/errors';\nimport { NamePointer } from '../../apis/node';\nimport { readId, writeId } from './address';\n\n/**\n * JavaScript-based Transaction builder helper function's\n */\n\n/**\n * Build a contract public key\n * @category contract\n * @param ownerId - The public key of the owner account\n * @param nonce - the nonce of the transaction\n * @returns Contract public key\n */\nexport function buildContractId(\n ownerId: Encoded.AccountAddress,\n nonce: number | BigNumber,\n): Encoded.ContractAddress {\n const ownerIdAndNonce = Buffer.from([...decode(ownerId), ...toBytes(nonce)]);\n const b2bHash = hash(ownerIdAndNonce);\n return encode(b2bHash, Encoding.ContractAddress);\n}\n\n/**\n * Build a oracle query id\n * @category oracle\n * @param senderId - The public key of the sender account\n * @param nonce - the nonce of the transaction\n * @param oracleId - The oracle public key\n * @returns Contract public key\n */\nexport function oracleQueryId(\n senderId: Encoded.AccountAddress,\n nonce: number | BigNumber | string,\n oracleId: Encoded.OracleAddress,\n): Encoded.OracleQueryId {\n function _int32(val: number | string | BigNumber): Buffer {\n const nonceBE = toBytes(val, true);\n return concatBuffers([Buffer.alloc(32 - nonceBE.length), nonceBE]);\n }\n\n const b2bHash = hash(\n Buffer.from([...decode(senderId), ..._int32(nonce), ...decode(oracleId)]),\n );\n return encode(b2bHash, Encoding.OracleQueryId);\n}\n\n/**\n * Format the salt into a 64-byte hex string\n * @category transaction builder\n * @param salt - Random number\n * @returns Zero-padded hex string of salt\n */\nexport function formatSalt(salt: number): Buffer {\n return Buffer.from(salt.toString(16).padStart(64, '0'), 'hex');\n}\n\n/**\n * Encode an AENS name\n * @category AENS\n * @param name - Name to encode\n * @returns `nm_` prefixed encoded AENS name\n */\nexport function produceNameId(name: AensName): Encoded.Name {\n return encode(hash(name.toLowerCase()), Encoding.Name);\n}\n\n/**\n * Generate the commitment hash by hashing the formatted salt and\n * name, base 58 encoding the result and prepending 'cm_'\n * @category transaction builder\n * @param name - Name to be registered\n * @param salt - Random salt\n * @returns Commitment hash\n */\nexport function commitmentHash(\n name: AensName,\n salt: number = genSalt(),\n): Encoded.Commitment {\n return encode(\n hash(concatBuffers([Buffer.from(name.toLowerCase()), formatSalt(salt)])),\n Encoding.Commitment,\n );\n}\n\n/**\n * Utility function to convert int to bytes\n * @category transaction builder\n * @param val - Value\n * @returns Buffer Buffer from number(BigEndian)\n */\nexport function writeInt(val: number | string | BigNumber): Buffer {\n return toBytes(val, true);\n}\n\n/**\n * Utility function to convert bytes to int\n * @category transaction builder\n * @param buf - Value\n * @returns Buffer Buffer from number(BigEndian)\n */\nexport function readInt(buf: Buffer = Buffer.from([])): string {\n return new BigNumber(Buffer.from(buf).toString('hex'), 16).toString(10);\n}\n\n/**\n * Helper function to build pointers for name update TX\n * @category transaction builder\n * @param pointers - Array of pointers\n * `([ { key: 'account_pubkey', id: 'ak_32klj5j23k23j5423l434l2j3423'} ])`\n * @returns Serialized pointers array\n */\nexport function buildPointers(pointers: NamePointer[]): Buffer[][] {\n return pointers.map(\n (p) => [\n toBytes(p.key),\n writeId(p.id as Parameters<typeof writeId>[0]),\n ],\n );\n}\n\n/**\n * Helper function to read pointers from name update TX\n * @category transaction builder\n * @param pointers - Array of pointers\n * @returns Deserialize pointer array\n */\nexport function readPointers(pointers: Array<[key: string, id: Buffer]>): NamePointer[] {\n return pointers.map(\n ([key, id]) => ({\n key: key.toString(),\n id: readId(id),\n }),\n );\n}\n\nconst AENS_SUFFIX = '.chain';\n\n/**\n * Is AENS name valid\n * @category AENS\n * @param name - AENS name\n */\nexport function isNameValid(name: string): name is AensName {\n // TODO: probably there are stronger requirements\n return name.endsWith(AENS_SUFFIX);\n}\n\nconst encodingToPointerKey = [\n [Encoding.AccountAddress, 'account_pubkey'],\n [Encoding.OracleAddress, 'oracle_pubkey'],\n [Encoding.ContractAddress, 'contract_pubkey'],\n [Encoding.Channel, 'channel'],\n] as const;\n\n/**\n * @category AENS\n * @param identifier - account/oracle/contract address, or channel\n * @returns default AENS pointer key\n */\nexport function getDefaultPointerKey(\n identifier: Encoded.Generic<typeof encodingToPointerKey[number][0]>,\n): typeof encodingToPointerKey[number][1] {\n decode(identifier);\n const encoding = identifier.substring(0, 2);\n const result = encodingToPointerKey.find(([e]) => e === encoding)?.[1];\n if (result != null) return result;\n throw new ArgumentError(\n 'identifier',\n `prefixed with one of ${encodingToPointerKey.map(([e]) => `${e}_`).join(', ')}`,\n identifier,\n );\n}\n\n/**\n * Get the minimum AENS name fee\n * @category AENS\n * @param name - the AENS name to get the fee for\n * @returns the minimum fee for the AENS name auction\n */\nexport function getMinimumNameFee(name: AensName): BigNumber {\n const nameLength = name.length - AENS_SUFFIX.length;\n return NAME_BID_RANGES[Math.min(nameLength, NAME_MAX_LENGTH_FEE)];\n}\n\n/**\n * Compute bid fee for AENS auction\n * @category AENS\n * @param name - the AENS name to get the fee for\n * @param options - Options\n * @param options.startFee - Auction start fee\n * @param options.increment - Bid multiplier(In percentage, must be between 0 and 1)\n * @returns Bid fee\n */\nexport function computeBidFee(\n name: AensName,\n { startFee, increment = NAME_FEE_BID_INCREMENT }:\n { startFee?: number | string | BigNumber; increment?: number } = {},\n): BigNumber {\n if (!(Number(increment) === increment && increment % 1 !== 0)) throw new IllegalBidFeeError(`Increment must be float. Current increment ${increment}`);\n if (increment < NAME_FEE_BID_INCREMENT) throw new IllegalBidFeeError(`minimum increment percentage is ${NAME_FEE_BID_INCREMENT}`);\n // FIXME: increment should be used somehow here\n return ceil(\n new BigNumber(startFee ?? getMinimumNameFee(name))\n .times(new BigNumber(NAME_FEE_BID_INCREMENT).plus(1)),\n );\n}\n\n/**\n * Compute auction end height\n * @category AENS\n * @param name - Name to compute auction end for\n * @param claimHeight - Auction starting height\n * @see {@link https://github.com/aeternity/aeternity/blob/72e440b8731422e335f879a31ecbbee7ac23a1cf/apps/aecore/src/aec_governance.erl#L273}\n * @returns Auction end height\n */\nexport function computeAuctionEndBlock(name: AensName, claimHeight: number): number {\n const length = name.length - AENS_SUFFIX.length;\n const h = (length <= 4 && 62 * NAME_BID_TIMEOUT_BLOCKS)\n || (length <= 8 && 31 * NAME_BID_TIMEOUT_BLOCKS)\n || (length <= 12 && NAME_BID_TIMEOUT_BLOCKS)\n || 0;\n return h + claimHeight;\n}\n\n/**\n * Is name accept going to auction\n * @category AENS\n */\nexport function isAuctionName(name: AensName): boolean {\n return name.length < 13 + AENS_SUFFIX.length;\n}\n","import BigNumber from 'bignumber.js';\nimport { readInt, writeInt } from '../helpers';\nimport { ArgumentError } from '../../../utils/errors';\n\nexport type Int = number | string | BigNumber;\n\nexport default {\n serialize(value: Int): Buffer {\n if (value < 0) throw new ArgumentError('value', 'greater or equal to 0', value);\n return writeInt(value);\n },\n\n deserialize(value: Buffer): string {\n return readInt(value);\n },\n};\n","import uInt from './u-int';\n\nexport default {\n serialize(value: number): Buffer {\n return uInt.serialize(value);\n },\n\n deserialize(value: Buffer): number {\n return +uInt.deserialize(value);\n },\n};\n","import uInt, { Int } from './u-int';\nimport { AE_AMOUNT_FORMATS, formatAmount } from '../../../utils/amount-formatter';\nimport { ArgumentError } from '../../../utils/errors';\n\nexport interface Options { denomination?: AE_AMOUNT_FORMATS }\n\nexport default {\n ...uInt,\n\n serializeAettos(value: string | undefined): string {\n if (value == null) throw new ArgumentError('value', 'provided', value);\n return value;\n },\n\n serializeOptional(value: Int | undefined, { denomination, ...options }: Options): Buffer {\n return uInt.serialize(\n this.serializeAettos(\n value != null ? formatAmount(value, { denomination }) : value,\n options,\n ),\n );\n },\n\n serialize(value: Int, options: Options): Buffer {\n return this.serializeOptional(value, options);\n },\n};\n","import coinAmount from './coin-amount';\nimport { Int } from './u-int';\nimport { IllegalArgumentError } from '../../../utils/errors';\n\nexport default {\n ...coinAmount,\n\n /**\n * @param value - Deposit value in string format. Should be equal to '0'.\n * @param options - Options\n * @returns Deposit value Buffer.\n */\n serialize(\n value: Int | undefined,\n options: Parameters<typeof coinAmount['serialize']>[1],\n ): Buffer {\n value ??= 0;\n if (+value !== 0) throw new IllegalArgumentError(`Contract deposit is not refundable, so it should be equal 0, got ${value.toString()} instead`);\n return coinAmount.serialize(value, options);\n },\n};\n","import BigNumber from 'bignumber.js';\nimport { IllegalArgumentError } from '../../../utils/errors';\nimport { MIN_GAS_PRICE, Tag } from '../constants';\nimport coinAmount from './coin-amount';\nimport { isKeyOfObject } from '../../../utils/other';\n\nconst BASE_GAS = 15000;\nconst GAS_PER_BYTE = 20;\nconst KEY_BLOCK_INTERVAL = 3;\n\n/**\n * Calculate the Base fee gas\n * @see {@link https://github.com/aeternity/protocol/blob/master/consensus/README.md#gas}\n * @param txType - The transaction type\n * @returns The base fee\n * @example\n * ```js\n * TX_FEE_BASE('channelForceProgress') => new BigNumber(30 * 15000)\n * ```\n */\nconst TX_FEE_BASE_GAS = (txType: Tag): BigNumber => {\n const feeFactors = {\n [Tag.ChannelForceProgressTx]: 30,\n [Tag.ChannelOffChainTx]: 0,\n [Tag.ChannelOffChainUpdateCallContract]: 0,\n [Tag.ChannelOffChainUpdateCreateContract]: 0,\n [Tag.ChannelOffChainUpdateDeposit]: 0,\n [Tag.ChannelOffChainUpdateWithdraw]: 0,\n [Tag.ChannelOffChainUpdateTransfer]: 0,\n [Tag.ContractCreateTx]: 5,\n [Tag.ContractCallTx]: 12,\n [Tag.GaAttachTx]: 5,\n [Tag.GaMetaTx]: 5,\n [Tag.PayingForTx]: 1 / 5,\n } as const;\n const factor = feeFactors[txType as keyof typeof feeFactors] ?? 1;\n return new BigNumber(factor * BASE_GAS);\n};\n\n/**\n * Calculate fee for Other types of transactions\n * @see {@link https://github.com/aeternity/protocol/blob/master/consensus/README.md#gas}\n * @param txType - The transaction type\n * @param txSize - The transaction size\n * @returns parameters - The transaction parameters\n * @returns parameters.relativeTtl - The relative ttl\n * @returns parameters.innerTxSize - The size of the inner transaction\n * @returns The Other fee\n * @example\n * ```js\n * TX_FEE_OTHER_GAS('oracleResponse',10, { relativeTtl: 10, innerTxSize: 10 })\n * => new BigNumber(10).times(20).plus(Math.ceil(32000 * 10 / Math.floor(60 * 24 * 365 / 2)))\n * ```\n */\nconst TX_FEE_OTHER_GAS = (\n txType: Tag,\n txSize: number,\n { relativeTtl, innerTxSize }: { relativeTtl: number; innerTxSize: number },\n): BigNumber => {\n switch (txType) {\n case Tag.OracleRegisterTx:\n case Tag.OracleExtendTx:\n case Tag.OracleQueryTx:\n case Tag.OracleResponseTx:\n return new BigNumber(txSize)\n .times(GAS_PER_BYTE)\n .plus(\n Math.ceil((32000 * relativeTtl) / Math.floor((60 * 24 * 365) / KEY_BLOCK_INTERVAL)),\n );\n case Tag.GaMetaTx:\n case Tag.PayingForTx:\n return new BigNumber(txSize).minus(innerTxSize).times(GAS_PER_BYTE);\n default:\n return new BigNumber(txSize).times(GAS_PER_BYTE);\n }\n};\n\nfunction getOracleRelativeTtl(params: any, txType: Tag): number {\n const ttlKeys = {\n [Tag.OracleRegisterTx]: 'oracleTtlValue',\n [Tag.OracleExtendTx]: 'oracleTtlValue',\n [Tag.OracleQueryTx]: 'queryTtlValue',\n [Tag.OracleResponseTx]: 'responseTtlValue',\n } as const;\n\n if (!isKeyOfObject(txType, ttlKeys)) return 1;\n return params[ttlKeys[txType]];\n}\n\n/**\n * Calculate fee based on tx type and params\n */\nexport function buildFee(txType: Tag, buildTx: any): BigNumber {\n const { rlpEncoded: { length }, txObject } = buildTx;\n\n return TX_FEE_BASE_GAS(txType)\n .plus(TX_FEE_OTHER_GAS(txType, length, {\n relativeTtl: getOracleRelativeTtl(txObject, txType),\n innerTxSize: [Tag.GaMetaTx, Tag.PayingForTx].includes(txType)\n ? txObject.tx.tx.encodedTx.rlpEncoded.length\n : 0,\n }))\n .times(MIN_GAS_PRICE);\n}\n\n/**\n * Calculate min fee\n * @category transaction builder\n * @param txType - Transaction type\n * @param rebuildTx - Callback to get built transaction with specific fee\n */\nexport function calculateMinFee(\n txType: Tag,\n rebuildTx: (value: BigNumber) => any,\n): BigNumber {\n let fee = new BigNumber(0);\n let previousFee;\n do {\n previousFee = fee;\n fee = buildFee(txType, rebuildTx(fee));\n } while (!fee.eq(previousFee));\n return fee;\n}\n\nexport default {\n ...coinAmount,\n\n serializeAettos(\n _value: string | undefined,\n { txType, rebuildTx, _computingMinFee }:\n { txType: Tag; rebuildTx: (params: any) => any; _computingMinFee?: string },\n ): string {\n if (_computingMinFee != null) return _computingMinFee;\n const minFee = calculateMinFee(txType, (fee) => rebuildTx({ _computingMinFee: fee }));\n const value = new BigNumber(_value ?? minFee);\n if (minFee.gt(value)) {\n throw new IllegalArgumentError(`Fee ${value.toString()} must be bigger then ${minFee}`);\n }\n return value.toFixed();\n },\n\n serialize: coinAmount.serializeOptional,\n};\n","import { IllegalArgumentError } from '../../../utils/errors';\nimport { MIN_GAS_PRICE, Tag } from '../constants';\nimport shortUInt from './short-u-int';\nimport { buildFee } from './fee';\n\nfunction calculateGasLimitMax(\n txType: Tag,\n gasMax: number,\n rebuildTx: (value: number) => any,\n): number {\n return gasMax - +buildFee(txType, rebuildTx(gasMax)).dividedBy(MIN_GAS_PRICE);\n}\n\nexport default {\n ...shortUInt,\n\n serialize(\n _value: number | undefined,\n {\n txType, rebuildTx, gasMax = 6e6, _computingGasLimit,\n }: {\n txType: Tag;\n rebuildTx: (params: any) => any;\n gasMax: number;\n _computingGasLimit?: number;\n },\n ): Buffer {\n if (_computingGasLimit != null) return shortUInt.serialize(_computingGasLimit);\n\n const gasLimitMax = calculateGasLimitMax(\n txType,\n gasMax,\n (gasLimit) => rebuildTx({ _computingGasLimit: gasLimit }),\n );\n const value = _value ?? gasLimitMax;\n if (value > gasLimitMax) {\n throw new IllegalArgumentError(`Gas limit ${value} must be less or equal to ${gasLimitMax}`);\n }\n return shortUInt.serialize(value);\n },\n};\n","import coinAmount from './coin-amount';\nimport { IllegalArgumentError } from '../../../utils/errors';\nimport { MIN_GAS_PRICE } from '../constants';\n\nexport default {\n ...coinAmount,\n\n serializeAettos(value: string | undefined = MIN_GAS_PRICE.toString()): string {\n if (+value < MIN_GAS_PRICE) {\n throw new IllegalArgumentError(`Gas price ${value.toString()} must be bigger then ${MIN_GAS_PRICE}`);\n }\n return value;\n },\n\n serialize: coinAmount.serializeOptional,\n};\n","export default {\n serialize(value: string): Buffer {\n return Buffer.from(value);\n },\n\n deserialize(value: Buffer): string {\n return value.toString();\n },\n};\n","import field from './field';\nimport { AensName } from '../constants';\n\nexport default {\n /**\n * @param value - AENS name\n */\n serialize(value: AensName): Buffer {\n return field.serialize(value);\n },\n\n /**\n * @param value - AENS name\n */\n deserialize(value: Buffer): AensName {\n return field.deserialize(value) as AensName;\n },\n};\n","import BigNumber from 'bignumber.js';\nimport { getMinimumNameFee } from '../helpers';\nimport { InsufficientNameFeeError } from '../../../utils/errors';\nimport { Int } from './u-int';\nimport coinAmount from './coin-amount';\nimport { AensName } from '../constants';\n\nexport default {\n ...coinAmount,\n\n serializeAettos(\n _value: string | undefined,\n txFields: { name: AensName },\n ): string {\n const minNameFee = getMinimumNameFee(txFields.name);\n const value = new BigNumber(_value ?? minNameFee);\n if (minNameFee.gt(value)) throw new InsufficientNameFeeError(value, minNameFee);\n return value.toFixed();\n },\n\n /**\n * @param value - AENS name fee Buffer\n * @param txFields - Transaction fields\n * @param txFields.name - AENS Name in transaction\n */\n serialize(\n value: Int | undefined,\n txFields: { name: AensName } & Parameters<typeof coinAmount['serialize']>[1],\n ): Buffer {\n return coinAmount.serializeOptional.call(this, value, txFields);\n },\n};\n","import _field from './field';\nimport _uInt from './u-int';\nimport _shortUInt from './short-u-int';\nimport _coinAmount from './coin-amount';\n\nimport _deposit from './deposit';\nimport _fee from './fee';\nimport _gasLimit from './gas-limit';\nimport _gasPrice from './gas-price';\nimport _name from './name';\nimport _nameFee from './name-fee';\nimport _nameId from './name-id';\n\n// TODO: remove after fixing https://github.com/Gerrit0/typedoc-plugin-missing-exports/issues/15\nconst field = _field;\nconst uInt = _uInt;\nconst shortUInt = _shortUInt;\nconst coinAmount = _coinAmount;\n\nconst deposit = _deposit;\nconst fee = _fee;\nconst gasLimit = _gasLimit;\nconst gasPrice = _gasPrice;\nconst name = _name;\nconst nameFee = _nameFee;\nconst nameId = _nameId;\n\nexport type Field = typeof field | typeof uInt | typeof shortUInt | typeof coinAmount\n | typeof deposit | typeof fee | typeof gasLimit | typeof gasPrice | typeof name | typeof nameFee\n | typeof nameId;\n\nexport {\n field,\n uInt,\n shortUInt,\n coinAmount,\n\n deposit,\n fee,\n gasLimit,\n gasPrice,\n name,\n nameFee,\n nameId,\n};\n","import { AensName } from '../constants';\nimport { produceNameId, isNameValid } from '../helpers';\nimport { writeId, readId } from '../address';\nimport { Encoded } from '../../../utils/encoder';\n\nexport default {\n /**\n * @param value - AENS name ID\n */\n serialize(value: AensName | Encoded.Name): Buffer {\n return writeId(isNameValid(value) ? produceNameId(value) : value);\n },\n\n /**\n * @param value - AENS name ID Buffer\n */\n deserialize(value: Buffer): Encoded.Name {\n return readId(value) as Encoded.Name;\n },\n};\n","/**\n * Transaction Schema for TxBuilder\n */\n// # RLP version number\n// # https://github.com/aeternity/protocol/blob/master/serializations.md#binary-serialization\n\nimport BigNumber from 'bignumber.js';\nimport { Tag } from './constants';\nimport {\n Field, uInt, shortUInt, coinAmount, name, nameId, nameFee, deposit, gasLimit, gasPrice, fee,\n} from './field-types';\nimport { Encoded, Encoding } from '../../utils/encoder';\nimport MPTree from '../../utils/mptree';\nimport { NamePointer } from '../../apis/node';\n\nexport enum ORACLE_TTL_TYPES {\n delta = 0,\n block = 1,\n}\n\n// # TRANSACTION DEFAULT TTL\nexport const TX_TTL = 0;\n// # ORACLE\nexport const QUERY_FEE = 30000;\nexport const ORACLE_TTL = { type: ORACLE_TTL_TYPES.delta, value: 500 };\nexport const QUERY_TTL = { type: ORACLE_TTL_TYPES.delta, value: 10 };\nexport const RESPONSE_TTL = { type: ORACLE_TTL_TYPES.delta, value: 10 };\n// # CONTRACT\nexport const AMOUNT = 0;\nexport const MAX_AUTH_FUN_GAS = 50000;\nexport const DRY_RUN_ACCOUNT = {\n pub: 'ak_11111111111111111111111111111111273Yts',\n amount: 100000000000000000000000000000000000n,\n} as const;\n\nexport type TxField = [\n name: string,\n type: FIELD_TYPES | Field,\n prefix?: Encoding | Encoding[],\n];\n\n/**\n * @category transaction builder\n * @see {@link https://github.com/aeternity/protocol/blob/0f6dee3d9d1e8e2469816798f5c7587a6c918f94/contracts/contract_vms.md#virtual-machines-on-the-%C3%A6ternity-blockchain}\n */\nexport enum VM_VERSIONS {\n NO_VM = 0,\n SOPHIA = 1,\n SOPHIA_IMPROVEMENTS_MINERVA = 3,\n SOPHIA_IMPROVEMENTS_FORTUNA = 4,\n FATE = 5,\n SOPHIA_IMPROVEMENTS_LIMA = 6,\n FATE_2 = 7,\n}\n\n/**\n * @category transaction builder\n * @see {@link https://github.com/aeternity/protocol/blob/0f6dee3d9d1e8e2469816798f5c7587a6c918f94/contracts/contract_vms.md#virtual-machines-on-the-%C3%A6ternity-blockchain}\n */\nexport enum ABI_VERSIONS {\n NO_ABI = 0,\n SOPHIA = 1,\n FATE = 3,\n}\n\n/**\n * @category transaction builder\n */\nexport enum PROTOCOL_VERSIONS {\n IRIS = 5,\n}\n\n// First abi/vm by default\nexport const PROTOCOL_VM_ABI = {\n [PROTOCOL_VERSIONS.IRIS]: {\n [Tag.ContractCreateTx]: {\n vmVersion: [VM_VERSIONS.FATE_2], abiVersion: [ABI_VERSIONS.FATE],\n },\n // TODO: Ensure that AEVM (SOPHIA?) is still available here\n [Tag.ContractCallTx]: {\n vmVersion: [], abiVersion: [ABI_VERSIONS.FATE, ABI_VERSIONS.SOPHIA],\n },\n [Tag.OracleRegisterTx]: {\n vmVersion: [], abiVersion: [ABI_VERSIONS.NO_ABI, ABI_VERSIONS.SOPHIA],\n },\n },\n} as const;\n\ntype PrefixType<Prefix> = Prefix extends Encoding\n ? Encoded.Generic<Prefix>\n : Prefix extends readonly Encoding[]\n ? Encoded.Generic<Prefix[number]>\n : Encoded.Generic<any>;\n\n/**\n * @category transaction builder\n */\nexport interface CtVersion {\n vmVersion: VM_VERSIONS;\n abiVersion: ABI_VERSIONS;\n}\n\n/**\n * @category transaction builder\n */\nexport enum FIELD_TYPES {\n id,\n ids,\n string,\n binary,\n bool,\n hex,\n rlpBinary,\n rlpBinaries,\n rawBinary,\n signatures,\n pointers,\n offChainUpdates,\n callStack,\n proofOfInclusion,\n mptrees,\n callReturnType,\n ctVersion,\n abiVersion,\n ttlType,\n sophiaCodeTypeInfo,\n payload,\n stateTree,\n}\n\ninterface BuildFieldTypes<Prefix extends undefined | Encoding | readonly Encoding[]> {\n [FIELD_TYPES.id]: PrefixType<Prefix>;\n [FIELD_TYPES.ids]: Array<Encoded.Generic<Prefix extends Encoding[] ? Prefix : any>>;\n [FIELD_TYPES.string]: string;\n [FIELD_TYPES.binary]: PrefixType<Prefix>;\n [FIELD_TYPES.bool]: Boolean;\n [FIELD_TYPES.hex]: string;\n [FIELD_TYPES.rlpBinary]: any;\n [FIELD_TYPES.rlpBinaries]: any[];\n [FIELD_TYPES.rawBinary]: Uint8Array;\n [FIELD_TYPES.signatures]: Uint8Array[];\n [FIELD_TYPES.pointers]: NamePointer[];\n [FIELD_TYPES.offChainUpdates]: any;\n [FIELD_TYPES.callStack]: any;\n [FIELD_TYPES.proofOfInclusion]: any;\n [FIELD_TYPES.mptrees]: MPTree[];\n [FIELD_TYPES.callReturnType]: any;\n [FIELD_TYPES.ctVersion]: CtVersion;\n [FIELD_TYPES.abiVersion]: ABI_VERSIONS;\n [FIELD_TYPES.ttlType]: ORACLE_TTL_TYPES;\n [FIELD_TYPES.sophiaCodeTypeInfo]: any;\n [FIELD_TYPES.payload]: string | undefined;\n [FIELD_TYPES.stateTree]: any;\n}\n\n// based on https://stackoverflow.com/a/50375286/6176994\ntype UnionToIntersection<Union> =\n (Union extends any ? (k: Union) => void : never) extends ((k: infer Intersection) => void)\n ? Intersection : never;\n\ntype TxElem = readonly [string, FIELD_TYPES | Field]\n| readonly [string, FIELD_TYPES, Encoding | readonly Encoding[]];\n\ntype BuildTxArgBySchemaType<\n Type extends FIELD_TYPES | Field,\n Prefix extends undefined | Encoding | readonly Encoding[],\n> =\n Type extends Field\n ? Parameters<Type['serialize']>[0]\n : Type extends FIELD_TYPES\n ? BuildFieldTypes<Prefix>[Type]\n : never;\n\ntype NullablePartial<\n T,\n NK extends keyof T = { [K in keyof T]: undefined extends T[K] ? K : never }[keyof T],\n> = Partial<Pick<T, NK>> & Omit<T, NK>;\n\ntype BuildTxArgBySchema<SchemaLine> =\n UnionToIntersection<\n SchemaLine extends ReadonlyArray<infer Elem>\n ? Elem extends TxElem\n ? NullablePartial<{ [k in Elem[0]]: BuildTxArgBySchemaType<Elem[1], Elem[2]> }>\n : never\n : never\n >;\n\nexport type RawTxObject<Tx extends TxSchema> = {\n [k in keyof Tx]-?: Tx[k] extends BigNumber ? string : Tx[k]\n};\n\nconst BASE_TX = [\n ['tag', shortUInt],\n ['VSN', shortUInt],\n] as const;\n\nexport const TX_SCHEMA = {\n [Tag.Account]: {\n 1: [\n ...BASE_TX,\n ['nonce', shortUInt],\n ['balance', uInt],\n ],\n 2: [\n ...BASE_TX,\n ['flags', uInt],\n ['nonce', shortUInt],\n ['balance', uInt],\n ['gaContract', FIELD_TYPES.id, [Encoding.ContractAddress, Encoding.Name]],\n ['gaAuthFun', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ],\n },\n [Tag.SignedTx]: {\n 1: [\n ...BASE_TX,\n ['signatures', FIELD_TYPES.signatures],\n ['encodedTx', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.SpendTx]: {\n 1: [\n ...BASE_TX,\n ['senderId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['recipientId', FIELD_TYPES.id, [Encoding.AccountAddress, Encoding.Name]],\n ['amount', coinAmount],\n ['fee', fee],\n ['ttl', shortUInt],\n ['nonce', shortUInt],\n ['payload', FIELD_TYPES.payload],\n ],\n },\n [Tag.NamePreclaimTx]: {\n 1: [\n ...BASE_TX,\n ['accountId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['nonce', shortUInt],\n ['commitmentId', FIELD_TYPES.id, Encoding.Commitment],\n ['fee', fee],\n ['ttl', shortUInt],\n ],\n },\n [Tag.NameClaimTx]: {\n 2: [\n ...BASE_TX,\n ['accountId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['nonce', shortUInt],\n ['name', name],\n ['nameSalt', uInt],\n ['nameFee', nameFee],\n ['fee', fee],\n ['ttl', shortUInt],\n ],\n },\n [Tag.NameUpdateTx]: {\n 1: [\n ...BASE_TX,\n ['accountId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['nonce', shortUInt],\n ['nameId', nameId],\n ['nameTtl', uInt],\n ['pointers', FIELD_TYPES.pointers],\n ['clientTtl', shortUInt],\n ['fee', fee],\n ['ttl', shortUInt],\n ],\n },\n [Tag.NameTransferTx]: {\n 1: [\n ...BASE_TX,\n ['accountId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['nonce', shortUInt],\n ['nameId', nameId],\n ['recipientId', FIELD_TYPES.id, [Encoding.AccountAddress, Encoding.Name]],\n ['fee', fee],\n ['ttl', shortUInt],\n ],\n },\n [Tag.NameRevokeTx]: {\n 1: [\n ...BASE_TX,\n ['accountId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['nonce', shortUInt],\n ['nameId', nameId],\n ['fee', fee],\n ['ttl', shortUInt],\n ],\n },\n [Tag.Contract]: {\n 1: [\n ...BASE_TX,\n ['owner', FIELD_TYPES.id, Encoding.AccountAddress],\n ['ctVersion', FIELD_TYPES.ctVersion],\n ['code', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['log', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['active', FIELD_TYPES.bool],\n ['referers', FIELD_TYPES.ids, Encoding.AccountAddress],\n ['deposit', deposit],\n ],\n },\n [Tag.ContractCreateTx]: {\n 1: [\n ...BASE_TX,\n ['ownerId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['nonce', shortUInt],\n ['code', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['ctVersion', FIELD_TYPES.ctVersion],\n ['fee', fee],\n ['ttl', shortUInt],\n ['deposit', deposit],\n ['amount', coinAmount],\n ['gasLimit', gasLimit],\n ['gasPrice', gasPrice],\n ['callData', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ],\n },\n [Tag.ContractCallTx]: {\n 1: [\n ...BASE_TX,\n ['callerId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['nonce', shortUInt],\n ['contractId', FIELD_TYPES.id, [Encoding.ContractAddress, Encoding.Name]],\n ['abiVersion', FIELD_TYPES.abiVersion],\n ['fee', fee],\n ['ttl', shortUInt],\n ['amount', coinAmount],\n ['gasLimit', gasLimit],\n ['gasPrice', gasPrice],\n ['callData', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ],\n },\n [Tag.ContractCall]: {\n 1: [\n ...BASE_TX,\n ['callerId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['callerNonce', shortUInt],\n ['height', shortUInt],\n ['contractId', FIELD_TYPES.id, Encoding.ContractAddress],\n ['gasPrice', gasPrice],\n ['gasUsed', shortUInt],\n ['returnValue', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['returnType', FIELD_TYPES.callReturnType],\n // TODO: add serialization for\n // <log> :: [ { <address> :: id, [ <topics> :: binary() ], <data> :: binary() } ]\n ['log', FIELD_TYPES.rawBinary],\n ],\n },\n [Tag.OracleRegisterTx]: {\n 1: [\n ...BASE_TX,\n ['accountId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['nonce', shortUInt],\n ['queryFormat', FIELD_TYPES.string],\n ['responseFormat', FIELD_TYPES.string],\n ['queryFee', coinAmount],\n ['oracleTtlType', FIELD_TYPES.ttlType],\n ['oracleTtlValue', shortUInt],\n ['fee', fee],\n ['ttl', shortUInt],\n ['abiVersion', FIELD_TYPES.abiVersion],\n ],\n },\n [Tag.OracleExtendTx]: {\n 1: [\n ...BASE_TX,\n ['oracleId', FIELD_TYPES.id, [Encoding.OracleAddress, Encoding.Name]],\n ['nonce', shortUInt],\n ['oracleTtlType', FIELD_TYPES.ttlType],\n ['oracleTtlValue', shortUInt],\n ['fee', fee],\n ['ttl', shortUInt],\n ],\n },\n [Tag.OracleQueryTx]: {\n 1: [\n ...BASE_TX,\n ['senderId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['nonce', shortUInt],\n ['oracleId', FIELD_TYPES.id, [Encoding.OracleAddress, Encoding.Name]],\n ['query', FIELD_TYPES.string],\n ['queryFee', coinAmount],\n ['queryTtlType', FIELD_TYPES.ttlType],\n ['queryTtlValue', shortUInt],\n ['responseTtlType', FIELD_TYPES.ttlType],\n ['responseTtlValue', shortUInt],\n ['fee', fee],\n ['ttl', shortUInt],\n ],\n },\n [Tag.OracleResponseTx]: {\n 1: [\n ...BASE_TX,\n ['oracleId', FIELD_TYPES.id, Encoding.OracleAddress],\n ['nonce', shortUInt],\n ['queryId', FIELD_TYPES.binary, Encoding.OracleQueryId],\n ['response', FIELD_TYPES.string],\n ['responseTtlType', FIELD_TYPES.ttlType],\n ['responseTtlValue', shortUInt],\n ['fee', fee],\n ['ttl', shortUInt],\n ],\n },\n [Tag.ChannelCreateTx]: {\n 2: [\n ...BASE_TX,\n ['initiator', FIELD_TYPES.id, Encoding.AccountAddress],\n ['initiatorAmount', uInt],\n ['responder', FIELD_TYPES.id, Encoding.AccountAddress],\n ['responderAmount', uInt],\n ['channelReserve', uInt],\n ['lockPeriod', uInt],\n ['ttl', shortUInt],\n ['fee', fee],\n ['initiatorDelegateIds', FIELD_TYPES.string],\n ['responderDelegateIds', FIELD_TYPES.string],\n ['stateHash', FIELD_TYPES.binary, 'st'],\n ['nonce', shortUInt],\n ],\n },\n [Tag.ChannelCloseMutualTx]: {\n 1: [\n ...BASE_TX,\n ['channelId', FIELD_TYPES.id, Encoding.Channel],\n ['fromId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['initiatorAmountFinal', uInt],\n ['responderAmountFinal', uInt],\n ['ttl', shortUInt],\n ['fee', fee],\n ['nonce', shortUInt],\n ],\n },\n [Tag.ChannelCloseSoloTx]: {\n 1: [\n ...BASE_TX,\n ['channelId', FIELD_TYPES.id, Encoding.Channel],\n ['fromId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['payload', FIELD_TYPES.binary, 'tx'],\n ['poi', FIELD_TYPES.binary, 'pi'],\n ['ttl', shortUInt],\n ['fee', fee],\n ['nonce', shortUInt],\n ],\n },\n [Tag.ChannelSlashTx]: {\n 1: [\n ...BASE_TX,\n ['channelId', FIELD_TYPES.id, Encoding.Channel],\n ['fromId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['payload', FIELD_TYPES.binary, 'tx'],\n ['poi', FIELD_TYPES.binary, 'pi'],\n ['ttl', shortUInt],\n ['fee', fee],\n ['nonce', shortUInt],\n ],\n },\n [Tag.ChannelDepositTx]: {\n 1: [\n ...BASE_TX,\n ['channelId', FIELD_TYPES.id, Encoding.Channel],\n ['fromId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['amount', uInt],\n ['ttl', shortUInt],\n ['fee', fee],\n ['stateHash', FIELD_TYPES.binary, 'st'],\n ['round', shortUInt],\n ['nonce', shortUInt],\n ],\n },\n [Tag.ChannelWithdrawTx]: {\n 1: [\n ...BASE_TX,\n ['channelId', FIELD_TYPES.id, Encoding.Channel],\n ['toId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['amount', uInt],\n ['ttl', shortUInt],\n ['fee', fee],\n ['stateHash', FIELD_TYPES.binary, 'st'],\n ['round', shortUInt],\n ['nonce', shortUInt],\n ],\n },\n [Tag.ChannelSettleTx]: {\n 1: [\n ...BASE_TX,\n ['channelId', FIELD_TYPES.id, Encoding.Channel],\n ['fromId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['initiatorAmountFinal', uInt],\n ['responderAmountFinal', uInt],\n ['ttl', shortUInt],\n ['fee', fee],\n ['nonce', shortUInt],\n ],\n },\n [Tag.ChannelForceProgressTx]: {\n 1: [\n ...BASE_TX,\n ['channelId', FIELD_TYPES.id, Encoding.Channel],\n ['fromId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['payload', FIELD_TYPES.binary, 'tx'],\n ['round', shortUInt],\n ['update', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['stateHash', FIELD_TYPES.binary, 'st'],\n ['offChainTrees', FIELD_TYPES.stateTree],\n ['ttl', shortUInt],\n ['fee', fee],\n ['nonce', shortUInt],\n ],\n },\n [Tag.ChannelOffChainTx]: {\n 2: [\n ...BASE_TX,\n ['channelId', FIELD_TYPES.id, Encoding.Channel],\n ['round', shortUInt],\n ['stateHash', FIELD_TYPES.binary, 'st'],\n ],\n },\n [Tag.Channel]: {\n 3: [\n ...BASE_TX,\n ['initiator', FIELD_TYPES.id, Encoding.AccountAddress],\n ['responder', FIELD_TYPES.id, Encoding.AccountAddress],\n ['channelAmount', uInt],\n ['initiatorAmount', uInt],\n ['responderAmount', uInt],\n ['channelReserve', uInt],\n ['initiatorDelegateIds', FIELD_TYPES.ids],\n ['responderDelegateIds', FIELD_TYPES.ids],\n ['stateHash', FIELD_TYPES.hex],\n ['round', shortUInt],\n ['soloRound', uInt],\n ['lockPeriod', uInt],\n ['lockedUntil', uInt],\n ['initiatorAuth', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['responderAuth', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ],\n },\n [Tag.ChannelSnapshotSoloTx]: {\n 1: [\n ...BASE_TX,\n ['channelId', FIELD_TYPES.id, Encoding.Channel],\n ['fromId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['payload', FIELD_TYPES.binary, 'tx'],\n ['ttl', shortUInt],\n ['fee', fee],\n ['nonce', shortUInt],\n ],\n },\n [Tag.ChannelOffChainUpdateTransfer]: {\n 1: [\n ...BASE_TX,\n ['from', FIELD_TYPES.id, Encoding.AccountAddress],\n ['to', FIELD_TYPES.id, Encoding.AccountAddress],\n ['amount', uInt],\n ],\n },\n [Tag.ChannelOffChainUpdateDeposit]: {\n 1: [\n ...BASE_TX,\n ['from', FIELD_TYPES.id, Encoding.AccountAddress],\n ['amount', uInt],\n ],\n },\n [Tag.ChannelOffChainUpdateWithdraw]: {\n 1: [\n ...BASE_TX,\n ['from', FIELD_TYPES.id, Encoding.AccountAddress],\n ['amount', uInt],\n ],\n },\n [Tag.ChannelOffChainUpdateCreateContract]: {\n 1: [\n ...BASE_TX,\n ['owner', FIELD_TYPES.id, Encoding.AccountAddress],\n ['ctVersion', FIELD_TYPES.ctVersion],\n ['code', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['deposit', uInt],\n ['callData', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ],\n },\n [Tag.ChannelOffChainUpdateCallContract]: {\n 1: [\n ...BASE_TX,\n ['caller', FIELD_TYPES.id, Encoding.AccountAddress],\n ['contract', FIELD_TYPES.id, Encoding.ContractAddress],\n ['abiVersion', FIELD_TYPES.abiVersion],\n ['amount', uInt],\n ['callData', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['callStack', FIELD_TYPES.callStack],\n ['gasPrice', gasPrice],\n ['gasLimit', gasLimit],\n ],\n },\n [Tag.ChannelClientReconnectTx]: {\n 1: [\n ...BASE_TX,\n ['channelId', FIELD_TYPES.id, Encoding.Channel],\n ['round', shortUInt],\n ['role', FIELD_TYPES.string],\n ['pubkey', FIELD_TYPES.id, Encoding.AccountAddress],\n ],\n },\n [Tag.TreesPoi]: {\n 1: [\n ...BASE_TX,\n ['accounts', FIELD_TYPES.mptrees],\n ['calls', FIELD_TYPES.mptrees],\n ['channels', FIELD_TYPES.mptrees],\n ['contracts', FIELD_TYPES.mptrees],\n ['ns', FIELD_TYPES.mptrees],\n ['oracles', FIELD_TYPES.mptrees],\n ],\n },\n [Tag.StateTrees]: {\n 1: [\n ...BASE_TX,\n ['contracts', FIELD_TYPES.rlpBinary],\n ['calls', FIELD_TYPES.rlpBinary],\n ['channels', FIELD_TYPES.rlpBinary],\n ['ns', FIELD_TYPES.rlpBinary],\n ['oracles', FIELD_TYPES.rlpBinary],\n ['accounts', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.Mtree]: {\n 1: [\n ...BASE_TX,\n ['values', FIELD_TYPES.rlpBinaries],\n ],\n },\n [Tag.MtreeValue]: {\n 1: [\n ...BASE_TX,\n ['key', FIELD_TYPES.hex],\n ['value', FIELD_TYPES.rawBinary],\n ],\n },\n [Tag.ContractsMtree]: {\n 1: [\n ...BASE_TX,\n ['contracts', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.CallsMtree]: {\n 1: [\n ...BASE_TX,\n ['calls', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.ChannelsMtree]: {\n 1: [\n ...BASE_TX,\n ['channels', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.NameserviceMtree]: {\n 1: [\n ...BASE_TX,\n ['mtree', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.OraclesMtree]: {\n 1: [\n ...BASE_TX,\n ['otree', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.AccountsMtree]: {\n 1: [\n ...BASE_TX,\n ['accounts', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.GaAttachTx]: {\n 1: [\n ...BASE_TX,\n ['ownerId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['nonce', shortUInt],\n ['code', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['authFun', FIELD_TYPES.rawBinary],\n ['ctVersion', FIELD_TYPES.ctVersion],\n ['fee', fee],\n ['ttl', shortUInt],\n ['gasLimit', gasLimit],\n ['gasPrice', gasPrice],\n ['callData', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ],\n },\n [Tag.GaMetaTx]: {\n 2: [\n ...BASE_TX,\n ['gaId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['authData', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['abiVersion', FIELD_TYPES.abiVersion],\n ['fee', fee],\n ['gasLimit', gasLimit],\n ['gasPrice', gasPrice],\n ['tx', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.PayingForTx]: {\n 1: [\n ...BASE_TX,\n ['payerId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['nonce', shortUInt],\n ['fee', fee],\n ['tx', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.CompilerSophia]: {\n 3: [\n ...BASE_TX,\n ['sourceCodeHash', FIELD_TYPES.rawBinary],\n ['typeInfo', FIELD_TYPES.sophiaCodeTypeInfo],\n ['byteCode', FIELD_TYPES.rawBinary],\n ['compilerVersion', FIELD_TYPES.string],\n ['payable', FIELD_TYPES.bool],\n ],\n },\n} as const;\n\nexport type TxTypeSchemas = {\n [key in Tag]: BuildTxArgBySchema<\n typeof TX_SCHEMA[key][keyof typeof TX_SCHEMA[key]]\n >\n};\n\nexport type TxSchema = TxTypeSchemas[Tag];\nexport type TxParamsCommon = Partial<UnionToIntersection<TxSchema>>;\n","/*\n * ISC License (ISC)\n * Copyright (c) 2021 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\n/* eslint-disable default-case */\nimport { encode as rlpEncode } from 'rlp';\nimport type { Input } from 'rlp';\nimport { hash } from './crypto';\nimport {\n MerkleTreeHashMismatchError,\n MissingNodeInTreeError,\n UnknownPathNibbleError,\n UnknownNodeLengthError,\n} from './errors';\n\nenum NodeType {\n Branch,\n Extension,\n Leaf,\n}\n\nexport type MPTreeBinary = [Buffer, Array<[Buffer, Buffer[]]>];\n\nexport default class MPTree {\n private readonly rootHash: string;\n\n private readonly nodes: { [key: string]: Buffer[] };\n\n private static nodeHash(node: Input): string {\n return Buffer.from(hash(rlpEncode(node))).toString('hex');\n }\n\n /**\n * Deserialize Merkle Patricia Tree\n * @param binary - Binary\n * @returns Merkle Patricia Tree\n */\n constructor(binary: MPTreeBinary) {\n this.rootHash = binary[0].toString('hex');\n this.nodes = Object.fromEntries(\n binary[1].map((node) => [node[0].toString('hex'), node[1]]),\n );\n\n if (this.nodes[this.rootHash] === undefined) throw new MissingNodeInTreeError('Can\\'t find a node by root hash');\n Object.entries(this.nodes).forEach(([key, node]) => {\n if (MPTree.nodeHash(node) !== key) throw new MerkleTreeHashMismatchError();\n const { type, payload } = MPTree.parseNode(node);\n switch (type) {\n case NodeType.Branch:\n payload\n .slice(0, 16)\n .filter((n) => n.length)\n .forEach((n) => {\n if (this.nodes[n.toString('hex')] === undefined) {\n throw new MissingNodeInTreeError('Can\\'t find a node by hash in branch node');\n }\n });\n break;\n case NodeType.Extension:\n if (this.nodes[payload[0].toString('hex')] === undefined) {\n throw new MissingNodeInTreeError('Can\\'t find a node by hash in extension node');\n }\n }\n });\n }\n\n isEqual(tree: MPTree): boolean {\n return this.rootHash === tree.rootHash;\n }\n\n private static parseNode(node: Buffer[]): {\n type: NodeType;\n payload: Buffer[];\n path: string | null;\n } {\n switch (node.length) {\n case 17:\n return { type: NodeType.Branch, payload: node, path: null };\n case 2: {\n const nibble = node[0][0] >> 4; // eslint-disable-line no-bitwise\n if (nibble > 3) throw new UnknownPathNibbleError(nibble);\n const type = nibble <= 1 ? NodeType.Extension : NodeType.Leaf;\n const slice = [0, 2].includes(nibble) ? 2 : 1;\n return { type, payload: [node[1]], path: node[0].toString('hex').slice(slice) };\n }\n default:\n throw new UnknownNodeLengthError(node.length);\n }\n }\n\n /**\n * Serialize Merkle Patricia Tree\n * @returns Binary\n */\n serialize(): MPTreeBinary {\n return [\n Buffer.from(this.rootHash, 'hex'),\n Object.entries(this.nodes).map(([mptHash, value]) => ([\n Buffer.from(mptHash, 'hex'),\n value,\n ])),\n ];\n }\n\n /**\n * Retrieve value from Merkle Patricia Tree\n * @param _key - The key of the element to retrieve\n * @returns Value associated to the specified key\n */\n get(_key: string): Buffer | undefined {\n let searchFrom = this.rootHash;\n let key = _key;\n while (true) { // eslint-disable-line no-constant-condition\n const { type, payload, path } = MPTree.parseNode(this.nodes[searchFrom]);\n switch (type) {\n case NodeType.Branch:\n if (key.length === 0) return payload[16];\n searchFrom = payload[+`0x${key[0]}`].toString('hex');\n key = key.substring(1);\n break;\n case NodeType.Extension:\n if (key.substring(0, path?.length) !== path) return undefined;\n searchFrom = payload[0].toString('hex');\n key = key.substring(path.length);\n break;\n case NodeType.Leaf:\n if (path !== key) return undefined;\n return payload[0];\n }\n }\n }\n}\n","import { decode as rlpDecode, encode as rlpEncode, NestedUint8Array } from 'rlp';\nimport {\n decode, encode, Encoded, Encoding,\n} from '../../utils/encoder';\nimport { AE_AMOUNT_FORMATS } from '../../utils/amount-formatter';\nimport { hash } from '../../utils/crypto';\nimport { Field } from './field-types';\nimport {\n FIELD_TYPES,\n RawTxObject,\n TX_SCHEMA,\n TxField,\n TxParamsCommon,\n TxSchema,\n TxTypeSchemas,\n} from './schema';\nimport { Tag } from './constants';\nimport {\n buildContractId, buildPointers, readInt, readPointers, writeInt,\n} from './helpers';\nimport { readId, writeId } from './address';\nimport { toBytes } from '../../utils/bytes';\nimport MPTree, { MPTreeBinary } from '../../utils/mptree';\nimport {\n ArgumentError,\n DecodeError,\n InvalidTxParamsError,\n SchemaNotFoundError,\n} from '../../utils/errors';\nimport { isKeyOfObject } from '../../utils/other';\nimport { NamePointer } from '../../apis/node';\n\n/**\n * JavaScript-based Transaction builder\n */\n\n// SERIALIZE AND DESERIALIZE PART\nfunction deserializeField(\n value: any,\n type: FIELD_TYPES | Field,\n prefix?: Encoding | Encoding[],\n): any {\n if (value == null) return '';\n switch (type) {\n case FIELD_TYPES.ctVersion: {\n const [vm, , abi] = value;\n return {\n vmVersion: readInt(Buffer.from([vm])),\n abiVersion: readInt(Buffer.from([abi])),\n };\n }\n case FIELD_TYPES.abiVersion:\n case FIELD_TYPES.ttlType:\n return readInt(value);\n case FIELD_TYPES.id:\n return readId(value);\n case FIELD_TYPES.ids:\n return value.map(readId);\n case FIELD_TYPES.bool:\n return value[0] === 1;\n case FIELD_TYPES.binary:\n return encode(value, prefix as Encoding);\n case FIELD_TYPES.stateTree:\n return encode(value, Encoding.StateTrees);\n case FIELD_TYPES.string:\n return value.toString();\n case FIELD_TYPES.payload:\n return encode(value, Encoding.Bytearray);\n case FIELD_TYPES.pointers:\n return readPointers(value);\n case FIELD_TYPES.rlpBinary:\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return unpackTx(encode(value, Encoding.Transaction));\n case FIELD_TYPES.rlpBinaries:\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return value.map((v: Buffer) => unpackTx(encode(v, Encoding.Transaction)));\n case FIELD_TYPES.rawBinary:\n return value;\n case FIELD_TYPES.hex:\n return value.toString('hex');\n case FIELD_TYPES.offChainUpdates:\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return value.map((v: Buffer) => unpackTx(encode(v, Encoding.Transaction)));\n case FIELD_TYPES.callStack:\n // TODO: fix this\n return [readInt(value)];\n case FIELD_TYPES.mptrees:\n return value.map((t: MPTreeBinary) => new MPTree(t));\n case FIELD_TYPES.callReturnType:\n switch (readInt(value)) {\n case '0':\n return 'ok';\n case '1':\n return 'error';\n case '2':\n return 'revert';\n default:\n return value;\n }\n case FIELD_TYPES.sophiaCodeTypeInfo:\n return value.reduce(\n (acc: object, [funHash, fnName, argType, outType]: [\n funHash: Buffer,\n fnName: string,\n argType: string,\n outType: string,\n ]) => ({\n ...acc,\n [fnName.toString()]: { funHash, argType, outType },\n }),\n {},\n );\n default:\n if (typeof type === 'number') return value;\n return type.deserialize(value);\n }\n}\n\nfunction serializeField(value: any, type: FIELD_TYPES | Field, params: any): any {\n switch (type) {\n case FIELD_TYPES.abiVersion:\n case FIELD_TYPES.ttlType:\n return writeInt(value);\n case FIELD_TYPES.id:\n return writeId(value);\n case FIELD_TYPES.ids:\n return value.map(writeId);\n case FIELD_TYPES.bool:\n return Buffer.from([(value === true) ? 1 : 0]);\n case FIELD_TYPES.binary:\n return decode(value);\n case FIELD_TYPES.stateTree:\n return decode(value);\n case FIELD_TYPES.hex:\n return Buffer.from(value, 'hex');\n case FIELD_TYPES.signatures:\n return value.map(Buffer.from);\n case FIELD_TYPES.payload:\n return typeof value === 'string' && value.split('_')[0] === 'ba'\n ? decode(value as Encoded.Bytearray)\n : toBytes(value);\n case FIELD_TYPES.string:\n return toBytes(value);\n case FIELD_TYPES.pointers:\n return buildPointers(value);\n case FIELD_TYPES.rlpBinary:\n return value.rlpEncoded ?? value;\n case FIELD_TYPES.mptrees:\n return value.map((t: MPTree) => t.serialize());\n case FIELD_TYPES.ctVersion:\n return Buffer.from([...toBytes(value.vmVersion), 0, ...toBytes(value.abiVersion)]);\n case FIELD_TYPES.callReturnType:\n switch (value) {\n case 'ok': return writeInt(0);\n case 'error': return writeInt(1);\n case 'revert': return writeInt(2);\n default: return value;\n }\n default:\n if (typeof type === 'number') return value;\n // @ts-expect-error will be solved after removing the whole serializeField function\n return type.serialize(value, params);\n }\n}\n\nfunction validateField(\n value: any,\n type: FIELD_TYPES | Field,\n prefix?: Encoding | Encoding[],\n): string | undefined {\n // All fields are required\n if (value == null) return 'Field is required';\n\n // Validate type of value\n switch (type) {\n case FIELD_TYPES.id: {\n const prefixes = Array.isArray(prefix) ? prefix : [prefix];\n if (!prefixes.includes(value.split('_')[0])) {\n if (prefix == null) { return `'${String(value)}' prefix doesn't exist'`; }\n return `'${String(value)}' prefix doesn't match expected prefix '${prefix.toString()}'`;\n }\n return undefined;\n }\n case FIELD_TYPES.ctVersion:\n if (!(Boolean(value.abiVersion) && Boolean(value.vmVersion))) {\n return 'Value must be an object with \"vmVersion\" and \"abiVersion\" fields';\n }\n return undefined;\n case FIELD_TYPES.pointers:\n if (!Array.isArray(value)) return 'Value must be of type Array';\n if (value.some((p: NamePointer) => !(Boolean(p.key) && Boolean(p.id)))) {\n return 'Value must contains only object\\'s like \\'{key: \"account_pubkey\", id: \"ak_lkamsflkalsdalksdlasdlasdlamd\"}\\'';\n }\n if (value.length > 32) {\n return `Expected 32 pointers or less, got ${value.length} instead`;\n }\n return undefined;\n default:\n return undefined;\n }\n}\n\n/**\n * Validate transaction params\n * @category transaction builder\n * @param params - Object with tx params\n * @param schema - Transaction schema\n * @param excludeKeys - Array of keys to exclude for validation\n * @returns Object with validation errors\n */\nexport function validateParams(\n params: any,\n schema: TxField[],\n { excludeKeys = [] }: { excludeKeys: string[] },\n): object {\n return Object.fromEntries(\n schema\n // TODO: allow optional keys in schema\n .filter(([key]) => !excludeKeys.includes(key)\n && !['payload', 'nameFee', 'deposit', 'gasPrice', 'fee', 'gasLimit'].includes(key))\n .map(([key, type, prefix]) => [key, validateField(params[key], type, prefix)])\n .filter(([, message]) => message),\n );\n}\n\n/**\n * Unpack binary transaction\n * @category transaction builder\n * @param binary - Array with binary transaction field's\n * @param schema - Transaction schema\n * @returns Object with transaction field's\n */\nexport function unpackRawTx<Tx extends TxSchema>(\n binary: Uint8Array | NestedUint8Array,\n schema: TxField[],\n): RawTxObject<Tx> {\n return schema\n .reduce<any>(\n (\n acc,\n [key, fieldType, prefix],\n index,\n ) => Object.assign(acc, { [key]: deserializeField(binary[index], fieldType, prefix) }),\n {},\n );\n}\n\n/**\n * @category transaction builder\n */\nexport interface BuiltTx<Tx extends TxSchema, Prefix extends Encoding> {\n tx: Encoded.Generic<Prefix>;\n rlpEncoded: Uint8Array;\n binary: Uint8Array;\n txObject: RawTxObject<Tx>;\n}\n\n/**\n * Build transaction hash\n * @category transaction builder\n * @param _params - Object with tx params\n * @param type - Transaction type\n * @param options - options\n * @param options.excludeKeys - Array of keys to exclude for validation and build\n * @param options.denomination - Denomination of amounts\n * @param options.prefix - Prefix of transaction\n * @throws {@link InvalidTxParamsError}\n * @returns object\n * @returns object.tx Base64Check transaction hash with 'tx_' prefix\n * @returns object.rlpEncoded rlp encoded transaction\n * @returns object.binary binary transaction\n */\nexport function buildTx<TxType extends Tag, Prefix>(\n _params: Omit<TxTypeSchemas[TxType], 'tag' | 'VSN'> & { VSN?: number },\n type: TxType,\n {\n excludeKeys = [],\n prefix = Encoding.Transaction,\n vsn,\n denomination = AE_AMOUNT_FORMATS.AETTOS,\n }: {\n excludeKeys?: string[];\n prefix?: Encoding;\n vsn?: number;\n denomination?: AE_AMOUNT_FORMATS;\n } = {},\n): BuiltTx<TxSchema, Prefix extends Encoding ? Prefix : Encoding.Transaction> {\n const schemas = TX_SCHEMA[type];\n\n vsn ??= Math.max(...Object.keys(schemas).map((a) => +a));\n if (!isKeyOfObject(vsn, schemas)) throw new SchemaNotFoundError('serialization', Tag[type], vsn);\n\n const schema = schemas[vsn] as unknown as TxField[];\n\n const params = _params as TxParamsCommon & { onNode: Node; denomination?: AE_AMOUNT_FORMATS };\n params.VSN = vsn;\n params.tag = type;\n params.denomination = denomination;\n const filteredSchema = schema.filter(([key]) => !excludeKeys.includes(key));\n\n // Validation\n const valid = validateParams(params, schema, { excludeKeys });\n if (Object.keys(valid).length > 0) {\n throw new InvalidTxParamsError(`Transaction build error. ${JSON.stringify(valid)}`);\n }\n\n const binary = filteredSchema\n .map(([key, fieldType]: [keyof TxSchema, FIELD_TYPES, Encoding]) => (\n serializeField(\n params[key],\n fieldType,\n {\n ...params,\n txType: type,\n rebuildTx: (overrideParams: any) => buildTx(\n { ...params, ...overrideParams },\n type,\n {\n excludeKeys, prefix: Encoding.Transaction, vsn, denomination,\n },\n ),\n },\n )\n ))\n .filter((e) => e !== undefined);\n\n const rlpEncoded = rlpEncode(binary);\n const tx = encode(rlpEncoded, prefix);\n return {\n tx,\n rlpEncoded,\n binary,\n txObject: unpackRawTx<TxTypeSchemas[Tag]>(binary, schema),\n } as any;\n}\n\n/**\n * @category transaction builder\n */\nexport interface TxUnpacked<Tx extends TxSchema> {\n txType: Tag;\n tx: RawTxObject<Tx>;\n rlpEncoded: Uint8Array;\n}\n/**\n * Unpack transaction hash\n * @category transaction builder\n * @param encodedTx - Transaction to unpack\n * @param txType - Expected transaction type\n * @returns object\n * @returns object.tx Object with transaction param's\n * @returns object.txType Transaction type\n */\nexport function unpackTx<TxType extends Tag>(\n encodedTx: Encoded.Transaction | Encoded.Poi,\n txType?: TxType,\n): TxUnpacked<TxTypeSchemas[TxType]> {\n const rlpEncoded = decode(encodedTx);\n const binary = rlpDecode(rlpEncoded);\n const objId = +readInt(binary[0] as Buffer);\n if (!isKeyOfObject(objId, TX_SCHEMA)) throw new DecodeError(`Unknown transaction tag: ${objId}`);\n if (txType != null && txType !== objId) throw new DecodeError(`Expected transaction to have ${Tag[txType]} tag, got ${Tag[objId]} instead`);\n const vsn = +readInt(binary[1] as Buffer);\n if (!isKeyOfObject(vsn, TX_SCHEMA[objId])) throw new SchemaNotFoundError('deserialization', `tag ${objId}`, vsn);\n const schema = TX_SCHEMA[objId][vsn];\n return {\n txType: objId,\n tx: unpackRawTx<TxTypeSchemas[TxType]>(binary, schema),\n rlpEncoded,\n };\n}\n\n/**\n * Build a transaction hash\n * @category transaction builder\n * @param rawTx - base64 or rlp encoded transaction\n * @returns Transaction hash\n */\nexport function buildTxHash(rawTx: Encoded.Transaction | Uint8Array): Encoded.TxHash {\n const data = typeof rawTx === 'string' && rawTx.startsWith('tx_')\n ? decode(rawTx)\n : rawTx;\n return encode(hash(data), Encoding.TxHash);\n}\n\n/**\n * Build a contract public key by contractCreateTx or gaAttach\n * @category contract\n * @param contractTx - Transaction\n * @returns Contract public key\n */\nexport function buildContractIdByContractTx(\n contractTx: Encoded.Transaction,\n): Encoded.ContractAddress {\n const { txType, tx } = unpackTx<Tag.ContractCreateTx | Tag.GaAttachTx>(contractTx);\n if (![Tag.ContractCreateTx, Tag.GaAttachTx].includes(txType)) {\n throw new ArgumentError('contractCreateTx', 'a contractCreateTx or gaAttach', txType);\n }\n return buildContractId(tx.ownerId, +tx.nonce);\n}\n","import BigNumber from 'bignumber.js';\nimport { hash, verify } from '../utils/crypto';\nimport {\n CtVersion,\n PROTOCOL_VM_ABI,\n RawTxObject,\n TxParamsCommon,\n TxSchema,\n TxTypeSchemas,\n} from './builder/schema';\nimport { Tag } from './builder/constants';\nimport { TxUnpacked, unpackTx } from './builder';\nimport { UnsupportedProtocolError } from '../utils/errors';\nimport { concatBuffers, isKeyOfObject } from '../utils/other';\nimport {\n decode, encode, Encoded, Encoding,\n} from '../utils/encoder';\nimport Node from '../Node';\n\ninterface Account {\n balance: bigint;\n id: Encoded.AccountAddress;\n nonce: number;\n}\n\nexport interface ValidatorResult {\n message: string;\n key: string;\n checkedKeys: string[];\n}\n\ntype Validator = (\n tx: {\n encodedTx: TxUnpacked<TxSchema>;\n signatures: Buffer[];\n tx: TxUnpacked<TxSchema> & {\n tx: TxTypeSchemas[Tag.SignedTx];\n };\n nonce?: number;\n ttl?: number;\n amount?: number;\n fee?: number;\n nameFee?: number;\n ctVersion?: Partial<CtVersion>;\n abiVersion?: number;\n contractId?: Encoded.ContractAddress;\n },\n options: {\n account?: Account;\n nodeNetworkId: string;\n parentTxTypes: Tag[];\n node: Node;\n txType: Tag;\n height: number;\n consensusProtocolVersion: number;\n }\n) => ValidatorResult[] | Promise<ValidatorResult[]>;\n\nconst validators: Validator[] = [];\n\nconst getSenderAddress = (\n tx: TxParamsCommon | RawTxObject<TxSchema>,\n): Encoded.AccountAddress | undefined => [\n 'senderId', 'accountId', 'ownerId', 'callerId',\n 'oracleId', 'fromId', 'initiator', 'gaId', 'payerId',\n]\n .map((key: keyof TxSchema) => tx[key])\n .filter((a) => a)\n .map((a) => a?.toString().replace(/^ok_/, 'ak_'))[0] as Encoded.AccountAddress | undefined;\n\n/**\n * Transaction Validator\n * This function validates some of transaction properties,\n * to make sure it can be posted it to the chain\n * @category transaction builder\n * @param transaction - Base64Check-encoded transaction\n * @param node - Node to validate transaction against\n * @param parentTxTypes - Types of parent transactions\n * @returns Array with verification errors\n * @example const errors = await verifyTransaction(transaction, node)\n */\nexport default async function verifyTransaction(\n transaction: Encoded.Transaction | Encoded.Poi,\n node: Node,\n parentTxTypes: Tag[] = [],\n): Promise<ValidatorResult[]> {\n const { tx, txType } = unpackTx<Tag.SignedTx>(transaction);\n const address = getSenderAddress(tx)\n ?? (txType === Tag.SignedTx ? getSenderAddress(tx.encodedTx.tx) : undefined);\n const [account, { height }, { consensusProtocolVersion, nodeNetworkId }] = await Promise.all([\n address == null\n ? undefined\n : node.getAccountByPubkey(address)\n .catch(() => ({ id: address, balance: 0n, nonce: 0 }))\n // TODO: remove after fixing https://github.com/aeternity/aepp-sdk-js/issues/1537\n .then((acc) => ({ ...acc, id: acc.id as Encoded.AccountAddress })),\n node.getCurrentKeyBlockHeight(),\n node.getNodeInfo(),\n ]);\n\n return (await Promise.all(\n validators.map((v) => v(\n tx as any,\n {\n txType, node, account, height, consensusProtocolVersion, nodeNetworkId, parentTxTypes,\n },\n )),\n )).flat();\n}\n\nvalidators.push(\n ({ encodedTx, signatures }, { account, nodeNetworkId, parentTxTypes }) => {\n if ((encodedTx ?? signatures) === undefined) return [];\n if (account == null) return [];\n if (signatures.length !== 1) return []; // TODO: Support multisignature?\n const prefix = Buffer.from([\n nodeNetworkId,\n ...parentTxTypes.includes(Tag.PayingForTx) ? ['inner_tx'] : [],\n ].join('-'));\n const txWithNetworkId = concatBuffers([prefix, encodedTx.rlpEncoded]);\n const txHashWithNetworkId = concatBuffers([prefix, hash(encodedTx.rlpEncoded)]);\n const decodedPub = decode(account.id);\n if (verify(txWithNetworkId, signatures[0], decodedPub)\n || verify(txHashWithNetworkId, signatures[0], decodedPub)) return [];\n return [{\n message: 'Signature cannot be verified, please ensure that you transaction have'\n + ' the correct prefix and the correct private key for the sender address',\n key: 'InvalidSignature',\n checkedKeys: ['encodedTx', 'signatures'],\n }];\n },\n async ({ encodedTx, tx }, { node, parentTxTypes, txType }) => {\n if ((encodedTx ?? tx) === undefined) return [];\n return verifyTransaction(\n encode((encodedTx ?? tx).rlpEncoded, Encoding.Transaction),\n node,\n [...parentTxTypes, txType],\n );\n },\n ({ ttl }, { height }) => {\n if (ttl === undefined) return [];\n ttl = +ttl;\n if (ttl === 0 || ttl >= height) return [];\n return [{\n message: `TTL ${ttl} is already expired, current height is ${height}`,\n key: 'ExpiredTTL',\n checkedKeys: ['ttl'],\n }];\n },\n ({\n amount, fee, nameFee, tx,\n }, { account, parentTxTypes, txType }) => {\n if (account == null) return [];\n if ((amount ?? fee ?? nameFee) === undefined) return [];\n fee ??= 0;\n const cost = new BigNumber(fee).plus(nameFee ?? 0).plus(amount ?? 0)\n .plus(txType === Tag.PayingForTx ? (tx.tx.encodedTx.tx).fee : 0)\n .minus(parentTxTypes.includes(Tag.PayingForTx) ? fee : 0);\n if (cost.lte(account.balance.toString())) return [];\n return [{\n message: `Account balance ${account.balance.toString()} is not enough to execute the transaction that costs ${cost.toFixed()}`,\n key: 'InsufficientBalance',\n checkedKeys: ['amount', 'fee', 'nameFee'],\n }];\n },\n ({ nonce }, { account, parentTxTypes }) => {\n if (nonce == null || account == null || parentTxTypes.includes(Tag.GaMetaTx)) return [];\n nonce = +nonce;\n const validNonce = account.nonce + 1;\n if (nonce === validNonce) return [];\n return [{\n ...nonce < validNonce\n ? {\n message: `Nonce ${nonce} is already used, valid nonce is ${validNonce}`,\n key: 'NonceAlreadyUsed',\n }\n : {\n message: `Nonce ${nonce} is too high, valid nonce is ${validNonce}`,\n key: 'NonceHigh',\n },\n checkedKeys: ['nonce'],\n }];\n },\n ({ ctVersion, abiVersion }, { txType, consensusProtocolVersion }) => {\n if (!isKeyOfObject(consensusProtocolVersion, PROTOCOL_VM_ABI)) {\n throw new UnsupportedProtocolError(`Unsupported protocol: ${consensusProtocolVersion}`);\n }\n const protocol = PROTOCOL_VM_ABI[consensusProtocolVersion];\n\n // If not contract create tx\n if (ctVersion == null) ctVersion = { abiVersion };\n const txProtocol = protocol[txType as keyof typeof protocol];\n if (txProtocol == null) return [];\n if (Object.entries(ctVersion).some(\n ([\n key,\n value,\n ]: [\n key:keyof typeof txProtocol,\n value:any]) => !(txProtocol[key].includes(+value as never)),\n )) {\n return [{\n message: `ABI/VM version ${JSON.stringify(ctVersion)} is wrong, supported is: ${JSON.stringify(txProtocol)}`,\n key: 'VmAndAbiVersionMismatch',\n checkedKeys: ['ctVersion', 'abiVersion'],\n }];\n }\n return [];\n },\n async ({ contractId }, { txType, node }) => {\n if (Tag.ContractCallTx !== txType) return [];\n contractId = contractId as Encoded.ContractAddress;\n try {\n const { active } = await node.getContract(contractId);\n if (active) return [];\n return [{\n message: `Contract ${contractId} is not active`,\n key: 'ContractNotActive',\n checkedKeys: ['contractId'],\n }];\n } catch (error) {\n if (error.response?.parsedBody?.reason == null) throw error;\n return [{\n message: error.response.parsedBody.reason,\n key: 'ContractNotFound',\n checkedKeys: ['contractId'],\n }];\n }\n },\n);\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport { AE_AMOUNT_FORMATS, formatAmount } from './utils/amount-formatter';\nimport verifyTransaction, { ValidatorResult } from './tx/validator';\nimport { pause } from './utils/other';\nimport { isNameValid, produceNameId } from './tx/builder/helpers';\nimport { DRY_RUN_ACCOUNT } from './tx/builder/schema';\nimport { AensName } from './tx/builder/constants';\nimport {\n AensPointerContextError, DryRunError, InvalidAensNameError, TransactionError,\n TxTimedOutError, TxNotInChainError, InternalError,\n} from './utils/errors';\nimport Node, { TransformNodeType } from './Node';\nimport {\n Account as AccountNode, ByteCode, ContractObject, DryRunResult, DryRunResults,\n Generation, KeyBlock, MicroBlockHeader, NameEntry, SignedTx,\n} from './apis/node';\nimport { decode, Encoded, Encoding } from './utils/encoder';\nimport AccountBase from './account/Base';\n\n/**\n * @category chain\n */\nexport function _getPollInterval(\n type: 'block' | 'microblock',\n { _expectedMineRate = 180000, _microBlockCycle = 3000, _maxPollInterval = 5000 }:\n { _expectedMineRate?: number; _microBlockCycle?: number; _maxPollInterval?: number },\n): number {\n const base = {\n block: _expectedMineRate,\n microblock: _microBlockCycle,\n }[type];\n return Math.min(base / 3, _maxPollInterval);\n}\n\n/**\n * @category exception\n */\nexport class InvalidTxError extends TransactionError {\n validation: ValidatorResult[];\n\n transaction: Encoded.Transaction;\n\n constructor(\n message: string,\n validation: ValidatorResult[],\n transaction: Encoded.Transaction,\n ) {\n super(message);\n this.name = 'InvalidTxError';\n this.validation = validation;\n this.transaction = transaction;\n }\n}\n\n/**\n * Obtain current height of the chain\n * @category chain\n * @returns Current chain height\n */\nexport async function getHeight({ onNode }: { onNode: Node }): Promise<number> {\n return (await onNode.getCurrentKeyBlockHeight()).height;\n}\n\n/**\n * Wait for a transaction to be mined\n * @category chain\n * @param th - The hash of transaction to poll\n * @param options - Options\n * @param options.interval - Interval (in ms) at which to poll the chain\n * @param options.blocks - Number of blocks mined after which to fail\n * @param options.onNode - Node to use\n * @returns The transaction as it was mined\n */\nexport async function poll(\n th: Encoded.TxHash,\n {\n blocks = 10, interval, onNode, ...options\n }:\n { blocks?: number; interval?: number; onNode: Node } & Parameters<typeof _getPollInterval>[1],\n): Promise<TransformNodeType<SignedTx>> {\n interval ??= _getPollInterval('microblock', options);\n const max = await getHeight({ onNode }) + blocks;\n do {\n const tx = await onNode.getTransactionByHash(th);\n if (tx.blockHeight !== -1) return tx;\n await pause(interval);\n } while (await getHeight({ onNode }) < max);\n throw new TxTimedOutError(blocks, th);\n}\n\n/**\n * Wait for the chain to reach a specific height\n * @category chain\n * @param height - Height to wait for\n * @param options - Options\n * @param options.interval - Interval (in ms) at which to poll the chain\n * @param options.onNode - Node to use\n * @returns Current chain height\n */\nexport async function awaitHeight(\n height: number,\n { interval, onNode, ...options }:\n { interval?: number; onNode: Node } & Parameters<typeof _getPollInterval>[1],\n): Promise<number> {\n interval ??= _getPollInterval('block', options);\n let currentHeight;\n do {\n if (currentHeight != null) await pause(interval);\n currentHeight = (await onNode.getCurrentKeyBlockHeight()).height;\n } while (currentHeight < height);\n return currentHeight;\n}\n\n/**\n * Wait for transaction confirmation\n * @category chain\n * @param txHash - Transaction hash\n * @param options - Options\n * @param options.confirm - Number of micro blocks to wait for transaction confirmation\n * @param options.onNode - Node to use\n * @returns Current Height\n */\nexport async function waitForTxConfirm(\n txHash: Encoded.TxHash,\n { confirm = 3, onNode, ...options }:\n { confirm?: number; onNode: Node } & Parameters<typeof awaitHeight>[1],\n): Promise<number> {\n const { blockHeight } = await onNode.getTransactionByHash(txHash);\n const height = await awaitHeight(blockHeight + confirm, { onNode, ...options });\n const { blockHeight: newBlockHeight } = await onNode.getTransactionByHash(txHash);\n switch (newBlockHeight) {\n case -1:\n throw new TxNotInChainError(txHash);\n case blockHeight:\n return height;\n default:\n return waitForTxConfirm(txHash, { onNode, confirm, ...options });\n }\n}\n\n/**\n * Submit a signed transaction for mining\n * @category chain\n * @param tx - Transaction to submit\n * @param options - Options\n * @param options.onNode - Node to use\n * @param options.onAccount - Account to use\n * @param options.verify - Verify transaction before sending\n * @param options.waitMined - Ensure that transaction get into block\n * @param options.confirm - Number of micro blocks that should be mined after tx get included\n * @returns Transaction details\n */\nexport async function sendTransaction(\n tx: Encoded.Transaction,\n {\n onNode, onAccount, verify = true, waitMined = true, confirm, ...options\n }:\n SendTransactionOptions,\n): Promise<SendTransactionReturnType> {\n if (verify) {\n const validation = await verifyTransaction(tx, onNode);\n if (validation.length > 0) {\n const message = `Transaction verification errors: ${\n validation.map((v: { message: string }) => v.message).join(', ')}`;\n throw new InvalidTxError(message, validation, tx);\n }\n }\n\n try {\n let __queue;\n try {\n __queue = onAccount != null ? `tx-${await onAccount.address(options)}` : null;\n } catch (error) {\n __queue = null;\n }\n const { txHash } = await onNode.postTransaction(\n { tx },\n __queue != null ? { requestOptions: { customHeaders: { __queue } } } : {},\n );\n\n if (waitMined) {\n const pollResult = await poll(txHash, { onNode, ...options });\n const txData = {\n ...pollResult,\n hash: pollResult.hash as Encoded.TxHash,\n rawTx: tx,\n };\n // wait for transaction confirmation\n if (confirm != null && (confirm === true || confirm > 0)) {\n const c = typeof confirm === 'boolean' ? undefined : confirm;\n return {\n ...txData,\n confirmationHeight: await waitForTxConfirm(txHash, { onNode, confirm: c, ...options }),\n };\n }\n return txData;\n }\n return { hash: txHash, rawTx: tx };\n } catch (error) {\n throw Object.assign(error, {\n rawTx: tx,\n verifyTx: async () => verifyTransaction(tx, onNode),\n });\n }\n}\n\ntype SendTransactionOptionsType = {\n onNode: Node;\n onAccount?: AccountBase;\n verify?: boolean;\n waitMined?: boolean;\n confirm?: boolean | number;\n} & Parameters<typeof poll>[1] & Omit<Parameters<typeof waitForTxConfirm>[1], 'confirm'>;\ninterface SendTransactionOptions extends SendTransactionOptionsType {}\ninterface SendTransactionReturnType extends Partial<TransformNodeType<SignedTx>> {\n hash: Encoded.TxHash;\n rawTx: Encoded.Transaction;\n confirmationHeight?: number;\n}\n\n/**\n * Get account by account public key\n * @category chain\n * @param address - Account address (public key)\n * @param options - Options\n * @param options.height - Get account on specific block by block height\n * @param options.hash - Get account on specific block by micro block hash or key block hash\n * @param options.onNode - Node to use\n */\nexport async function getAccount(\n address: Encoded.AccountAddress | Encoded.ContractAddress,\n { height, hash, onNode }:\n { height?: number; hash?: Encoded.KeyBlockHash | Encoded.MicroBlockHash; onNode: Node },\n): Promise<TransformNodeType<AccountNode>> {\n if (height != null) return onNode.getAccountByPubkeyAndHeight(address, height);\n if (hash != null) return onNode.getAccountByPubkeyAndHash(address, hash);\n return onNode.getAccountByPubkey(address);\n}\n\n/**\n * Request the balance of specified account\n * @category chain\n * @param address - The public account address to obtain the balance for\n * @param options - Options\n * @param options.format\n * @param options.height - The chain height at which to obtain the balance for\n * (default: top of chain)\n * @param options.hash - The block hash on which to obtain the balance for (default: top of chain)\n */\nexport async function getBalance(\n address: Encoded.AccountAddress | Encoded.ContractAddress,\n { format = AE_AMOUNT_FORMATS.AETTOS, ...options }:\n { format?: AE_AMOUNT_FORMATS } & Parameters<typeof getAccount>[1],\n): Promise<string> {\n const { balance } = await getAccount(address, options).catch(() => ({ balance: 0n }));\n\n return formatAmount(balance, { targetDenomination: format });\n}\n\n/**\n * Obtain current generation\n * @category chain\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Current Generation\n */\nexport async function getCurrentGeneration(\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<Generation>> {\n return onNode.getCurrentGeneration();\n}\n\n/**\n * Get generation by hash or height\n * @category chain\n * @param hashOrHeight - Generation hash or height\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Generation\n */\nexport async function getGeneration(\n hashOrHeight: Encoded.KeyBlockHash | number,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<Generation>> {\n if (typeof hashOrHeight === 'number') return onNode.getGenerationByHeight(hashOrHeight);\n return onNode.getGenerationByHash(hashOrHeight);\n}\n\n/**\n * Get micro block transactions\n * @category chain\n * @param hash - Micro block hash\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Transactions\n */\nexport async function getMicroBlockTransactions(\n hash: Encoded.MicroBlockHash,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<SignedTx[]>> {\n return (await onNode.getMicroBlockTransactionsByHash(hash)).transactions;\n}\n\n/**\n * Get key block\n * @category chain\n * @param hashOrHeight - Key block hash or height\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Key Block\n */\nexport async function getKeyBlock(\n hashOrHeight: Encoded.KeyBlockHash | number,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<KeyBlock>> {\n if (typeof hashOrHeight === 'number') return onNode.getKeyBlockByHeight(hashOrHeight);\n return onNode.getKeyBlockByHash(hashOrHeight);\n}\n\n/**\n * Get micro block header\n * @category chain\n * @param hash - Micro block hash\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Micro block header\n */\nexport async function getMicroBlockHeader(\n hash: Encoded.MicroBlockHash,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<MicroBlockHeader>> {\n return onNode.getMicroBlockHeaderByHash(hash);\n}\n\ninterface TxDryRunArguments {\n tx: Encoded.Transaction;\n accountAddress: Encoded.AccountAddress;\n top?: number;\n txEvents?: any;\n resolve: Function;\n reject: Function;\n}\nconst txDryRunRequests: Map<string, TxDryRunArguments[] & { timeout?: NodeJS.Timeout }> = new Map();\n\nasync function txDryRunHandler(key: string, onNode: Node): Promise<void> {\n const rs = txDryRunRequests.get(key);\n txDryRunRequests.delete(key);\n if (rs == null) throw new InternalError('Can\\'t get dry-run request');\n\n let dryRunRes;\n try {\n dryRunRes = await onNode.protectedDryRunTxs({\n top: rs[0].top,\n txEvents: rs[0].txEvents,\n txs: rs.map((req) => ({ tx: req.tx })),\n accounts: Array.from(new Set(rs.map((req) => req.accountAddress)))\n .map((pubKey) => ({ pubKey, amount: DRY_RUN_ACCOUNT.amount })),\n });\n } catch (error) {\n rs.forEach(({ reject }) => reject(error));\n return;\n }\n\n const { results, txEvents } = dryRunRes;\n results.forEach(({ result, reason, ...resultPayload }, idx) => {\n const {\n resolve, reject, tx, accountAddress,\n } = rs[idx];\n if (result === 'ok') resolve({ ...resultPayload, txEvents });\n else reject(Object.assign(new DryRunError(reason as string), { tx, accountAddress }));\n });\n}\n\n/**\n * Transaction dry-run\n * @category chain\n * @param tx - transaction to execute\n * @param accountAddress - address that will be used to execute transaction\n * @param options - Options\n * @param options.top - hash of block on which to make dry-run\n * @param options.txEvents - collect and return on-chain tx events that would result from the call\n * @param options.combine - Enables combining of similar requests to a single dry-run call\n * @param options.onNode - Node to use\n */\nexport async function txDryRun(\n tx: Encoded.Transaction,\n accountAddress: Encoded.AccountAddress,\n {\n top, txEvents, combine, onNode,\n }:\n { top?: number; txEvents?: boolean; combine?: boolean; onNode: Node },\n): Promise<{\n txEvents?: TransformNodeType<DryRunResults['txEvents']>;\n } & TransformNodeType<DryRunResult>> {\n const key = combine === true ? [top, txEvents].join() : 'immediate';\n const requests = txDryRunRequests.get(key) ?? [];\n txDryRunRequests.set(key, requests);\n return new Promise((resolve, reject) => {\n requests.push({\n tx, accountAddress, top, txEvents, resolve, reject,\n });\n if (combine !== true) {\n void txDryRunHandler(key, onNode);\n return;\n }\n requests.timeout ??= setTimeout(() => { void txDryRunHandler(key, onNode); });\n });\n}\n\n/**\n * Get contract byte code\n * @category contract\n * @param contractId - Contract address\n * @param options - Options\n * @param options.onNode - Node to use\n */\nexport async function getContractByteCode(\n contractId: Encoded.ContractAddress,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<ByteCode>> {\n return onNode.getContractCode(contractId);\n}\n\n/**\n * Get contract entry\n * @category contract\n * @param contractId - Contract address\n * @param options - Options\n * @param options.onNode - Node to use\n */\nexport async function getContract(\n contractId: Encoded.ContractAddress,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<ContractObject>> {\n return onNode.getContract(contractId);\n}\n\n/**\n * Get name entry\n * @category AENS\n * @param name - AENS name\n * @param options - Options\n * @param options.onNode - Node to use\n */\nexport async function getName(\n name: AensName,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<NameEntry>> {\n return onNode.getNameEntryByName(name);\n}\n\n/**\n * Resolve AENS name and return name hash\n * @category AENS\n * @param nameOrId - AENS name or address\n * @param key - in AENS pointers record\n * @param options - Options\n * @param options.verify - To ensure that name exist and have a corresponding pointer\n * // TODO: avoid that to don't trust to current api gateway\n * @param options.resolveByNode - Enables pointer resolving using node\n * @param options.onNode - Node to use\n * @returns Address or AENS name hash\n */\nexport async function resolveName <\n Type extends Encoding.AccountAddress | Encoding.ContractAddress,\n>(\n nameOrId: AensName | Encoded.Generic<Type>,\n key: string,\n { verify = true, resolveByNode = false, onNode }:\n { verify?: boolean; resolveByNode?: boolean; onNode: Node },\n): Promise<Encoded.Generic<Type | Encoding.Name>> {\n if (isNameValid(nameOrId)) {\n if (verify || resolveByNode) {\n const name = await onNode.getNameEntryByName(nameOrId);\n const pointer = name.pointers.find((p) => p.key === key);\n if (pointer == null) throw new AensPointerContextError(nameOrId, key);\n if (resolveByNode) return pointer.id as Encoded.Generic<Type>;\n }\n return produceNameId(nameOrId);\n }\n try {\n decode(nameOrId);\n return nameOrId;\n } catch (error) {\n throw new InvalidAensNameError(`Invalid name or address: ${nameOrId}`);\n }\n}\n","import nacl from 'tweetnacl';\nimport { v4 as uuid } from '@aeternity/uuid';\n// js extension is required for mjs build\n// eslint-disable-next-line import/extensions\nimport { ArgonType, hash } from '@aeternity/argon2-browser/dist/argon2-bundled.min.js';\nimport { getAddressFromPriv } from './crypto';\nimport { bytesToHex, hexToBytes } from './bytes';\nimport { InvalidPasswordError } from './errors';\n\nconst DERIVED_KEY_FUNCTIONS = {\n async argon2id(\n pass: string | Uint8Array,\n salt: string | Uint8Array,\n params: Partial<Keystore['crypto']['kdf_params']>,\n ): Promise<Uint8Array> {\n const { memlimit_kib: mem, opslimit: time } = params;\n\n return (await hash({\n hashLen: 32,\n pass,\n salt,\n time,\n mem,\n type: ArgonType.Argon2id,\n })).hash;\n },\n};\n\nconst CRYPTO_FUNCTIONS = {\n 'xsalsa20-poly1305': {\n encrypt: nacl.secretbox,\n decrypt(...args: Parameters<typeof nacl.secretbox.open>): Uint8Array {\n const res = nacl.secretbox.open(...args);\n if (res == null) throw new InvalidPasswordError();\n return res;\n },\n },\n};\n\nexport interface Keystore {\n name: string;\n version: 1;\n public_key: string;\n id: string;\n crypto: {\n secret_type: 'ed25519';\n symmetric_alg: keyof typeof CRYPTO_FUNCTIONS;\n ciphertext: string;\n cipher_params: {\n nonce: string;\n };\n kdf: keyof typeof DERIVED_KEY_FUNCTIONS;\n kdf_params: {\n memlimit_kib: number;\n opslimit: number;\n parallelism: number;\n salt: string;\n };\n };\n}\n\nconst CRYPTO_DEFAULTS = {\n secret_type: 'ed25519',\n symmetric_alg: 'xsalsa20-poly1305',\n kdf: 'argon2id',\n kdf_params: {\n memlimit_kib: 65536,\n opslimit: 3,\n parallelism: 1,\n },\n} as const;\n\n/**\n * Symmetric private key encryption using secret (derived) key.\n * @param plaintext - Data to be encrypted.\n * @param key - Secret key.\n * @param nonce - Randomly generated nonce.\n * @param algo - Encryption algorithm.\n * @returns Encrypted data.\n */\nfunction encrypt(\n plaintext: Uint8Array,\n key: Uint8Array,\n nonce: Uint8Array,\n algo: keyof typeof CRYPTO_FUNCTIONS = CRYPTO_DEFAULTS.symmetric_alg,\n): Uint8Array {\n return CRYPTO_FUNCTIONS[algo].encrypt(plaintext, nonce, key);\n}\n\n/**\n * Symmetric private key decryption using secret (derived) key.\n * @param ciphertext - Data to be decrypted.\n * @param key - Secret key.\n * @param nonce - Nonce from key-object.\n * @param algo - Encryption algorithm.\n * @returns Decrypted data.\n */\nfunction decrypt(\n ciphertext: Uint8Array,\n key: Uint8Array,\n nonce: Uint8Array,\n algo: keyof typeof CRYPTO_FUNCTIONS = CRYPTO_DEFAULTS.symmetric_alg,\n): Uint8Array {\n return CRYPTO_FUNCTIONS[algo].decrypt(ciphertext, nonce, key);\n}\n\n/**\n * Derive secret key from password with key derivation function.\n * @param password - User-supplied password.\n * @param nonce - Randomly generated nonce.\n * @param kdf - Key derivation function.\n * @param kdfParams - KDF parameters.\n * @returns Secret key derived from password.\n */\nasync function deriveKey(\n password: string | Uint8Array,\n nonce: string | Uint8Array,\n kdf: Keystore['crypto']['kdf'],\n kdfParams: Omit<Keystore['crypto']['kdf_params'], 'salt'>,\n): Promise<Uint8Array> {\n return DERIVED_KEY_FUNCTIONS[kdf](password, nonce, kdfParams);\n}\n\n/**\n * Recover plaintext private key from secret-storage key object.\n * @param password - Keystore object password.\n * @param keystore - Keystore object.\n * @returns Plaintext private key.\n */\nexport async function recover(\n password: string | Uint8Array,\n { crypto }: Keystore,\n): Promise<string> {\n const salt = hexToBytes(crypto.kdf_params.salt);\n return bytesToHex(decrypt(\n hexToBytes(crypto.ciphertext),\n await deriveKey(password, salt, crypto.kdf, crypto.kdf_params),\n hexToBytes(crypto.cipher_params.nonce),\n crypto.symmetric_alg,\n ));\n}\n\n/**\n * Export private key to keystore secret-storage format.\n * @param name - Key name.\n * @param password - User-supplied password.\n * @param privateKey - Private key as hex-string or a Buffer.\n * @param nonce - Randomly generated 24byte nonce.\n * @param salt - Randomly generated 16byte salt.\n * @param options - Encryption parameters.\n * @param options.kdf - Key derivation function.\n * @param options.kdf_params - KDF parameters.\n */\nexport async function dump(\n name: string,\n password: string | Uint8Array,\n privateKey: string | Uint8Array,\n nonce: Uint8Array = nacl.randomBytes(24),\n salt: Uint8Array = nacl.randomBytes(16),\n options?: Partial<Keystore['crypto']>,\n): Promise<Keystore> {\n const opt = { ...CRYPTO_DEFAULTS, ...options };\n const derivedKey = await deriveKey(password, salt, opt.kdf, opt.kdf_params);\n const payload = typeof privateKey === 'string' ? hexToBytes(privateKey) : privateKey;\n return {\n name,\n version: 1,\n public_key: getAddressFromPriv(payload),\n id: uuid(),\n crypto: {\n secret_type: opt.secret_type,\n symmetric_alg: opt.symmetric_alg,\n ciphertext: bytesToHex(encrypt(payload, derivedKey, nonce, opt.symmetric_alg)),\n cipher_params: { nonce: bytesToHex(nonce) },\n kdf: opt.kdf,\n kdf_params: {\n ...opt.kdf_params,\n salt: bytesToHex(salt),\n },\n },\n };\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\n/**\n * Transaction methods\n *\n * This is implementation of [Tx](api/tx.md) relays\n * the creation of transactions to {@link Node}.\n * These methods provide ability to create native transactions.\n */\nimport BigNumber from 'bignumber.js';\nimport {\n ABI_VERSIONS, CtVersion, PROTOCOL_VM_ABI, TX_TTL, TxParamsCommon,\n} from './builder/schema';\nimport { Tag } from './builder/constants';\nimport {\n ArgumentError, UnsupportedProtocolError, UnknownTxError, InvalidTxParamsError,\n} from '../utils/errors';\nimport Node from '../Node';\nimport { Encoded } from '../utils/encoder';\nimport { buildTx as syncBuildTx, unpackTx } from './builder/index';\nimport { isKeyOfObject } from '../utils/other';\nimport { AE_AMOUNT_FORMATS } from '../utils/amount-formatter';\n\ntype Int = number | string | BigNumber;\n\nexport type BuildTxOptions <TxType extends Tag, OmitFields extends string> =\n Omit<Parameters<typeof _buildTx<TxType>>[1], OmitFields>;\n\n/**\n * Validated vm/abi version or get default based on transaction type and NODE version\n * @category transaction builder\n * @param txType - Type of transaction\n * @param ctVersion - Object with vm and abi version fields\n * @returns Object with vm/abi version\n */\nexport async function getVmVersion(\n txType: Tag.ContractCreateTx, ctVersion: Partial<CtVersion> & { onNode: Node }\n): Promise<CtVersion>;\nexport async function getVmVersion(\n txType: Tag, ctVersion: Partial<Pick<CtVersion, 'abiVersion'>> & { onNode: Node }\n): Promise<Pick<CtVersion, 'abiVersion'>>;\nexport async function getVmVersion(\n txType: Tag,\n { vmVersion, abiVersion, onNode }: Partial<CtVersion> & { onNode: Node },\n): Promise<Partial<CtVersion>> {\n const { consensusProtocolVersion } = await onNode.getNodeInfo();\n if (!isKeyOfObject(consensusProtocolVersion, PROTOCOL_VM_ABI)) {\n throw new UnsupportedProtocolError('Not supported consensus protocol version');\n }\n const supportedProtocol = PROTOCOL_VM_ABI[consensusProtocolVersion];\n if (!isKeyOfObject(txType, supportedProtocol)) {\n throw new UnknownTxError('Not supported tx type');\n }\n const protocolForTX = supportedProtocol[txType];\n abiVersion ??= protocolForTX.abiVersion[0];\n vmVersion ??= protocolForTX.vmVersion[0];\n return { vmVersion, abiVersion };\n}\n\n/**\n * Calculate fee, get absolute ttl (ttl + height), get account nonce\n * @category transaction builder\n * @param txType - Type of transaction\n * @param params - Object which contains all tx data\n * @returns Object with account nonce, absolute ttl and transaction fee\n */\nexport async function prepareTxParams(\n txType: Tag,\n {\n senderId,\n nonce,\n ttl = TX_TTL,\n absoluteTtl,\n strategy,\n onNode,\n }: PrepareTxParamsOptions,\n): Promise<{ ttl: number; nonce: number }> {\n nonce ??= (\n await onNode.getAccountNextNonce(senderId, { strategy }).catch(() => ({ nextNonce: 1 }))\n ).nextNonce;\n\n if (ttl !== 0) {\n if (ttl < 0) throw new ArgumentError('ttl', 'greater or equal to 0', ttl);\n ttl += absoluteTtl === true ? 0 : (await onNode.getCurrentKeyBlock()).height;\n }\n\n return { ttl, nonce };\n}\n\ninterface PrepareTxParamsOptions extends Pick<TxParamsCommon, 'nonce' | 'ttl'> {\n senderId: Encoded.AccountAddress;\n absoluteTtl?: boolean;\n strategy?: 'continuity' | 'max';\n onNode: Node;\n}\n\n// TODO: find a better name or rearrange methods\n/**\n * @category transaction builder\n */\nexport async function _buildTx<TxType extends Tag>(\n txType: TxType,\n { denomination, absoluteTtl, ..._params }:\n Omit<Parameters<typeof syncBuildTx<TxType, 'tx'>>[0], 'fee' | 'nonce' | 'ttl' | 'ctVersion' | 'abiVersion'>\n & {\n onNode: Node;\n fee?: Int;\n nonce?: number;\n ttl?: number;\n denomination?: AE_AMOUNT_FORMATS;\n absoluteTtl?: boolean;\n }\n & (TxType extends Tag.OracleExtendTx | Tag.OracleResponseTx\n ? { callerId: Encoded.AccountAddress } : {})\n & (TxType extends Tag.ContractCreateTx | Tag.GaAttachTx ? { ctVersion?: CtVersion } : {})\n & (TxType extends Tag.ContractCallTx | Tag.OracleRegisterTx\n ? { abiVersion?: ABI_VERSIONS } : {}),\n): Promise<Encoded.Transaction> {\n // TODO: avoid this assertion\n const params = _params as unknown as TxParamsCommon & { onNode: Node };\n let senderKey: keyof TxParamsCommon | '<absent>';\n switch (txType) {\n case Tag.SpendTx:\n case Tag.OracleQueryTx:\n senderKey = 'senderId';\n break;\n case Tag.NameClaimTx:\n case Tag.NameUpdateTx:\n case Tag.NameRevokeTx:\n case Tag.NameTransferTx:\n case Tag.NamePreclaimTx:\n case Tag.OracleRegisterTx:\n senderKey = 'accountId';\n break;\n case Tag.ContractCreateTx:\n case Tag.GaAttachTx:\n senderKey = 'ownerId';\n break;\n case Tag.ContractCallTx:\n case Tag.OracleExtendTx:\n case Tag.OracleResponseTx:\n senderKey = 'callerId';\n break;\n case Tag.ChannelCloseSoloTx:\n case Tag.ChannelSlashTx:\n case Tag.ChannelSettleTx:\n case Tag.ChannelSnapshotSoloTx:\n senderKey = 'fromId';\n break;\n case Tag.PayingForTx:\n senderKey = 'payerId';\n break;\n default:\n throw new ArgumentError('txType', 'valid transaction type', txType);\n }\n // TODO: move specific cases to field-types\n if ([Tag.ContractCreateTx, Tag.GaAttachTx].includes(txType)) {\n params.ctVersion = await getVmVersion(\n Tag.ContractCreateTx,\n { ...params, ...params.ctVersion },\n );\n }\n if (txType === Tag.ContractCallTx) {\n params.abiVersion = (await getVmVersion(Tag.ContractCallTx, params)).abiVersion;\n }\n if (txType === Tag.OracleRegisterTx) {\n params.abiVersion ??= ABI_VERSIONS.NO_ABI;\n }\n if (txType === Tag.PayingForTx) {\n params.tx = unpackTx(params.tx);\n }\n const senderId = params[senderKey];\n // TODO: do this check on TypeScript level\n if (senderId == null) throw new InvalidTxParamsError(`Transaction field ${senderKey} is missed`);\n const extraParams = await prepareTxParams(txType, { ...params, senderId, absoluteTtl });\n return syncBuildTx({ ...params, ...extraParams } as any, txType, { denomination }).tx;\n}\n","import nacl from 'tweetnacl';\nimport { full as hmac } from 'tweetnacl-auth';\nimport { fromString } from 'bip32-path';\nimport aesjs from 'aes-js';\nimport { sha256hash, encode, Encoding } from './encoder';\nimport { CryptographyError } from './errors';\nimport { bytesToHex } from './bytes';\nimport { concatBuffers } from './other';\n\nconst Ecb = aesjs.ModeOfOperation.ecb;\n\n// TODO: at least don't export `encryptKey` and `decryptKey`\n/**\n * Encrypt given data using `password`\n * @param password - Password to encrypt with\n * @param binaryData - Data to encrypt\n * @returns Encrypted data\n * @deprecated use 'sha.js' and 'aes-js' packages directly instead\n */\nexport function encryptKey(password: string, binaryData: Uint8Array): Uint8Array {\n const hashedPasswordBytes = sha256hash(password);\n const aesEcb = new Ecb(hashedPasswordBytes);\n return aesEcb.encrypt(binaryData);\n}\n\n/**\n * Decrypt given data using `password`\n * @param password - Password to decrypt with\n * @param encrypted - Data to decrypt\n * @returns Decrypted data\n * @deprecated use 'sha.js' and 'aes-js' packages directly instead\n */\nexport function decryptKey(password: string, encrypted: Uint8Array): Uint8Array {\n const encryptedBytes = Buffer.from(encrypted);\n const hashedPasswordBytes = sha256hash(password);\n const aesEcb = new Ecb(hashedPasswordBytes);\n return aesEcb.decrypt(encryptedBytes);\n}\n\n/**\n * @category exception\n */\nexport class DerivationError extends CryptographyError {\n constructor(message: string) {\n super(message);\n this.name = 'DerivationError';\n }\n}\n\nconst ED25519_CURVE = Buffer.from('ed25519 seed');\nconst HARDENED_OFFSET = 0x80000000;\n\ninterface KeyTreeNode {\n secretKey: Uint8Array;\n chainCode: Uint8Array;\n}\n\ninterface HDWallet {\n secretKey: string;\n chainCode: string;\n}\n\ninterface Account {\n secretKey: string;\n publicKey: string;\n}\n\ntype Dec<N extends number> = [-1, 0, 1, 2, 3, 4][N];\ntype Bip32PathT<MaxLen extends number, H extends 'H' | 'h' | '\\''> = MaxLen extends -1\n ? `${number}${H}`\n : Bip32PathT<Dec<MaxLen>, H> | `${Bip32PathT<Dec<MaxLen>, H>}/${number}${H}`;\ntype Bip32Path<MaxLen extends number> =\n '' | Bip32PathT<MaxLen, 'H'> | Bip32PathT<MaxLen, 'h'> | Bip32PathT<MaxLen, '\\''>;\n\nexport function deriveChild({ secretKey, chainCode }: KeyTreeNode, index: number): KeyTreeNode {\n if (index < HARDENED_OFFSET) {\n throw new DerivationError(`Segment ${index} is not hardened`);\n }\n const indexBuffer = Buffer.allocUnsafe(4);\n indexBuffer.writeUInt32BE(index, 0);\n\n const data = concatBuffers([Buffer.alloc(1, 0), secretKey, indexBuffer]);\n\n const I = hmac(data, chainCode);\n const IL = I.slice(0, 32);\n const IR = I.slice(32);\n return {\n secretKey: IL,\n chainCode: IR,\n };\n}\n\nexport function derivePathFromKey(path: Bip32Path<5>, key: KeyTreeNode): KeyTreeNode {\n const segments = path === '' ? [] : fromString(path).toPathArray();\n segments.forEach((segment, i) => {\n if (segment < HARDENED_OFFSET) {\n throw new DerivationError(`Segment #${i + 1} is not hardened`);\n }\n });\n\n return segments.reduce((parentKey, segment) => deriveChild(parentKey, segment), key);\n}\n\nexport function getMasterKeyFromSeed(seed: Uint8Array): KeyTreeNode {\n const I = hmac(seed, ED25519_CURVE);\n const IL = I.slice(0, 32);\n const IR = I.slice(32);\n return {\n secretKey: IL,\n chainCode: IR,\n };\n}\n\nexport function derivePathFromSeed(path: 'm' | `m/${Bip32Path<5>}`, seed: Uint8Array): KeyTreeNode {\n if (!['m', 'm/'].includes(path.slice(0, 2))) {\n throw new DerivationError('Root element is required');\n }\n const masterKey = getMasterKeyFromSeed(seed);\n return derivePathFromKey(path.slice(2) as Bip32Path<5>, masterKey);\n}\n\nfunction formatAccount(keys: nacl.SignKeyPair): Account {\n const { secretKey, publicKey } = keys;\n return {\n secretKey: bytesToHex(secretKey),\n publicKey: encode(publicKey, Encoding.AccountAddress),\n };\n}\n\nexport function getKeyPair(secretKey: Uint8Array): nacl.SignKeyPair {\n return nacl.sign.keyPair.fromSeed(secretKey);\n}\n\nexport function generateSaveHDWalletFromSeed(seed: Uint8Array, password: string): HDWallet {\n const walletKey = derivePathFromSeed('m/44h/457h', seed);\n return {\n secretKey: bytesToHex(encryptKey(password, walletKey.secretKey)),\n chainCode: bytesToHex(encryptKey(password, walletKey.chainCode)),\n };\n}\n\nexport function getSaveHDWalletAccounts(\n saveHDWallet: HDWallet,\n password: string,\n accountCount: number,\n): Account[] {\n const walletKey = {\n secretKey: decryptKey(password, Buffer.from(saveHDWallet.secretKey, 'hex')),\n chainCode: decryptKey(password, Buffer.from(saveHDWallet.chainCode, 'hex')),\n };\n return (new Array(accountCount)).fill(undefined)\n .map((_, idx) => formatAccount(getKeyPair(derivePathFromKey(`${idx}h/0h/0h`, walletKey).secretKey)));\n}\n\nexport const getHdWalletAccountFromSeed = (\n seed: Uint8Array,\n accountIdx: number,\n): Account & { idx: number } => {\n const walletKey = derivePathFromSeed('m/44h/457h', seed);\n const derived = derivePathFromKey(`${accountIdx}h/0h/0h`, walletKey);\n const keyPair = getKeyPair(derived.secretKey);\n return {\n ...formatAccount(keyPair),\n idx: accountIdx,\n };\n};\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport BigNumber from 'bignumber.js';\nimport {\n sendTransaction, getAccount, getBalance, resolveName,\n} from './chain';\nimport { _buildTx, BuildTxOptions } from './tx';\nimport { buildTxHash, unpackTx } from './tx/builder';\nimport { ArgumentError } from './utils/errors';\nimport { Encoded, Encoding } from './utils/encoder';\nimport { Tag, AensName } from './tx/builder/constants';\nimport AccountBase from './account/Base';\n\n/**\n * Sign and post a transaction to the chain\n * @category chain\n * @param tx - Transaction\n * @param options - Options\n * @param options.verify - Verify transaction before broadcast, throw error if not\n * valid\n * @returns Transaction\n */\nexport async function send(\n tx: Encoded.Transaction,\n options: SendOptions,\n): Promise<SendReturnType> {\n // TODO: detect authFun in AccountGa\n const authFun = options.innerTx === true\n ? undefined\n : (await getAccount(await options.onAccount.address(options), options)).authFun;\n\n const signed = await options.onAccount.signTransaction(tx, {\n ...options,\n authFun,\n networkId: (await options.onNode.getStatus()).networkId,\n });\n\n return options.innerTx === true\n ? { hash: buildTxHash(signed), rawTx: signed }\n : sendTransaction(signed, options);\n}\n\ntype SendOptionsType = Parameters<AccountBase['signTransaction']>[1]\n& Parameters<typeof sendTransaction>[1] & { onAccount: AccountBase };\nexport interface SendOptions extends SendOptionsType {}\ninterface SendReturnType extends Awaited<ReturnType<typeof sendTransaction>> {}\n\n/**\n * Send coins to another account\n * @category chain\n * @param amount - Amount to spend\n * @param recipientIdOrName - Address or name of recipient account\n * @param options - Options\n * @returns Transaction\n */\nexport async function spend(\n amount: number | string,\n recipientIdOrName: Encoded.AccountAddress | AensName,\n options: SpendOptions,\n): ReturnType<typeof send> {\n return send(\n await _buildTx(Tag.SpendTx, {\n ...options,\n senderId: await options.onAccount.address(options),\n recipientId: await resolveName<Encoding.AccountAddress>(\n recipientIdOrName,\n 'account_pubkey',\n options,\n ),\n amount,\n }),\n options,\n );\n}\n\ntype SpendOptionsType = BuildTxOptions<Tag.SpendTx, 'senderId' | 'recipientId' | 'amount'>\n& Parameters<typeof resolveName>[2] & { onAccount: AccountBase } & SendOptions;\ninterface SpendOptions extends SpendOptionsType {}\n\n// TODO: Rename to spendFraction\n/**\n * Send a fraction of coin balance to another account\n * @category chain\n * @param fraction - Fraction of balance to spend (between 0 and 1)\n * @param recipientIdOrName - Address or name of recipient account\n * @param options - Options\n * @returns Transaction\n */\nexport async function transferFunds(\n fraction: number | string,\n recipientIdOrName: AensName | Encoded.AccountAddress,\n options: TransferFundsOptions,\n): ReturnType<typeof send> {\n if (fraction < 0 || fraction > 1) {\n throw new ArgumentError('fraction', 'a number between 0 and 1', fraction);\n }\n const recipientId = await resolveName<Encoding.AccountAddress>(\n recipientIdOrName,\n 'account_pubkey',\n options,\n );\n const senderId = await options.onAccount.address(options);\n const balance = new BigNumber(\n await getBalance.bind(options.onAccount)(senderId, options),\n );\n const desiredAmount = balance.times(fraction).integerValue(BigNumber.ROUND_HALF_UP);\n const { tx: { fee } } = unpackTx(\n await _buildTx(Tag.SpendTx, {\n ...options, senderId, recipientId, amount: desiredAmount,\n }),\n Tag.SpendTx,\n );\n // Reducing of the amount may reduce transaction fee, so this is not completely accurate\n const amount = desiredAmount.plus(fee).gt(balance) ? balance.minus(fee) : desiredAmount;\n return send(\n await _buildTx(Tag.SpendTx, {\n ...options, senderId, recipientId, amount,\n }),\n options,\n );\n}\n\ntype TransferFundsOptionsType = BuildTxOptions<Tag.SpendTx, 'senderId' | 'recipientId' | 'amount'>\n& Parameters<typeof resolveName>[2] & { onAccount: AccountBase } & SendOptions;\ninterface TransferFundsOptions extends TransferFundsOptionsType {}\n\n/**\n * Submit transaction of another account paying for it (fee and gas)\n * @category chain\n * @param transaction - tx_<base64>-encoded transaction\n * @param options - Options\n * @returns Object Transaction\n */\nexport async function payForTransaction(\n transaction: Encoded.Transaction,\n options: PayForTransactionOptions,\n): ReturnType<typeof send> {\n return send(\n await _buildTx(\n Tag.PayingForTx,\n { ...options, payerId: await options.onAccount.address(options), tx: transaction },\n ),\n options,\n );\n}\n\ninterface PayForTransactionOptions extends\n BuildTxOptions<Tag.PayingForTx, 'payerId' | 'tx'>, SendOptions {\n onAccount: AccountBase;\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\n/**\n * Aens methods - routines to interact with the æternity naming system\n *\n * The high-level description of the naming system is\n * https://github.com/aeternity/protocol/blob/master/AENS.md in the protocol\n * repository.\n */\n\nimport BigNumber from 'bignumber.js';\nimport { genSalt } from './utils/crypto';\nimport { commitmentHash, isAuctionName } from './tx/builder/helpers';\nimport {\n CLIENT_TTL, NAME_TTL, Tag, AensName,\n} from './tx/builder/constants';\nimport { ArgumentError } from './utils/errors';\nimport { Encoded } from './utils/encoder';\nimport { send, SendOptions } from './spend';\nimport { getName, getHeight } from './chain';\nimport { _buildTx, BuildTxOptions } from './tx';\nimport { TransformNodeType } from './Node';\nimport { NameEntry, NamePointer } from './apis/node';\nimport AccountBase from './account/Base';\n\ninterface KeyPointers {\n [key: string]: string | Buffer;\n}\n\n/**\n * Revoke a name\n * @category AENS\n * @param name - Name hash\n * @param options - Options\n * @param options.onAccount - Make operation on specific account from sdk (you pass\n * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param options.fee - fee\n * @param options.ttl - ttl\n * @param options.nonce - nonce\n * @returns Transaction result\n * @example\n * ```js\n * const name = 'test.chain'\n * const nameObject = await sdkInstance.aensQuery(name)\n *\n * await sdkInstance.aensRevoke(name, { fee, ttl , nonce })\n * // or\n * await nameObject.revoke({ fee, ttl, nonce })\n * ```\n */\nexport async function aensRevoke(\n name: AensName,\n options: AensRevokeOptions,\n): ReturnType<typeof send> {\n const nameRevokeTx = await _buildTx(Tag.NameRevokeTx, {\n ...options,\n nameId: name,\n accountId: await options.onAccount.address(options),\n });\n return send(nameRevokeTx, options);\n}\n\ninterface AensRevokeOptions extends\n BuildTxOptions<Tag.NameRevokeTx, 'nameId' | 'accountId'>,\n SendOptions {}\n\n/**\n * Update a name\n * @category AENS\n * @param name - AENS name\n * @param pointers - Map of pointer keys to corresponding addresses\n * @param options - Options\n * @param options.extendPointers - Get the pointers from the node and merge with provided\n * ones. Pointers with the same type will be overwritten\n * @param options.onAccount - Make operation on specific account from sdk (you\n * pass publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param options.fee - fee\n * @param options.ttl - ttl\n * @param options.nonce - nonce\n * @param options.nameTtl - Name ttl represented in number of\n * blocks (Max value is 50000 blocks)\n * @param options.clientTtl=84600 a suggestion as to how long any\n * clients should cache this information\n * @throws Invalid pointer array error\n * @example\n * ```js\n * const name = 'test.chain'\n * const pointersArray = ['ak_asd23dasdas...,' 'ct_asdf34fasdasd...']\n * const nameObject = await sdkInstance.aensQuery(name)\n *\n * await sdkInstance.aensUpdate(name, pointersArray, { nameTtl, ttl, fee, nonce, clientTtl })\n * // or\n * await nameObject.update(pointers, { nameTtl, ttl, fee, nonce, clientTtl })\n * ```\n */\nexport async function aensUpdate(\n name: AensName,\n pointers: KeyPointers,\n { extendPointers, ...options }: AensUpdateOptions,\n): ReturnType<typeof send> {\n const allPointers = {\n ...extendPointers === true && Object.fromEntries(\n (await getName(name, options)).pointers\n .map(({ key, id }: { key: string; id: string }) => [key, id]),\n ),\n ...pointers,\n };\n\n const nameUpdateTx = await _buildTx(Tag.NameUpdateTx, {\n clientTtl: CLIENT_TTL,\n nameTtl: NAME_TTL,\n ...options,\n nameId: name,\n accountId: await options.onAccount.address(options),\n pointers: Object.entries(allPointers).map(([key, id]) => ({ key, id: id.toString() })),\n });\n\n return send(nameUpdateTx, options);\n}\n\ninterface AensUpdateOptions extends\n BuildTxOptions<Tag.NameUpdateTx, 'nameId' | 'accountId' | 'pointers' | 'clientTtl' | 'nameTtl'>,\n SendOptions {\n extendPointers?: boolean;\n clientTtl?: number;\n nameTtl?: number;\n}\n\n/**\n * Transfer a domain to another account\n * @category AENS\n * @param name - AENS name\n * @param account - Recipient account publick key\n * @param options - Options\n * @param options.onAccount - Make operation on specific account from sdk (you pass\n * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param options.fee - fee\n * @param options.ttl - ttl\n * @param options.nonce - nonce\n * @returns Transaction result\n * @example\n * ```js\n * const name = 'test.chain'\n * const recipientPub = 'ak_asd23dasdas...'\n * const nameObject = await sdkInstance.aensQuery(name)\n *\n * await sdkInstance.aensTransfer(name, recipientPub, { ttl, fee, nonce })\n * // or\n * await nameObject.transfer(recipientPub, { ttl, fee, nonce })\n * ```\n */\nexport async function aensTransfer(\n name: AensName,\n account: Encoded.AccountAddress,\n options: AensTransferOptions,\n): ReturnType<typeof send> {\n const nameTransferTx = await _buildTx(Tag.NameTransferTx, {\n ...options,\n nameId: name,\n accountId: await options.onAccount.address(options),\n recipientId: account,\n });\n\n return send(nameTransferTx, options);\n}\n\ninterface AensTransferOptions extends\n BuildTxOptions<Tag.NameTransferTx, 'nameId' | 'accountId' | 'recipientId'>,\n SendOptions {}\n\n/**\n * Query the AENS name info from the node\n * and return the object with info and predefined functions for manipulating name\n * @category AENS\n * @param name - AENS name\n * @param opt - Options\n * @returns\n * @example\n * ```js\n * const nameObject = sdkInstance.aensQuery('test.chain')\n * console.log(nameObject)\n * {\n * id, // name hash\n * pointers, // array of pointers\n * update, // Update name function\n * extendTtl, // Extend Ttl name function\n * transfer, // Transfer name function\n * revoke // Revoke name function\n * }\n * ```\n */\nexport async function aensQuery(\n name: AensName,\n opt: Parameters<typeof getName>[1] & Parameters<typeof aensUpdate>[2]\n & Parameters<typeof aensTransfer>[2],\n): Promise<Readonly<\n TransformNodeType<NameEntry> & {\n id: Encoded.Name;\n owner: Encoded.AccountAddress;\n pointers: KeyPointers | NamePointer[];\n ttl: number;\n update: (\n pointers: KeyPointers,\n options?: Omit<Parameters<typeof aensQuery>[1], 'onNode' | 'onCompiler' | 'onAccount'> & {\n onAccount?: AccountBase;\n }\n ) => ReturnType<typeof aensUpdate> & ReturnType<typeof aensQuery>;\n transfer: (\n account: Encoded.AccountAddress,\n options?: Parameters<typeof aensQuery>[1]\n ) => ReturnType<typeof aensUpdate> & ReturnType<typeof aensQuery>;\n revoke: (options?: Omit<Parameters<typeof aensRevoke>[1], 'onNode' | 'onCompiler' | 'onAccount'> & {\n onAccount?: AccountBase;\n }\n ) => ReturnType<typeof aensRevoke>;\n extendTtl: (\n nameTtl: number,\n options?: Omit<Parameters<typeof aensQuery>[1], 'onNode' | 'onCompiler' | 'onAccount'>\n ) => ReturnType<typeof aensUpdate> & ReturnType<typeof aensQuery>;\n }\n >> {\n const nameEntry = await getName(name, opt);\n return Object.freeze({\n ...nameEntry,\n id: nameEntry.id as Encoded.Name,\n owner: nameEntry.owner as Encoded.AccountAddress,\n async update(pointers, options) {\n return {\n ...await aensUpdate(name, pointers, { ...opt, ...options }),\n ...await aensQuery(name, { ...opt, ...options }),\n };\n },\n async transfer(account, options) {\n return {\n ...await aensTransfer(name, account, { ...opt, ...options }),\n ...await aensQuery(name, { ...opt, ...options }),\n };\n },\n async revoke(options) {\n return aensRevoke(name, { ...opt, ...options });\n },\n async extendTtl(nameTtl = NAME_TTL, options = {}) {\n if (nameTtl > NAME_TTL || nameTtl <= 0) {\n throw new ArgumentError('nameTtl', `a number between 1 and ${NAME_TTL} blocks`, nameTtl);\n }\n\n return {\n ...await aensUpdate(name, {}, {\n ...opt, ...options, nameTtl, extendPointers: true,\n }),\n ...await aensQuery(name, { ...opt, ...options }),\n };\n },\n });\n}\n\n/**\n * Claim a previously preclaimed registration. This can only be done after the\n * preclaim step\n * @category AENS\n * @param name - AENS name\n * @param salt - Salt from pre-claim, or 0 if it's a bid\n * @param options - options\n * @param options.onAccount - Make operation on specific account from sdk (you pass\n * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param options.fee - fee\n * @param options.ttl - ttl\n * @param options.nonce - nonce\n * @param options.nameFee - Name Fee (By default calculated by sdk)\n * @returns the result of the claim\n * @example\n * ```js\n * const name = 'test.chain'\n * const salt = preclaimResult.salt // salt from pre-claim transaction\n *\n * await sdkInstance.aensClaim(name, salt, { ttl, fee, nonce, nameFee })\n * ```\n */\nexport async function aensClaim(\n name: AensName,\n salt: number,\n options: AensClaimOptions,\n): Promise<AensClaimReturnType> {\n const claimTx = await _buildTx(Tag.NameClaimTx, {\n ...options,\n accountId: await options.onAccount.address(options),\n nameSalt: salt,\n name,\n });\n\n const result = await send(claimTx, options);\n if (!isAuctionName(name)) {\n const nameInter = result.blockHeight != null && result.blockHeight > 0\n ? await aensQuery(name, options)\n : {};\n return Object.assign(result, nameInter);\n }\n return result;\n}\n\ntype AensClaimOptionsType = BuildTxOptions<Tag.NameClaimTx, 'accountId' | 'nameSalt' | 'name'>\n& SendOptions & Parameters<typeof aensQuery>[1];\ninterface AensClaimOptions extends AensClaimOptionsType {}\ninterface AensClaimReturnType extends\n Awaited<ReturnType<typeof send>>,\n Partial<Awaited<ReturnType<typeof aensQuery>>> {}\n\n/**\n * Preclaim a name. Sends a hash of the name and a random salt to the node\n * @category AENS\n * @param name - AENS name\n * @param options - Options\n * @param options.onAccount - Make operation on specific account from sdk (you pass\n * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param options.fee - fee\n * @param options.ttl - ttl\n * @param options.nonce - nonce\n * @example\n * ```js\n * const name = 'test.chain'\n * const salt = preclaimResult.salt // salt from pre-claim transaction\n *\n * await sdkInstance.aensPreclaim(name, { ttl, fee, nonce })\n * {\n * ...transactionResult,\n * claim, // Claim function (options={}) => claimTransactionResult\n * salt,\n * commitmentId\n * }\n * ```\n */\nexport async function aensPreclaim(name: AensName, options: AensPreclaimOptions): Promise<Readonly<\nAwaited<ReturnType<typeof send>> & {\n height: number;\n salt: number;\n commitmentId: string;\n claim: (opts?: Parameters<typeof aensClaim>[2]) => ReturnType<typeof aensClaim>;\n}\n>> {\n const salt = genSalt();\n const height = await getHeight(options);\n const commitmentId = commitmentHash(name, salt);\n\n const preclaimTx = await _buildTx(Tag.NamePreclaimTx, {\n ...options,\n accountId: await options.onAccount.address(options),\n commitmentId,\n });\n\n return Object.freeze({\n ...await send(preclaimTx, options),\n height,\n salt,\n commitmentId,\n async claim(opts?: Parameters<typeof aensClaim>[2]) {\n return aensClaim(name, salt, { ...options, ...opts });\n },\n });\n}\n\ninterface AensPreclaimOptions extends\n BuildTxOptions<Tag.NamePreclaimTx, 'accountId' | 'commitmentId'>,\n SendOptions,\n AensClaimOptions {}\n\n/**\n * Bid to name auction\n * @category AENS\n * @param name - Domain name\n * @param nameFee - Name fee (bid fee)\n * @param options - Options\n * @param options.onAccount - Make operation on specific account from sdk (you pass\n * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param options.fee - fee\n * @param options.ttl - ttl\n * @param options.nonce - nonce\n * @returns Transaction result\n * @example\n * ```js\n * const name = 'test.chain'\n * const bidFee = computeBidFee(name, startFee, incrementPercentage)\n *\n * await sdkInstance.aensBid(name, 213109412839123, { ttl, fee, nonce })\n * ```\n */\nexport async function aensBid(\n name: AensName,\n nameFee: number | string | BigNumber,\n options: Omit<Parameters<typeof aensClaim>[2], 'nameFee'>,\n): ReturnType<typeof aensClaim> {\n return aensClaim(name, 0, { ...options, nameFee });\n}\n","/*\n* ISC License (ISC)\n* Copyright (c) 2022 aeternity developers\n*\n* Permission to use, copy, modify, and/or distribute this software for any\n* purpose with or without fee is hereby granted, provided that the above\n* copyright notice and this permission notice appear in all copies.\n*\n* THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n* PERFORMANCE OF THIS SOFTWARE.\n*/\n// @ts-expect-error TODO remove\nimport { Encoder as Calldata } from '@aeternity/aepp-calldata';\nimport { DRY_RUN_ACCOUNT, AMOUNT } from '../tx/builder/schema';\nimport { Tag, AensName } from '../tx/builder/constants';\nimport { buildContractIdByContractTx, unpackTx } from '../tx/builder';\nimport { _buildTx } from '../tx';\nimport { send } from '../spend';\nimport { decode, Encoded } from '../utils/encoder';\nimport {\n MissingContractDefError,\n MissingContractAddressError,\n InactiveContractError,\n BytecodeMismatchError,\n DuplicateContractError,\n MissingFunctionNameError,\n InvalidMethodInvocationError,\n NotPayableFunctionError,\n TypeError,\n NodeInvocationError,\n IllegalArgumentError,\n NoSuchContractFunctionError,\n MissingEventDefinitionError,\n AmbiguousEventDefinitionError,\n UnexpectedTsError,\n InternalError,\n} from '../utils/errors';\nimport { hash as calcHash } from '../utils/crypto';\nimport { Aci as BaseAci } from '../apis/compiler';\nimport { ContractCallReturnType } from '../apis/node';\nimport Compiler from './Compiler';\nimport Node from '../Node';\nimport {\n getAccount, getContract, getContractByteCode, getKeyBlock, resolveName, txDryRun,\n} from '../chain';\nimport AccountBase from '../account/Base';\n\ninterface FunctionACI {\n arguments: any[];\n name: string;\n payable: boolean;\n returns: string;\n stateful: boolean;\n}\n\ninterface Aci extends BaseAci {\n encodedAci: {\n contract: {\n name: string;\n event: any;\n kind: string;\n state: any;\n type_defs: any[];\n functions: FunctionACI[];\n };\n };\n externalEncodedAci: any[];\n}\n\ninterface Event {\n address: Encoded.ContractAddress;\n data: string;\n topics: Array<string | number>;\n}\n\ninterface DecodedEvent {\n name: string;\n args: unknown;\n contract: {\n name: string;\n address: Encoded.ContractAddress;\n };\n}\n\ntype TxData = Awaited<ReturnType<typeof send>>;\n\nexport interface ContractInstance {\n _aci: Aci;\n _name: string;\n calldata: any;\n source?: string;\n bytecode?: Encoded.ContractBytearray;\n deployInfo: {\n address?: Encoded.ContractAddress;\n result?: {\n callerId: string;\n callerNonce: string;\n contractId: string;\n gasPrice: bigint;\n gasUsed: number;\n height: number;\n log: any[];\n returnType: ContractCallReturnType;\n returnValue: string;\n };\n owner?: Encoded.AccountAddress;\n transaction?: string;\n rawTx?: string;\n txData?: TxData;\n };\n options: any;\n compile: (options?: {}) => Promise<Encoded.ContractBytearray>;\n _estimateGas: (name: string, params: any[], options: object) => Promise<number>;\n deploy: (params?: any[], options?: object) => Promise<any>;\n call: (fn: string, params?: any[], options?: {}) => Promise<{\n hash: string;\n tx: any;\n txData: TxData;\n rawTx: string;\n result: {\n callerId: Encoded.AccountAddress;\n callerNonce: number;\n contractId: Encoded.ContractAddress;\n gasPrice: number;\n gasUsed: number;\n height: number;\n log: any[];\n returnType: ContractCallReturnType;\n returnValue: string;\n };\n decodedResult: any;\n decodedEvents: DecodedEvent[];\n }>;\n decodeEvents: (\n events: Event[], options?: { omitUnknown?: boolean; contractAddressToName?: any }\n ) => DecodedEvent[];\n methods: any;\n}\n\n/**\n * Generate contract ACI object with predefined js methods for contract usage - can be used for\n * creating a reference to already deployed contracts\n * @category contract\n * @param options - Options object\n * @returns JS Contract API\n * @example\n * ```js\n * const contractIns = await aeSdk.getContractInstance({ source })\n * await contractIns.deploy([321]) or await contractIns.methods.init(321)\n * const callResult = await contractIns.call('setState', [123]) or\n * await contractIns.methods.setState.send(123, options)\n * const staticCallResult = await contractIns.call('setState', [123], { callStatic: true }) or\n * await contractIns.methods.setState.get(123, options)\n * ```\n * Also you can call contract like: `await contractIns.methods.setState(123, options)`\n * Then sdk decide to make on-chain or static call(dry-run API) transaction based on function is\n * stateful or not\n */\nexport default async function getContractInstance({\n onAccount,\n onCompiler,\n onNode,\n source,\n bytecode,\n aci: _aci,\n contractAddress,\n fileSystem = {},\n validateBytecode,\n ...otherOptions\n}: {\n onAccount?: AccountBase;\n onCompiler: Compiler;\n onNode: Node;\n source?: string;\n bytecode?: Encoded.ContractBytearray;\n aci?: Aci;\n contractAddress?: Encoded.ContractAddress | AensName;\n fileSystem?: Record<string, string>;\n validateBytecode?: boolean;\n [key: string]: any;\n}): Promise<ContractInstance> {\n if (_aci == null && source != null) {\n // TODO: should be fixed when the compiledAci interface gets updated\n _aci = await onCompiler.generateACI({ code: source, options: { fileSystem } }) as Aci;\n }\n if (_aci == null) throw new MissingContractDefError();\n\n if (contractAddress != null) {\n contractAddress = await resolveName(\n contractAddress,\n 'contract_pubkey',\n { resolveByNode: true, onNode },\n ) as Encoded.ContractAddress;\n }\n\n if (contractAddress == null && source == null && bytecode == null) {\n throw new MissingContractAddressError('Can\\'t create instance by ACI without address');\n }\n\n if (contractAddress != null) {\n const contract = await getContract(contractAddress, { onNode });\n if (contract.active == null) throw new InactiveContractError(contractAddress);\n }\n\n const instance: ContractInstance = {\n _aci,\n _name: _aci.encodedAci.contract.name,\n calldata: new Calldata([_aci.encodedAci, ..._aci.externalEncodedAci]),\n source,\n bytecode,\n deployInfo: { address: contractAddress },\n options: {\n onAccount,\n onCompiler,\n onNode,\n amount: AMOUNT,\n callStatic: false,\n fileSystem,\n ...otherOptions,\n },\n /* eslint-disable @typescript-eslint/no-unused-vars */\n /* eslint-disable @typescript-eslint/no-empty-function */\n async compile(_options?: {}): Promise<any> {},\n async _estimateGas(_name: string, _params: any[], _options: object): Promise<any> {},\n async deploy(_params?: any[], _options?: any): Promise<any> {},\n async call(_fn: string, _params?: any[], _options?: {}): Promise<any> {},\n decodeEvents(_events: Event[], options?: { omitUnknown?: boolean }): any {},\n /* eslint-enable @typescript-eslint/no-unused-vars */\n /* eslint-enable @typescript-eslint/no-empty-function */\n methods: undefined,\n };\n\n if (validateBytecode != null) {\n if (contractAddress == null) throw new MissingContractAddressError('Can\\'t validate bytecode without contract address');\n const onChanBytecode = (await getContractByteCode(contractAddress, { onNode })).bytecode;\n const isValid: boolean = source != null\n ? await onCompiler.validateByteCode(\n { bytecode: onChanBytecode, source, options: instance.options },\n ).then(() => true, () => false)\n : bytecode === onChanBytecode;\n if (!isValid) throw new BytecodeMismatchError(source != null ? 'source' : 'bytecode');\n }\n\n /**\n * Compile contract\n * @returns bytecode\n */\n instance.compile = async (options = {}): Promise<Encoded.ContractBytearray> => {\n if (instance.bytecode != null) throw new IllegalArgumentError('Contract already compiled');\n if (instance.source == null) throw new IllegalArgumentError('Can\\'t compile without source code');\n instance.bytecode = (await onCompiler.compileContract({\n code: instance.source, options: { ...instance.options, ...options },\n })).bytecode as Encoded.ContractBytearray;\n return instance.bytecode;\n };\n\n const handleCallError = (\n { returnType, returnValue }: {\n returnType: ContractCallReturnType;\n returnValue: Encoded.ContractBytearray;\n },\n transaction: string,\n ): void => {\n let message: string;\n switch (returnType) {\n case 'ok': return;\n case 'revert':\n message = instance.calldata.decodeFateString(returnValue);\n break;\n case 'error':\n message = decode(returnValue).toString();\n break;\n default:\n throw new InternalError(`Unknown return type: ${returnType}`);\n }\n throw new NodeInvocationError(message, transaction);\n };\n\n const sendAndProcess = async (tx: Encoded.Transaction, options: any): Promise<{\n result?: ContractInstance['deployInfo']['result'];\n hash: TxData['hash'];\n tx: Awaited<ReturnType<typeof unpackTx<Tag.ContractCallTx | Tag.ContractCreateTx>>>;\n txData: TxData;\n rawTx: Encoded.Transaction;\n }> => {\n options = { ...instance.options, ...options };\n const txData = await send(tx, options);\n const result = {\n hash: txData.hash,\n tx: unpackTx<Tag.ContractCallTx | Tag.ContractCreateTx>(txData.rawTx),\n txData,\n rawTx: txData.rawTx,\n };\n if (txData.blockHeight == null) return result;\n const { callInfo } = await onNode.getTransactionInfoByHash(txData.hash);\n Object.assign(result.txData, callInfo); // TODO: don't duplicate data in result\n // @ts-expect-error TODO api should be updated to match types\n handleCallError(callInfo, tx);\n return { ...result, result: callInfo };\n };\n\n instance._estimateGas = async (name: string, params: any[], options: object): Promise<number> => {\n const { result: { gasUsed } } = await instance\n .call(name, params, { ...options, callStatic: true });\n // taken from https://github.com/aeternity/aepp-sdk-js/issues/1286#issuecomment-977814771\n return Math.floor(gasUsed * 1.25);\n };\n\n /**\n * Deploy contract\n * @param params - Contract init function arguments array\n * @param options - Options\n * @returns deploy info\n */\n instance.deploy = async (\n params = [],\n options?:\n Parameters<typeof instance.compile>[0] &\n Parameters<typeof instance.call>[2] &\n Parameters<AccountBase['address']>[0] &\n Parameters<typeof sendAndProcess>[1],\n ): Promise<ContractInstance['deployInfo']> => {\n const opt = { ...instance.options, ...options };\n if (instance.bytecode == null) await instance.compile(opt);\n // @ts-expect-error TODO: need to fix compatibility between return types of `deploy` and `call`\n if (opt.callStatic === true) return instance.call('init', params, opt);\n if (instance.deployInfo.address != null) throw new DuplicateContractError();\n\n const ownerId = await opt.onAccount.address(options);\n const tx = await _buildTx(Tag.ContractCreateTx, {\n ...opt,\n gasLimit: opt.gasLimit ?? await instance._estimateGas('init', params, opt),\n callData: instance.calldata.encode(instance._name, 'init', params),\n code: instance.bytecode,\n ownerId,\n onNode,\n });\n const contractId = buildContractIdByContractTx(tx);\n const {\n hash, rawTx, result, txData,\n } = await sendAndProcess(tx, opt);\n instance.deployInfo = Object.freeze({\n result,\n owner: ownerId,\n transaction: hash,\n rawTx,\n txData,\n address: contractId,\n });\n return instance.deployInfo;\n };\n\n /**\n * Get function schema from contract ACI object\n * @param name - Function name\n * @returns function ACI\n */\n function getFunctionACI(name: string): Partial<FunctionACI> {\n const fn = instance._aci.encodedAci.contract.functions.find(\n (f: { name: string }) => f.name === name,\n );\n if (fn != null) {\n return fn;\n }\n if (name === 'init') return { payable: false };\n throw new NoSuchContractFunctionError(`Function ${name} doesn't exist in contract`);\n }\n\n /**\n * Call contract function\n * @param fn - Function name\n * @param params - Array of function arguments\n * @param options - Array of function arguments\n * @returns CallResult\n */\n instance.call = async (fn: string, params: any[] = [], options: object = {}) => {\n const opt = { ...instance.options, ...options };\n const fnACI = getFunctionACI(fn);\n const contractId = instance.deployInfo.address;\n\n if (fn == null) throw new MissingFunctionNameError();\n if (fn === 'init' && opt.callStatic === false) throw new InvalidMethodInvocationError('\"init\" can be called only via dryRun');\n if (contractId == null && fn !== 'init') throw new InvalidMethodInvocationError('You need to deploy contract before calling!');\n if (fn !== 'init' && opt.amount > 0 && fnACI.payable === false) throw new NotPayableFunctionError(opt.amount, fn);\n\n const callerId = await Promise.resolve()\n .then(() => opt.onAccount.address(opt))\n .catch((error: any) => {\n if (opt.callStatic === true) return DRY_RUN_ACCOUNT.pub;\n throw error;\n }) as Encoded.AccountAddress;\n const callData = instance.calldata.encode(instance._name, fn, params);\n\n let res: any;\n if (opt.callStatic === true) {\n if (typeof opt.top === 'number') {\n opt.top = (await getKeyBlock(opt.top, { onNode })).hash;\n }\n const txOpt = { ...opt, onNode, callData };\n if (opt.nonce == null && opt.top != null) {\n opt.nonce = (await getAccount(callerId, { hash: opt.top, onNode })).nonce + 1;\n }\n const tx = await (fn === 'init'\n ? _buildTx(Tag.ContractCreateTx, { ...txOpt, code: instance.bytecode, ownerId: callerId })\n : _buildTx(Tag.ContractCallTx, { ...txOpt, callerId, contractId }));\n\n const { callObj, ...dryRunOther } = await txDryRun(tx, callerId, { onNode, ...opt });\n if (callObj == null) throw new UnexpectedTsError();\n handleCallError({\n returnType: callObj.returnType as ContractCallReturnType,\n returnValue: callObj.returnValue as Encoded.ContractBytearray,\n }, tx);\n res = { ...dryRunOther, tx: unpackTx(tx), result: callObj };\n } else {\n const tx = await _buildTx(Tag.ContractCallTx, {\n ...opt,\n onNode,\n gasLimit: opt.gasLimit ?? await instance._estimateGas(fn, params, opt),\n callerId,\n contractId,\n callData,\n });\n res = await sendAndProcess(tx, opt);\n }\n if (opt.callStatic === true || res.txData.blockHeight != null) {\n res.decodedResult = fnACI.returns != null && fnACI.returns !== 'unit' && fn !== 'init'\n && instance.calldata.decode(instance._name, fn, res.result.returnValue);\n res.decodedEvents = instance.decodeEvents(res.result.log, opt);\n }\n return res;\n };\n\n /**\n * @param address - Contract address that emitted event\n * @param nameHash - Hash of emitted event name\n * @param options - Options\n * @returns Contract name\n * @throws {@link MissingEventDefinitionError}\n * @throws {@link AmbiguousEventDefinitionError}\n */\n function getContractNameByEvent(\n address: Encoded.ContractAddress,\n nameHash: BigInt,\n { contractAddressToName }: {\n contractAddressToName?: { [key: Encoded.ContractAddress]: string };\n },\n ): string {\n const addressToName = { ...instance.options.contractAddressToName, ...contractAddressToName };\n if (addressToName[address] != null) return addressToName[address];\n\n const matchedEvents = [\n instance._aci.encodedAci,\n ...instance._aci.externalEncodedAci,\n ]\n .filter(({ contract }) => contract?.event)\n .map(({ contract }) => [contract.name, contract.event.variant])\n .map(([name, events]) => events.map((event: {}) => [name, Object.keys(event)[0]]))\n .flat()\n .filter(([, eventName]) => BigInt(`0x${calcHash(eventName).toString('hex')}`) === nameHash);\n switch (matchedEvents.length) {\n case 0: throw new MissingEventDefinitionError(nameHash.toString(), address);\n case 1: return matchedEvents[0][0];\n default: throw new AmbiguousEventDefinitionError(address, matchedEvents);\n }\n }\n\n /**\n * Decode Events\n * @param events - Array of encoded events (callRes.result.log)\n * @param options - Options\n * @returns DecodedEvents\n */\n instance.decodeEvents = (\n events: Event[],\n { omitUnknown, ...opt }: { omitUnknown?: boolean } = {},\n ): DecodedEvent[] => events\n .map((event) => {\n const topics = event.topics.map((t: string | number) => BigInt(t));\n let contractName;\n try {\n contractName = getContractNameByEvent(event.address, topics[0], opt);\n } catch (error) {\n if ((omitUnknown ?? false) && error instanceof MissingEventDefinitionError) return null;\n throw error;\n }\n const decoded = instance.calldata.decodeEvent(contractName, event.data, topics);\n const [name, args] = Object.entries(decoded)[0];\n return {\n name,\n args,\n contract: {\n name: contractName,\n address: event.address,\n },\n };\n }).filter((e: DecodedEvent | null): e is DecodedEvent => e != null);\n\n /**\n * Generate proto function based on contract function using Contract ACI schema\n * All function can be called like:\n * ```js\n * await contract.methods.testFunction()\n * ```\n * then sdk will decide to use dry-run or send tx\n * on-chain base on if function stateful or not.\n * Also, you can manually do that:\n * ```js\n * await contract.methods.testFunction.get() // use call-static (dry-run)\n * await contract.methods.testFunction.send() // send tx on-chain\n * ```\n */\n instance.methods = Object.fromEntries(instance._aci.encodedAci.contract.functions\n .map(({ name, arguments: aciArgs, stateful }: FunctionACI) => {\n const genHandler = (callStatic: boolean) => async (...args: any[]) => {\n const options = args.length === aciArgs.length + 1 ? args.pop() : {};\n if (typeof options !== 'object') throw new TypeError(`Options should be an object: ${options as string}`);\n if (name === 'init') return instance.deploy(args, { callStatic, ...options });\n return instance.call(name, args, { callStatic, ...options });\n };\n return [\n name,\n Object.assign(\n genHandler(name === 'init' ? false : !stateful),\n {\n get: genHandler(true),\n send: genHandler(false),\n },\n ),\n ];\n }));\n\n return instance;\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\n/**\n * Contract module - routines to interact with the æternity contract\n *\n * High level documentation of the contracts are available at\n * https://github.com/aeternity/protocol/tree/master/contracts and\n */\n\nimport { AensName } from '../tx/builder/constants';\nimport { produceNameId } from '../tx/builder/helpers';\nimport { concatBuffers } from '../utils/other';\nimport { decode, Encoded } from '../utils/encoder';\nimport AccountBase from '../account/Base';\nimport Node from '../Node';\n\nexport { default as getContractInstance } from './aci';\n\n/**\n * Utility method to create a delegate signature for a contract\n * @category contract\n * @param ids - The list of id's to prepend\n * @param opt - Options\n * @param opt.onNode - Node to use\n * @param opt.onAccount - Account to use\n * @returns Signature in hex representation\n */\nasync function delegateSignatureCommon(\n ids: Encoded.Any[],\n { onAccount, onNode, ...opt }:\n { onAccount: AccountBase; onNode: Node } & Parameters<AccountBase['sign']>[1],\n): Promise<string> {\n const signature = await onAccount.sign(\n concatBuffers([\n Buffer.from((await onNode.getStatus()).networkId),\n ...ids.map((e) => decode(e)),\n ]),\n opt,\n );\n return Buffer.from(signature).toString('hex');\n}\n\n/**\n * Helper to generate a signature to delegate pre-claim/claim/transfer/revoke of a name to\n * a contract.\n * @category contract\n * @param contractId - Contract Id\n * @param opt - Options\n * @param opt.name - The name\n * @returns Signature for delegation\n * @example\n * ```js\n * const aeSdk = new AeSdk({ ... })\n * const contractId = 'ct_asd2ks...' // contract address\n * const name = 'example.chain' // AENS name\n * const onAccount = await aeSdk.address() // Sign with a specific account\n * // Preclaim signature\n * const preclaimSig = await aeSdk.createAensDelegationSignature(contractId, { onAccount: current })\n * // Claim, transfer and revoke signature\n * const aensDelegationSig = await contract.createAensDelegationSignature(\n * contractId, { name, onAccount: current }\n * )\n * ```\n */\nexport async function createAensDelegationSignature(\n contractId: Encoded.ContractAddress,\n opt: Parameters<AccountBase['address']>[0] & Parameters<typeof delegateSignatureCommon>[1] &\n { name?: AensName },\n): Promise<string> {\n return delegateSignatureCommon(\n [\n await opt.onAccount.address(opt),\n ...opt.name != null ? [produceNameId(opt.name)] : [],\n contractId,\n ],\n opt,\n );\n}\n\n/**\n * Helper to generate a signature to delegate register/extend/respond of a Oracle to a contract.\n * @category contract\n * @param contractId - Contract Id\n * @param opt - Options\n * @param opt.queryId - Oracle Query Id\n * @returns Signature for delegation\n * @example\n * ```js\n * const aeSdk = new AeSdk({ ... })\n * const contractId = 'ct_asd2ks...' // contract address\n * const queryId = 'oq_...' // Oracle Query Id\n * const onAccount = await aeSdk.address() // Sign with a specific account\n * // Oracle register and extend signature\n * const oracleDelegationSig = await aeSdk.createOracleDelegationSignature(contractId)\n * // Oracle respond signature\n * const respondSig = await aeSdk.createOracleDelegationSignature(contractId, { queryId })\n * ```\n */\nexport async function createOracleDelegationSignature(\n contractId: Encoded.ContractAddress,\n opt: Parameters<AccountBase['address']>[0] & Parameters<typeof delegateSignatureCommon>[1] &\n { queryId?: Encoded.OracleQueryId },\n): Promise<string> {\n return delegateSignatureCommon(\n [opt.queryId ?? await opt.onAccount.address(opt), contractId],\n opt,\n );\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\n/**\n * Oracle methods - routines to interact with the æternity oracle system\n *\n * The high-level description of the oracle system is\n * https://github.com/aeternity/protocol/blob/master/ORACLE.md in the protocol\n * repository.\n */\n\nimport BigNumber from 'bignumber.js';\nimport { send, SendOptions } from './spend';\nimport { mapObject, pause } from './utils/other';\nimport { oracleQueryId } from './tx/builder/helpers';\nimport { unpackTx } from './tx/builder';\nimport {\n ORACLE_TTL,\n ORACLE_TTL_TYPES,\n QUERY_FEE,\n QUERY_TTL,\n RESPONSE_TTL,\n} from './tx/builder/schema';\nimport { Tag } from './tx/builder/constants';\nimport { RequestTimedOutError } from './utils/errors';\nimport {\n decode, encode, Encoded, Encoding,\n} from './utils/encoder';\nimport { _getPollInterval } from './chain';\nimport { _buildTx, BuildTxOptions } from './tx';\nimport Node from './Node';\nimport AccountBase from './account/Base';\n\ntype OracleQueries = Awaited<ReturnType<Node['getOracleQueriesByPubkey']>>['oracleQueries'];\n\n/**\n * Poll for oracle queries\n * @category oracle\n * @param oracleId - Oracle public key\n * @param onQuery - OnQuery callback\n * @param options - Options object\n * @param options.interval - Poll interval(default: 5000)\n * @param options.onNode - Node to use\n * @returns Callback to stop polling function\n */\nexport function pollForQueries(\n oracleId: Encoded.OracleAddress,\n onQuery: (queries: OracleQueries) => void,\n { interval, onNode, ...options }: { interval?: number; onNode: Node }\n & Parameters<typeof _getPollInterval>[1],\n): () => void {\n interval ??= _getPollInterval('microblock', options);\n const knownQueryIds = new Set();\n const checkNewQueries = async (): Promise<void> => {\n const queries = ((await onNode.getOracleQueriesByPubkey(oracleId)).oracleQueries ?? [])\n .filter(({ id }) => !knownQueryIds.has(id));\n queries.forEach(({ id }) => knownQueryIds.add(id));\n if (queries.length > 0) onQuery(queries);\n };\n\n let stopped = false;\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n (async () => {\n while (!stopped) { // eslint-disable-line no-unmodified-loop-condition\n // TODO: allow to handle this error somehow\n await checkNewQueries().catch(console.error);\n await pause(interval);\n }\n })();\n return () => { stopped = true; };\n}\n\n/**\n * Poll for oracle query response\n * @category oracle\n * @param oracleId - Oracle public key\n * @param queryId - Oracle Query id\n * @param options - Options object\n * @param options.interval - Poll interval\n * @param options.onNode - Node to use\n * @returns OracleQuery object\n */\nexport async function pollForQueryResponse(\n oracleId: Encoded.OracleAddress,\n queryId: Encoded.OracleQueryId,\n { interval, onNode, ...options }:\n { interval?: number; onNode: Node } & Parameters<typeof _getPollInterval>[1],\n): Promise<string> {\n interval ??= _getPollInterval('microblock', options);\n let height;\n let ttl;\n let response;\n do {\n if (height != null) await pause(interval);\n ({ response, ttl } = await onNode.getOracleQueryByPubkeyAndQueryId(oracleId, queryId));\n const responseBuffer = decode(response as Encoded.OracleResponse);\n if (responseBuffer.length > 0) return responseBuffer.toString();\n height = await this.getHeight();\n } while (ttl >= height);\n throw new RequestTimedOutError(height);\n}\n\n/**\n * Constructor for OracleQuery Object (helper object for using OracleQuery)\n * @category oracle\n * @param oracleId - Oracle public key\n * @param queryId - Oracle Query id\n * @param options - Options\n * @returns OracleQuery object\n */\nexport async function getQueryObject(\n oracleId: Encoded.OracleAddress,\n queryId: Encoded.OracleQueryId,\n options: RespondToQueryOptions & Parameters<typeof pollForQueryResponse>[2],\n): Promise<GetQueryObjectReturnType> {\n const record = await options.onNode.getOracleQueryByPubkeyAndQueryId(oracleId, queryId);\n return {\n ...record,\n decodedQuery: decode(record.query as Encoded.OracleQueryId).toString(),\n decodedResponse: decode(record.response as Encoded.OracleResponse).toString(),\n respond: async (response, opt) => (\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n respondToQuery(oracleId, queryId, response, { ...options, ...opt })\n ),\n pollForResponse: async (opt) => pollForQueryResponse(oracleId, queryId, { ...options, ...opt }),\n };\n}\n\ninterface GetQueryObjectReturnType extends Awaited<ReturnType<Node['getOracleQueryByPubkeyAndQueryId']>> {\n decodedQuery: string;\n decodedResponse: string;\n respond: (response: string, options?: Parameters<typeof respondToQuery>[3]) =>\n ReturnType<typeof respondToQuery>;\n pollForResponse: (options?: Parameters<typeof pollForQueryResponse>[2]) =>\n ReturnType<typeof pollForQueryResponse>;\n}\n\n/**\n * Post query to oracle\n * @category oracle\n * @param oracleId - Oracle public key\n * @param query - Oracle query object\n * @param options - Options object\n * @param options.queryTtl - queryTtl Oracle query time to leave\n * @param options.responseTtl - queryFee Oracle query response time to leave\n * @param options.queryFee - queryFee Oracle query fee\n * @param options.fee - fee Transaction fee\n * @param options.ttl - Transaction time to leave\n * @returns Query object\n */\nexport async function postQueryToOracle(\n oracleId: Encoded.OracleAddress,\n query: string,\n options: PostQueryToOracleOptions,\n): Promise<Awaited<ReturnType<typeof send>> & Awaited<ReturnType<typeof getQueryObject>>> {\n options.queryFee ??= (await options.onNode.getOracleByPubkey(oracleId)).queryFee.toString();\n const senderId = await options.onAccount.address(options);\n\n const oracleQueryTx = await _buildTx(Tag.OracleQueryTx, {\n queryTtlType: QUERY_TTL.type,\n queryTtlValue: QUERY_TTL.value,\n responseTtlType: RESPONSE_TTL.type,\n responseTtlValue: RESPONSE_TTL.value,\n ...options,\n oracleId,\n senderId,\n query,\n });\n const { nonce } = unpackTx(oracleQueryTx, Tag.OracleQueryTx).tx;\n const queryId = oracleQueryId(senderId, nonce, oracleId);\n return {\n ...await send(oracleQueryTx, options),\n ...await getQueryObject(oracleId, queryId, options),\n };\n}\n\ntype PostQueryToOracleOptionsType = Parameters<typeof send>[1]\n& Parameters<typeof getQueryObject>[2]\n& BuildTxOptions<Tag.OracleQueryTx, 'oracleId' | 'senderId' | 'query' | 'queryTtlType' | 'queryTtlValue' | 'responseTtlType' | 'responseTtlValue'>\n& {\n queryTtlType?: ORACLE_TTL_TYPES;\n queryTtlValue?: number;\n responseTtlType?: ORACLE_TTL_TYPES;\n responseTtlValue?: number;\n};\ninterface PostQueryToOracleOptions extends PostQueryToOracleOptionsType {}\n\n/**\n * Extend oracle ttl\n * @category oracle\n * @param oracleId - Oracle public key\n * @param options - Options object\n * @param options.fee - fee Transaction fee\n * @param options.ttl - Transaction time to leave\n * @param options.oracleTtlType - Oracle time to leave for extend\n * @param options.oracleTtlValue - Oracle time to leave for extend\n * @returns Oracle object\n */\nexport async function extendOracleTtl(\n oracleId: Encoded.OracleAddress,\n options: ExtendOracleTtlOptions,\n): Promise<Awaited<ReturnType<typeof send>> & Awaited<ReturnType<typeof getOracleObject>>> {\n const oracleExtendTx = await _buildTx(Tag.OracleExtendTx, {\n oracleTtlType: ORACLE_TTL.type,\n oracleTtlValue: ORACLE_TTL.value,\n ...options,\n callerId: await options.onAccount.address(options),\n oracleId,\n });\n return {\n ...await send(oracleExtendTx, options),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n ...await getOracleObject(oracleId, options),\n };\n}\n\ntype ExtendOracleTtlOptionsType = SendOptions & Parameters<typeof getOracleObject>[1]\n& BuildTxOptions<Tag.OracleExtendTx, 'oracleTtlType' | 'oracleTtlValue' | 'callerId' | 'oracleId'>\n& { oracleTtlType?: ORACLE_TTL_TYPES; oracleTtlValue?: number };\ninterface ExtendOracleTtlOptions extends ExtendOracleTtlOptionsType {}\n\n/**\n * Extend oracle ttl\n * @category oracle\n * @param oracleId - Oracle public key\n * @param queryId - Oracle query id\n * @param response - Oracle query response\n * @param options - Options object\n * @param options.responseTtl - responseTtl Query response time to leave\n * @param options.fee - Transaction fee\n * @param options.ttl - Transaction time to leave\n * @returns Oracle object\n */\nexport async function respondToQuery(\n oracleId: Encoded.OracleAddress,\n queryId: Encoded.OracleQueryId,\n response: string,\n options: RespondToQueryOptions,\n): Promise<Awaited<ReturnType<typeof send>> & Awaited<ReturnType<typeof getOracleObject>>> {\n const oracleRespondTx = await _buildTx(Tag.OracleResponseTx, {\n responseTtlType: RESPONSE_TTL.type,\n responseTtlValue: RESPONSE_TTL.value,\n ...options,\n callerId: await options.onAccount.address(options),\n oracleId,\n queryId,\n response,\n });\n return {\n ...await send(oracleRespondTx, options),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n ...await getOracleObject(oracleId, options),\n };\n}\n\ntype RespondToQueryOptionsType = SendOptions & Parameters<typeof getOracleObject>[1]\n& BuildTxOptions<Tag.OracleResponseTx, 'callerId' | 'oracleId' | 'queryId' | 'response' | 'responseTtlType' | 'responseTtlValue'>\n& { responseTtlType?: ORACLE_TTL_TYPES; responseTtlValue?: number };\ninterface RespondToQueryOptions extends RespondToQueryOptionsType {}\n\n/**\n * Constructor for Oracle Object (helper object for using Oracle)\n * @category oracle\n * @param oracleId - Oracle public key\n * @param options - Options\n * @returns Oracle object\n */\nexport async function getOracleObject(\n oracleId: Encoded.OracleAddress,\n options: { onNode: Node; onAccount: AccountBase },\n): Promise<GetOracleObjectReturnType> {\n return {\n ...await options.onNode.getOracleByPubkey(oracleId),\n queries: (await options.onNode.getOracleQueriesByPubkey(oracleId)).oracleQueries,\n ...mapObject<Function, Function>(\n {\n pollQueries: pollForQueries,\n postQuery: postQueryToOracle,\n respondToQuery,\n extendOracle: extendOracleTtl,\n getQuery: getQueryObject,\n },\n ([name, handler]) => [\n name,\n (...args: any) => {\n const lastArg = args[args.length - 1];\n if (lastArg != null && typeof lastArg === 'object' && lastArg.constructor === Object) {\n Object.assign(lastArg, { ...options, ...lastArg });\n } else args.push(options);\n return handler(oracleId, ...args);\n },\n ],\n ),\n } as any;\n}\n\ninterface GetOracleObjectReturnType extends Awaited<ReturnType<Node['getOracleByPubkey']>> {\n id: Encoded.OracleAddress;\n queries: OracleQueries;\n // TODO: replace getOracleObject with a class\n pollQueries: (cb: Parameters<typeof pollForQueries>[1]) => ReturnType<typeof pollForQueries>;\n postQuery: Function;\n respondToQuery: Function;\n extendOracle: Function;\n getQuery: Function;\n}\n\n/**\n * Register oracle\n * @category oracle\n * @param queryFormat - Format of query\n * @param responseFormat - Format of query response\n * @param options - Options\n * @param options.queryFee - Oracle query Fee\n * @param options - Options object\n * @param options.abiVersion - Always 0 (do not use virtual machine)\n * @param options.fee - Transaction fee\n * @param options.ttl - Transaction time to leave\n * @returns Oracle object\n */\nexport async function registerOracle(\n queryFormat: string,\n responseFormat: string,\n options: RegisterOracleOptions,\n): Promise<Awaited<ReturnType<typeof send>> & Awaited<ReturnType<typeof getOracleObject>>> {\n const accountId = await options.onAccount.address(options);\n const oracleRegisterTx = await _buildTx(Tag.OracleRegisterTx, {\n queryFee: QUERY_FEE,\n oracleTtlValue: ORACLE_TTL.value,\n oracleTtlType: ORACLE_TTL.type,\n ...options,\n accountId,\n queryFormat,\n responseFormat,\n });\n return {\n ...await send(oracleRegisterTx, options),\n ...await getOracleObject(encode(decode(accountId), Encoding.OracleAddress), options),\n };\n}\n\ntype RegisterOracleOptionsType = SendOptions & Parameters<typeof getOracleObject>[1]\n& BuildTxOptions<Tag.OracleRegisterTx, 'accountId' | 'queryFormat' | 'responseFormat' | 'queryFee' | 'oracleTtlType' | 'oracleTtlValue'>\n& {\n queryFee?: number | string | BigNumber;\n oracleTtlType?: ORACLE_TTL_TYPES;\n oracleTtlValue?: number;\n};\ninterface RegisterOracleOptions extends RegisterOracleOptionsType {}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\n/**\n * Generalized Account module - routines to use generalized account\n */\n\nimport { MAX_AUTH_FUN_GAS, TxSchema } from '../tx/builder/schema';\nimport { Tag } from '../tx/builder/constants';\nimport {\n buildContractIdByContractTx, buildTx, BuiltTx, TxUnpacked, unpackTx,\n} from '../tx/builder';\nimport {\n _buildTx, BuildTxOptions, getVmVersion, prepareTxParams,\n} from '../tx';\nimport { hash } from '../utils/crypto';\nimport { decode, Encoded, Encoding } from '../utils/encoder';\nimport { IllegalArgumentError, MissingParamError, InvalidAuthDataError } from '../utils/errors';\nimport { concatBuffers } from '../utils/other';\nimport AccountBase from '../account/Base';\nimport { getContractInstance } from './methods';\nimport { send, SendOptions } from '../spend';\nimport Node from '../Node';\nimport { getAccount } from '../chain';\nimport Compiler from './Compiler';\n\n/**\n * Check if account is GA\n * @category contract\n * @param address - Account address\n * @param options - Options\n * @returns if account is GA\n */\nexport async function isGA(\n address: Encoded.AccountAddress,\n options: Parameters<typeof getAccount>[1],\n): Promise<boolean> {\n const { contractId } = await getAccount(address, options);\n return contractId != null;\n}\n\n/**\n * Convert current account to GA\n * @category contract\n * @param authFnName - Authorization function name\n * @param source - Auth contract source code\n * @param args - init arguments\n * @param options - Options\n * @returns General Account Object\n */\nexport async function createGeneralizedAccount(\n authFnName: string,\n source: string,\n args: any[],\n {\n onAccount, onCompiler, onNode, ...options\n }: CreateGeneralizedAccountOptions,\n): Promise<Readonly<{\n owner: Encoded.AccountAddress;\n transaction: Encoded.TxHash;\n rawTx: Encoded.Transaction;\n gaContractId: Encoded.ContractAddress;\n }>> {\n const ownerId = await onAccount.address(options);\n if (await isGA(ownerId, { onNode })) throw new IllegalArgumentError(`Account ${ownerId} is already GA`);\n\n const contract = await getContractInstance({\n onAccount, onCompiler, onNode, source,\n });\n\n const tx = await _buildTx(Tag.GaAttachTx, {\n ...options,\n onNode,\n code: await contract.compile(),\n gasLimit: options.gasLimit ?? await contract._estimateGas('init', args, options),\n ownerId,\n callData: contract.calldata.encode(contract._name, 'init', args),\n authFun: hash(authFnName),\n });\n const contractId = buildContractIdByContractTx(tx);\n const { hash: transaction, rawTx } = await send(tx, {\n onNode, onAccount, onCompiler, ...options,\n });\n\n return Object.freeze({\n owner: ownerId,\n transaction,\n rawTx,\n gaContractId: contractId,\n });\n}\n\ninterface CreateGeneralizedAccountOptions extends\n BuildTxOptions<Tag.GaAttachTx, 'authFun' | 'callData' | 'code' | 'ownerId' | 'gasLimit'>,\n SendOptions {\n onAccount: AccountBase;\n onCompiler: Compiler;\n onNode: Node;\n gasLimit?: number;\n}\n\n/**\n * Create a metaTx transaction\n * @category contract\n * @param rawTransaction - Inner transaction\n * @param authData - Object with gaMeta params\n * @param authFnName - Authorization function name\n * @param options - Options\n * @param options.onAccount - Account to use\n * @returns Transaction string\n */\nexport async function createMetaTx(\n rawTransaction: Encoded.Transaction,\n authData: {\n gasLimit?: number;\n callData?: Encoded.ContractBytearray;\n source?: string;\n args?: any[];\n },\n authFnName: string,\n {\n onAccount, onCompiler, onNode, ...options\n }:\n { onAccount: AccountBase; onCompiler: Compiler; onNode: Node }\n & Parameters<AccountBase['address']>[0],\n): Promise<Encoded.Transaction> {\n const wrapInEmptySignedTx = (\n tx: Encoded.Transaction | Uint8Array | TxUnpacked<TxSchema>,\n ): BuiltTx<TxSchema, Encoding.Transaction> => (\n buildTx({ encodedTx: tx, signatures: [] }, Tag.SignedTx)\n );\n\n if (Object.keys(authData).length <= 0) throw new MissingParamError('authData is required');\n\n const gasLimit = authData.gasLimit ?? MAX_AUTH_FUN_GAS;\n if (gasLimit > MAX_AUTH_FUN_GAS) {\n throw new InvalidAuthDataError(`the maximum gasLimit value for ga authFun is ${MAX_AUTH_FUN_GAS}, got ${gasLimit}`);\n }\n\n const authCallData = authData.callData ?? await (async () => {\n if (authData.source == null || authData.args == null) throw new InvalidAuthDataError('Auth data must contain source code and arguments.');\n const contract = await getContractInstance({\n onCompiler, onNode, source: authData.source,\n });\n return contract.calldata.encode(contract._name, authFnName, authData.args);\n })();\n\n const { abiVersion } = await getVmVersion(Tag.ContractCallTx, { onNode });\n const wrappedTx = wrapInEmptySignedTx(unpackTx<Tag.SignedTx>(rawTransaction));\n const params = {\n ...options,\n tx: {\n ...wrappedTx,\n tx: wrappedTx.txObject,\n },\n // TODO: accept an address instead\n gaId: await onAccount.address(options),\n abiVersion,\n authData: authCallData,\n gasLimit,\n vsn: 2,\n };\n // @ts-expect-error createMetaTx needs to be integrated into tx builder\n const { fee } = await prepareTxParams(Tag.GaMetaTx, { ...params, onNode });\n const { rlpEncoded: metaTxRlp } = buildTx({ ...params, fee }, Tag.GaMetaTx);\n return wrapInEmptySignedTx(metaTxRlp).tx;\n}\n\n/**\n * Build a transaction hash the same as `Auth.tx_hash`\n * @category contract\n * @param transaction - tx-encoded transaction\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Transaction hash\n */\nexport async function buildAuthTxHash(\n transaction: Encoded.Transaction,\n { onNode }: { onNode: Node },\n): Promise<Uint8Array> {\n const { networkId } = await onNode.getStatus();\n return new Uint8Array(hash(\n concatBuffers([Buffer.from(networkId), decode(transaction)]),\n ));\n}\n","import { Encoded } from '../utils/encoder';\nimport { createMetaTx } from '../contract/ga';\nimport Node from '../Node';\n\n/**\n * @deprecated Use createMetaTx instead\n * @hidden\n */\nexport async function signUsingGA(\n tx: Encoded.Transaction,\n { authData, authFun, ...options }: {\n authData: Parameters<typeof createMetaTx>[1];\n authFun: Parameters<typeof createMetaTx>[2];\n } & Parameters<typeof createMetaTx>[3],\n): Promise<Encoded.Transaction> {\n return createMetaTx(tx, authData, authFun, options);\n}\n\n/**\n * @deprecated Use getHeight instead\n * @hidden\n */\nexport async function height({ onNode }: { onNode: Node }): Promise<number> {\n return (await onNode.getCurrentKeyBlockHeight()).height;\n}\n","import BigNumber from 'bignumber.js';\nimport { buildTx } from '../tx/builder';\nimport { Tag } from '../tx/builder/constants';\nimport { calculateMinFee as calculateMinFeeInternal } from '../tx/builder/field-types/fee';\nimport { TxParamsCommon } from '../tx/builder/schema';\nimport { AE_AMOUNT_FORMATS } from '../utils/amount-formatter';\nimport { mapObject } from '../utils/other';\nimport { Encoding } from '../utils/encoder';\n\nexport * from './methods';\n\n/**\n * @deprecated use NamePointer from apis/node instead\n * @hidden\n */\nexport interface Pointer {\n key: string;\n id: string;\n}\n\n/**\n * @deprecated use genSalt instead\n * @hidden\n */\nexport function salt(): number {\n return Math.floor(Math.random() * Math.floor(Number.MAX_SAFE_INTEGER));\n}\n\n/**\n * @deprecated use genSalt instead\n * @hidden\n */\nexport const createSalt = salt;\n\n/**\n * Calculate min fee\n * @category transaction builder\n * @param txType - Transaction type\n * @param options - Options object\n * @param options.params - Tx params\n * @deprecated use buildTx to generate transaction, unpack it and refer to `fee` field\n * @hidden\n * @example\n * ```js\n * calculateMinFee('spendTx', { gasLimit, params })\n * ```\n */\nexport default function calculateMinFee(\n txType: Tag,\n { params, vsn, denomination }: CalculateMinFeeOptions,\n): BigNumber {\n return calculateMinFeeInternal(\n txType,\n // @ts-expect-error anyway this planned to be removed\n (fee: BigNumber) => buildTx({ ...params, fee }, txType, { vsn, denomination }),\n );\n}\n\ninterface CalculateMinFeeOptions {\n params: TxParamsCommon;\n vsn?: number;\n denomination?: AE_AMOUNT_FORMATS;\n}\n\n/**\n * @deprecated Maximum gas limit depends on transaction size, this value is outdated,\n * sdk check/provides gasLimit by itself while building a transaction\n * @hidden\n */\nexport const GAS_MAX = 1600000 - 21000;\n\n/**\n * @deprecated use `Tag`\n * @hidden\n */\nexport enum TX_TYPE {\n account = 10,\n signed = 11,\n spend = 12,\n oracleRegister = 22,\n oracleQuery = 23,\n oracleResponse = 24,\n oracleExtend = 25,\n nameClaim = 32,\n namePreClaim = 33,\n nameUpdate = 34,\n nameRevoke = 35,\n nameTransfer = 36,\n contract = 40,\n contractCallResult = 41,\n contractCreate = 42,\n contractCall = 43,\n channelCreate = 50,\n channelDeposit = 51,\n channelWithdraw = 52,\n channelCloseMutual = 53,\n channelCloseSolo = 54,\n channelSlash = 55,\n channelSettle = 56,\n channelOffChain = 57,\n channel = 58,\n channelSnapshotSolo = 59,\n proofOfInclusion = 60,\n stateTrees = 62,\n merklePatriciaTree = 63,\n merklePatriciaTreeValue = 64,\n sophiaByteCode = 70,\n gaAttach = 80,\n gaMeta = 81,\n payingFor = 82,\n channelForceProgress = 521,\n channelOffChainUpdateTransfer = 570,\n channelOffChainUpdateDeposit = 571,\n channelOffChainUpdateWithdrawal = 572,\n channelOffChainCreateContract = 573,\n channelOffChainCallContract = 574,\n channelReconnect = 575,\n contractsTree = 621,\n contractCallsTree = 622,\n channelsTree = 623,\n nameserviceTree = 624,\n oraclesTree = 625,\n accountsTree = 626,\n}\n\n/**\n * @deprecated use `readId`, `writeId`\n * @hidden\n */\nexport const ID_TAG = {\n account: 1,\n name: 2,\n commitment: 3,\n oracle: 4,\n contract: 5,\n channel: 6,\n} as const;\n\n/**\n * @deprecated use `readId`, `writeId`\n * @hidden\n */\nexport const PREFIX_ID_TAG = {\n ak: ID_TAG.account,\n nm: ID_TAG.name,\n cm: ID_TAG.commitment,\n ok: ID_TAG.oracle,\n ct: ID_TAG.contract,\n ch: ID_TAG.channel,\n} as const;\n\n/**\n * @deprecated use `readId`, `writeId`\n * @hidden\n */\nexport const ID_TAG_PREFIX = mapObject(\n PREFIX_ID_TAG,\n ([key, value]: [Encoding, number]) => [value, key],\n);\n\n/**\n * @deprecated use `getDefaultPointerKey`\n * @hidden\n */\nexport enum POINTER_KEY_BY_PREFIX {\n ak = 'account_pubkey',\n ok = 'oracle_pubkey',\n ct = 'contract_pubkey',\n ch = 'channel',\n}\n","import _Object$defineProperty from \"@babel/runtime-corejs3/core-js/object/define-property\";\nexport default function _defineProperty(obj, key, value) {\n if (key in obj) {\n _Object$defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","import { RestError, PipelineResponse, PipelinePolicy } from '@azure/core-rest-pipeline';\nimport { AdditionalPolicyConfig } from '@azure/core-client';\nimport { pause } from './other';\nimport semverSatisfies from './semver-satisfies';\nimport { UnsupportedVersionError } from './errors';\n\nexport const genRequestQueuesPolicy = (): AdditionalPolicyConfig => {\n const requestQueues = new Map<string, Promise<unknown>>();\n\n return {\n policy: {\n name: 'request-queues',\n async sendRequest(request, next) {\n const key = request.headers.get('__queue');\n request.headers.delete('__queue');\n const getResponse = async (): Promise<PipelineResponse> => next(request);\n if (key == null) return getResponse();\n const req = (requestQueues.get(key) ?? Promise.resolve()).then(getResponse, getResponse);\n // TODO: remove after fixing https://github.com/aeternity/aeternity/issues/3803\n // gap to ensure that node won't reject the nonce\n requestQueues.set(key, req.then(async () => pause(750)));\n return req;\n },\n },\n position: 'perCall',\n };\n};\n\nexport const genCombineGetRequestsPolicy = (): AdditionalPolicyConfig => {\n const pendingGetRequests = new Map<string, Promise<PipelineResponse>>();\n\n return {\n policy: {\n name: 'combine-requests',\n async sendRequest(request, next) {\n if (request.method !== 'GET') return next(request);\n const key = JSON.stringify([request.url, request.body]);\n const response = pendingGetRequests.get(key) ?? next(request);\n pendingGetRequests.set(key, response);\n try {\n return await response;\n } finally {\n pendingGetRequests.delete(key);\n }\n },\n },\n position: 'perCall',\n };\n};\n\nexport const genErrorFormatterPolicy = (\n getMessage: (b: any) => string,\n): AdditionalPolicyConfig => ({\n policy: {\n name: 'error-formatter',\n async sendRequest(request, next) {\n try {\n return await next(request);\n } catch (error) {\n if (!(error instanceof RestError) || error.request == null) throw error;\n if (error.response?.bodyAsText == null) throw error;\n\n let body;\n try {\n body = JSON.parse(error.response.bodyAsText);\n } catch (e) {\n throw error;\n }\n error.message = `${new URL(error.request.url).pathname.slice(1)} error`;\n const message = getMessage(body);\n if (message !== '') error.message += `:${message}`;\n throw error;\n }\n },\n },\n position: 'perCall',\n});\n\nexport const genVersionCheckPolicy = (\n name: string,\n ignorePath: string,\n versionPromise: Promise<string>,\n geVersion: string,\n ltVersion: string,\n): PipelinePolicy => ({\n name: 'version-check',\n async sendRequest(request, next) {\n if (new URL(request.url).pathname === ignorePath) return next(request);\n const args = [await versionPromise, geVersion, ltVersion] as const;\n if (!semverSatisfies(...args)) throw new UnsupportedVersionError(name, ...args);\n return next(request);\n },\n});\n","export default function semverSatisfies(\n version: string,\n geVersion: string,\n ltVersion: string,\n): boolean {\n const getComponents = (v: string): number[] => v\n .split(/[-+]/)[0].split('.').map((i) => +i);\n\n const versionComponents = getComponents(version);\n const geComponents = getComponents(geVersion);\n const ltComponents = getComponents(ltVersion);\n\n const base = Math.max(...versionComponents, ...geComponents, ...ltComponents) + 1;\n const componentsToNumber = (components: number[]): number => components.reverse()\n .reduce((acc, n, idx) => acc + n * base ** idx, 0);\n\n const vNumber = componentsToNumber(versionComponents);\n const geNumber = componentsToNumber(geComponents);\n const ltNumber = componentsToNumber(ltComponents);\n return vNumber >= geNumber && vNumber < ltNumber;\n}\n","import * as coreClient from \"@azure/core-client\";\n\nexport const Header: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Header\",\n modelProperties: {\n hash: {\n serializedName: \"hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n height: {\n serializedName: \"height\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n prevHash: {\n serializedName: \"prev_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n prevKeyHash: {\n serializedName: \"prev_key_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n miner: {\n serializedName: \"miner\",\n type: {\n name: \"String\"\n }\n },\n beneficiary: {\n serializedName: \"beneficiary\",\n type: {\n name: \"String\"\n }\n },\n target: {\n serializedName: \"target\",\n type: {\n name: \"String\"\n }\n },\n pow: {\n constraints: {\n MinItems: 42,\n MaxItems: 42\n },\n serializedName: \"pow\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n time: {\n serializedName: \"time\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n info: {\n serializedName: \"info\",\n type: {\n name: \"String\"\n }\n },\n pofHash: {\n serializedName: \"pof_hash\",\n type: {\n name: \"String\"\n }\n },\n txsHash: {\n serializedName: \"txs_hash\",\n type: {\n name: \"String\"\n }\n },\n signature: {\n serializedName: \"signature\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ErrorModel: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ErrorModel\",\n modelProperties: {\n reason: {\n serializedName: \"reason\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const KeyBlock: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"KeyBlock\",\n modelProperties: {\n hash: {\n serializedName: \"hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n height: {\n serializedName: \"height\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n prevHash: {\n serializedName: \"prev_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n prevKeyHash: {\n serializedName: \"prev_key_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n miner: {\n serializedName: \"miner\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n beneficiary: {\n serializedName: \"beneficiary\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n target: {\n serializedName: \"target\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n pow: {\n constraints: {\n MinItems: 42,\n MaxItems: 42\n },\n serializedName: \"pow\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n time: {\n serializedName: \"time\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n info: {\n serializedName: \"info\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const HashResponse: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"HashResponse\",\n modelProperties: {\n hash: {\n serializedName: \"hash\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const HeightResponse: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"HeightResponse\",\n modelProperties: {\n height: {\n serializedName: \"height\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const MicroBlockHeader: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"MicroBlockHeader\",\n modelProperties: {\n hash: {\n serializedName: \"hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n height: {\n serializedName: \"height\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n pofHash: {\n serializedName: \"pof_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n prevHash: {\n serializedName: \"prev_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n prevKeyHash: {\n serializedName: \"prev_key_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n txsHash: {\n serializedName: \"txs_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n signature: {\n serializedName: \"signature\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n time: {\n serializedName: \"time\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"version\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const SignedTxs: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"SignedTxs\",\n modelProperties: {\n transactions: {\n serializedName: \"transactions\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"SignedTx\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const SignedTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"SignedTx\",\n modelProperties: {\n tx: {\n serializedName: \"tx\",\n type: {\n name: \"Composite\",\n className: \"Tx\"\n }\n },\n blockHeight: {\n serializedName: \"block_height\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n blockHash: {\n serializedName: \"block_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n hash: {\n serializedName: \"hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n signatures: {\n serializedName: \"signatures\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const Tx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Tx\",\n uberParent: \"Tx\",\n polymorphicDiscriminator: {\n serializedName: \"type\",\n clientName: \"type\"\n },\n modelProperties: {\n recipientId: {\n serializedName: \"recipient_id\",\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n senderId: {\n serializedName: \"sender_id\",\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n payload: {\n serializedName: \"payload\",\n type: {\n name: \"String\"\n }\n },\n initiatorId: {\n serializedName: \"initiator_id\",\n type: {\n name: \"String\"\n }\n },\n initiatorAmount: {\n serializedName: \"initiator_amount\",\n type: {\n name: \"String\"\n }\n },\n responderId: {\n serializedName: \"responder_id\",\n type: {\n name: \"String\"\n }\n },\n responderAmount: {\n serializedName: \"responder_amount\",\n type: {\n name: \"String\"\n }\n },\n channelReserve: {\n serializedName: \"channel_reserve\",\n type: {\n name: \"String\"\n }\n },\n lockPeriod: {\n serializedName: \"lock_period\",\n type: {\n name: \"String\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n type: {\n name: \"String\"\n }\n },\n delegateIds: {\n serializedName: \"delegate_ids\",\n type: {\n name: \"Composite\",\n className: \"Delegates\"\n }\n },\n channelId: {\n serializedName: \"channel_id\",\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n type: {\n name: \"String\"\n }\n },\n round: {\n serializedName: \"round\",\n type: {\n name: \"String\"\n }\n },\n toId: {\n serializedName: \"to_id\",\n type: {\n name: \"String\"\n }\n },\n update: {\n serializedName: \"update\",\n type: {\n name: \"Composite\",\n className: \"OffChainUpdate\"\n }\n },\n offchainTrees: {\n serializedName: \"offchain_trees\",\n type: {\n name: \"String\"\n }\n },\n initiatorAmountFinal: {\n serializedName: \"initiator_amount_final\",\n type: {\n name: \"String\"\n }\n },\n responderAmountFinal: {\n serializedName: \"responder_amount_final\",\n type: {\n name: \"String\"\n }\n },\n poi: {\n serializedName: \"poi\",\n type: {\n name: \"String\"\n }\n },\n initiatorDelegateIds: {\n serializedName: \"initiator_delegate_ids\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n responderDelegateIds: {\n serializedName: \"responder_delegate_ids\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n queryFormat: {\n serializedName: \"query_format\",\n type: {\n name: \"String\"\n }\n },\n responseFormat: {\n serializedName: \"response_format\",\n type: {\n name: \"String\"\n }\n },\n queryFee: {\n serializedName: \"query_fee\",\n type: {\n name: \"String\"\n }\n },\n oracleTtl: {\n serializedName: \"oracle_ttl\",\n type: {\n name: \"Composite\",\n className: \"RelativeTTL\"\n }\n },\n accountId: {\n serializedName: \"account_id\",\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n type: {\n name: \"String\"\n }\n },\n oracleId: {\n serializedName: \"oracle_id\",\n type: {\n name: \"String\"\n }\n },\n query: {\n serializedName: \"query\",\n type: {\n name: \"String\"\n }\n },\n queryTtl: {\n serializedName: \"query_ttl\",\n type: {\n name: \"Composite\",\n className: \"Ttl\"\n }\n },\n responseTtl: {\n serializedName: \"response_ttl\",\n type: {\n name: \"Composite\",\n className: \"RelativeTTL\"\n }\n },\n queryId: {\n serializedName: \"query_id\",\n type: {\n name: \"String\"\n }\n },\n response: {\n serializedName: \"response\",\n type: {\n name: \"String\"\n }\n },\n commitmentId: {\n serializedName: \"commitment_id\",\n type: {\n name: \"String\"\n }\n },\n name: {\n serializedName: \"name\",\n type: {\n name: \"String\"\n }\n },\n nameSalt: {\n serializedName: \"name_salt\",\n type: {\n name: \"String\"\n }\n },\n nameFee: {\n serializedName: \"name_fee\",\n type: {\n name: \"String\"\n }\n },\n nameId: {\n serializedName: \"name_id\",\n type: {\n name: \"String\"\n }\n },\n nameTtl: {\n serializedName: \"name_ttl\",\n type: {\n name: \"String\"\n }\n },\n pointers: {\n serializedName: \"pointers\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"NamePointer\"\n }\n }\n }\n },\n clientTtl: {\n serializedName: \"client_ttl\",\n type: {\n name: \"String\"\n }\n },\n ownerId: {\n serializedName: \"owner_id\",\n type: {\n name: \"String\"\n }\n },\n code: {\n serializedName: \"code\",\n type: {\n name: \"String\"\n }\n },\n vmVersion: {\n serializedName: \"vm_version\",\n type: {\n name: \"String\"\n }\n },\n deposit: {\n serializedName: \"deposit\",\n type: {\n name: \"String\"\n }\n },\n gas: {\n serializedName: \"gas\",\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n type: {\n name: \"String\"\n }\n },\n callData: {\n serializedName: \"call_data\",\n type: {\n name: \"String\"\n }\n },\n callerId: {\n serializedName: \"caller_id\",\n type: {\n name: \"String\"\n }\n },\n contractId: {\n serializedName: \"contract_id\",\n type: {\n name: \"String\"\n }\n },\n authFun: {\n constraints: {\n Pattern: new RegExp(\"^(0x|0X)?[a-fA-F0-9]+$\")\n },\n serializedName: \"auth_fun\",\n type: {\n name: \"String\"\n }\n },\n gaId: {\n serializedName: \"ga_id\",\n type: {\n name: \"String\"\n }\n },\n authData: {\n serializedName: \"auth_data\",\n type: {\n name: \"String\"\n }\n },\n tx: {\n serializedName: \"tx\",\n type: {\n name: \"Composite\",\n className: \"SignedTx\"\n }\n },\n payerId: {\n serializedName: \"payer_id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n type: {\n serializedName: \"type\",\n required: true,\n type: {\n name: \"Enum\",\n allowedValues: [\n \"SpendTx\",\n \"ChannelCreateTx\",\n \"ChannelDepositTx\",\n \"ChannelWithdrawTx\",\n \"ChannelForceProgressTx\",\n \"ChannelCloseMutualTx\",\n \"ChannelCloseSoloTx\",\n \"ChannelSlashTx\",\n \"ChannelSettleTx\",\n \"ChannelSnapshotSoloTx\",\n \"ChannelSetDelegatesTx\",\n \"OracleRegisterTx\",\n \"OracleExtendTx\",\n \"OracleQueryTx\",\n \"OracleRespondTx\",\n \"NamePreclaimTx\",\n \"NameClaimTx\",\n \"NameUpdateTx\",\n \"NameTransferTx\",\n \"NameRevokeTx\",\n \"ContractCreateTx\",\n \"ContractCallTx\",\n \"GAAttachTx\",\n \"GAMetaTx\",\n \"PayingForTx\"\n ]\n }\n }\n }\n }\n};\n\nexport const Delegates: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Delegates\",\n modelProperties: {\n initiator: {\n serializedName: \"initiator\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n responder: {\n serializedName: \"responder\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const OffChainUpdate: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"OffChainUpdate\",\n uberParent: \"OffChainUpdate\",\n polymorphicDiscriminator: {\n serializedName: \"op\",\n clientName: \"op\"\n },\n modelProperties: {\n op: {\n serializedName: \"op\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const RelativeTTL: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"RelativeTTL\",\n modelProperties: {\n type: {\n defaultValue: \"delta\",\n isConstant: true,\n serializedName: \"type\",\n type: {\n name: \"String\"\n }\n },\n value: {\n serializedName: \"value\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const Ttl: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Ttl\",\n modelProperties: {\n type: {\n serializedName: \"type\",\n required: true,\n type: {\n name: \"Enum\",\n allowedValues: [\"delta\", \"block\"]\n }\n },\n value: {\n serializedName: \"value\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NamePointer: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NamePointer\",\n modelProperties: {\n key: {\n serializedName: \"key\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n id: {\n serializedName: \"id\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const CountResponse: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CountResponse\",\n modelProperties: {\n count: {\n serializedName: \"count\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const Generation: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Generation\",\n modelProperties: {\n keyBlock: {\n serializedName: \"key_block\",\n type: {\n name: \"Composite\",\n className: \"KeyBlock\"\n }\n },\n microBlocks: {\n serializedName: \"micro_blocks\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const Account: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Account\",\n modelProperties: {\n id: {\n serializedName: \"id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n balance: {\n serializedName: \"balance\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n payable: {\n serializedName: \"payable\",\n type: {\n name: \"Boolean\"\n }\n },\n kind: {\n serializedName: \"kind\",\n type: {\n name: \"Enum\",\n allowedValues: [\"basic\", \"generalized\"]\n }\n },\n contractId: {\n serializedName: \"contract_id\",\n type: {\n name: \"String\"\n }\n },\n authFun: {\n serializedName: \"auth_fun\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NextNonceResponse: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NextNonceResponse\",\n modelProperties: {\n nextNonce: {\n serializedName: \"next_nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const DryRunInput: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DryRunInput\",\n modelProperties: {\n top: {\n serializedName: \"top\",\n type: {\n name: \"String\"\n }\n },\n accounts: {\n serializedName: \"accounts\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"DryRunAccount\"\n }\n }\n }\n },\n txs: {\n serializedName: \"txs\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"DryRunInputItem\"\n }\n }\n }\n },\n txEvents: {\n defaultValue: false,\n serializedName: \"tx_events\",\n type: {\n name: \"Boolean\"\n }\n }\n }\n }\n};\n\nexport const DryRunAccount: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DryRunAccount\",\n modelProperties: {\n pubKey: {\n serializedName: \"pub_key\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const DryRunInputItem: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DryRunInputItem\",\n modelProperties: {\n tx: {\n serializedName: \"tx\",\n type: {\n name: \"String\"\n }\n },\n callReq: {\n serializedName: \"call_req\",\n type: {\n name: \"Composite\",\n className: \"DryRunCallReq\"\n }\n }\n }\n }\n};\n\nexport const DryRunCallReq: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DryRunCallReq\",\n modelProperties: {\n calldata: {\n serializedName: \"calldata\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n contract: {\n serializedName: \"contract\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n type: {\n name: \"String\"\n }\n },\n gas: {\n serializedName: \"gas\",\n type: {\n name: \"String\"\n }\n },\n caller: {\n serializedName: \"caller\",\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n type: {\n name: \"String\"\n }\n },\n context: {\n serializedName: \"context\",\n type: {\n name: \"Composite\",\n className: \"DryRunCallContext\"\n }\n }\n }\n }\n};\n\nexport const DryRunCallContext: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DryRunCallContext\",\n modelProperties: {\n tx: {\n serializedName: \"tx\",\n type: {\n name: \"String\"\n }\n },\n txHash: {\n serializedName: \"tx_hash\",\n type: {\n name: \"String\"\n }\n },\n stateful: {\n serializedName: \"stateful\",\n type: {\n name: \"Boolean\"\n }\n }\n }\n }\n};\n\nexport const DryRunResults: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DryRunResults\",\n modelProperties: {\n results: {\n serializedName: \"results\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"DryRunResult\"\n }\n }\n }\n },\n txEvents: {\n serializedName: \"tx_events\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n }\n }\n }\n }\n }\n};\n\nexport const DryRunResult: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DryRunResult\",\n modelProperties: {\n type: {\n serializedName: \"type\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n result: {\n serializedName: \"result\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n reason: {\n serializedName: \"reason\",\n type: {\n name: \"String\"\n }\n },\n callObj: {\n serializedName: \"call_obj\",\n type: {\n name: \"Composite\",\n className: \"ContractCallObject\"\n }\n }\n }\n }\n};\n\nexport const ContractCallObject: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ContractCallObject\",\n modelProperties: {\n callerId: {\n serializedName: \"caller_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callerNonce: {\n serializedName: \"caller_nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n height: {\n serializedName: \"height\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n contractId: {\n serializedName: \"contract_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasUsed: {\n serializedName: \"gas_used\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n log: {\n serializedName: \"log\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"Event\"\n }\n }\n }\n },\n returnValue: {\n serializedName: \"return_value\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n returnType: {\n serializedName: \"return_type\",\n required: true,\n type: {\n name: \"Enum\",\n allowedValues: [\"ok\", \"error\", \"revert\"]\n }\n }\n }\n }\n};\n\nexport const Event: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Event\",\n modelProperties: {\n address: {\n serializedName: \"address\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n topics: {\n serializedName: \"topics\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n data: {\n serializedName: \"data\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const TxInfoObject: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"TxInfoObject\",\n modelProperties: {\n callInfo: {\n serializedName: \"call_info\",\n type: {\n name: \"Composite\",\n className: \"ContractCallObject\"\n }\n },\n gaInfo: {\n serializedName: \"ga_info\",\n type: {\n name: \"Composite\",\n className: \"GAObject\"\n }\n },\n txInfo: {\n serializedName: \"tx_info\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const GAObject: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"GAObject\",\n modelProperties: {\n callerId: {\n serializedName: \"caller_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n height: {\n serializedName: \"height\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasUsed: {\n serializedName: \"gas_used\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n returnValue: {\n serializedName: \"return_value\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n returnType: {\n serializedName: \"return_type\",\n required: true,\n type: {\n name: \"Enum\",\n allowedValues: [\"ok\", \"error\"]\n }\n },\n innerObject: {\n serializedName: \"inner_object\",\n type: {\n name: \"Composite\",\n className: \"TxInfoObject\"\n }\n }\n }\n }\n};\n\nexport const EncodedTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"EncodedTx\",\n modelProperties: {\n tx: {\n serializedName: \"tx\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PostTxResponse: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PostTxResponse\",\n modelProperties: {\n txHash: {\n serializedName: \"tx_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ContractObject: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ContractObject\",\n modelProperties: {\n id: {\n serializedName: \"id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ownerId: {\n serializedName: \"owner_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n vmVersion: {\n serializedName: \"vm_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n active: {\n serializedName: \"active\",\n required: true,\n type: {\n name: \"Boolean\"\n }\n },\n referrerIds: {\n serializedName: \"referrer_ids\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n deposit: {\n serializedName: \"deposit\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ByteCode: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ByteCode\",\n modelProperties: {\n bytecode: {\n serializedName: \"bytecode\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PoI: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PoI\",\n modelProperties: {\n poi: {\n serializedName: \"poi\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const RegisteredOracle: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"RegisteredOracle\",\n modelProperties: {\n id: {\n serializedName: \"id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n queryFormat: {\n serializedName: \"query_format\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responseFormat: {\n serializedName: \"response_format\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n queryFee: {\n serializedName: \"query_fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OracleQueries: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"OracleQueries\",\n modelProperties: {\n oracleQueries: {\n serializedName: \"oracle_queries\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"OracleQuery\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const OracleQuery: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"OracleQuery\",\n modelProperties: {\n id: {\n serializedName: \"id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n senderId: {\n serializedName: \"sender_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n senderNonce: {\n serializedName: \"sender_nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n oracleId: {\n serializedName: \"oracle_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n query: {\n serializedName: \"query\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n response: {\n serializedName: \"response\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responseTtl: {\n serializedName: \"response_ttl\",\n type: {\n name: \"Composite\",\n className: \"Ttl\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NameEntry: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NameEntry\",\n modelProperties: {\n id: {\n serializedName: \"id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n owner: {\n serializedName: \"owner\",\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n pointers: {\n serializedName: \"pointers\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"NamePointer\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const Channel: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Channel\",\n modelProperties: {\n id: {\n serializedName: \"id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n initiatorId: {\n serializedName: \"initiator_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responderId: {\n serializedName: \"responder_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n channelAmount: {\n serializedName: \"channel_amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n initiatorAmount: {\n serializedName: \"initiator_amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responderAmount: {\n serializedName: \"responder_amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n channelReserve: {\n serializedName: \"channel_reserve\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n delegateIds: {\n serializedName: \"delegate_ids\",\n type: {\n name: \"Composite\",\n className: \"Delegates\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n round: {\n serializedName: \"round\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n soloRound: {\n serializedName: \"solo_round\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n lockPeriod: {\n serializedName: \"lock_period\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n lockedUntil: {\n serializedName: \"locked_until\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PeerPubKey: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PeerPubKey\",\n modelProperties: {\n pubkey: {\n serializedName: \"pubkey\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const Status: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Status\",\n modelProperties: {\n genesisKeyBlockHash: {\n serializedName: \"genesis_key_block_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n solutions: {\n serializedName: \"solutions\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n difficulty: {\n serializedName: \"difficulty\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n syncing: {\n serializedName: \"syncing\",\n required: true,\n type: {\n name: \"Boolean\"\n }\n },\n syncProgress: {\n constraints: {\n InclusiveMaximum: 100,\n InclusiveMinimum: 0\n },\n serializedName: \"sync_progress\",\n type: {\n name: \"Number\"\n }\n },\n listening: {\n serializedName: \"listening\",\n required: true,\n type: {\n name: \"Boolean\"\n }\n },\n protocols: {\n serializedName: \"protocols\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"Protocol\"\n }\n }\n }\n },\n nodeVersion: {\n serializedName: \"node_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nodeRevision: {\n serializedName: \"node_revision\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n peerCount: {\n serializedName: \"peer_count\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n peerConnections: {\n serializedName: \"peer_connections\",\n type: {\n name: \"Composite\",\n className: \"PeerConnections\"\n }\n },\n pendingTransactionsCount: {\n serializedName: \"pending_transactions_count\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n networkId: {\n serializedName: \"network_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n peerPubkey: {\n serializedName: \"peer_pubkey\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n topKeyBlockHash: {\n serializedName: \"top_key_block_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n topBlockHeight: {\n serializedName: \"top_block_height\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const Protocol: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Protocol\",\n modelProperties: {\n version: {\n serializedName: \"version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n effectiveAtHeight: {\n serializedName: \"effective_at_height\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PeerConnections: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PeerConnections\",\n modelProperties: {\n inbound: {\n serializedName: \"inbound\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n outbound: {\n serializedName: \"outbound\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const SpendTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"SpendTx\",\n modelProperties: {\n recipientId: {\n serializedName: \"recipient_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n senderId: {\n serializedName: \"sender_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n payload: {\n serializedName: \"payload\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OracleRegisterTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"OracleRegisterTx\",\n modelProperties: {\n queryFormat: {\n serializedName: \"query_format\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responseFormat: {\n serializedName: \"response_format\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n queryFee: {\n serializedName: \"query_fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n oracleTtl: {\n serializedName: \"oracle_ttl\",\n type: {\n name: \"Composite\",\n className: \"Ttl\"\n }\n },\n accountId: {\n serializedName: \"account_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OracleExtendTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"OracleExtendTx\",\n modelProperties: {\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n oracleTtl: {\n serializedName: \"oracle_ttl\",\n type: {\n name: \"Composite\",\n className: \"RelativeTTL\"\n }\n },\n oracleId: {\n serializedName: \"oracle_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OracleQueryTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"OracleQueryTx\",\n modelProperties: {\n oracleId: {\n serializedName: \"oracle_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n query: {\n serializedName: \"query\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n queryFee: {\n serializedName: \"query_fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n queryTtl: {\n serializedName: \"query_ttl\",\n type: {\n name: \"Composite\",\n className: \"Ttl\"\n }\n },\n responseTtl: {\n serializedName: \"response_ttl\",\n type: {\n name: \"Composite\",\n className: \"RelativeTTL\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n senderId: {\n serializedName: \"sender_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OracleRespondTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"OracleRespondTx\",\n modelProperties: {\n queryId: {\n serializedName: \"query_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n response: {\n serializedName: \"response\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responseTtl: {\n serializedName: \"response_ttl\",\n type: {\n name: \"Composite\",\n className: \"RelativeTTL\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n oracleId: {\n serializedName: \"oracle_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NamePreclaimTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NamePreclaimTx\",\n modelProperties: {\n commitmentId: {\n serializedName: \"commitment_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n accountId: {\n serializedName: \"account_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NameClaimTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NameClaimTx\",\n modelProperties: {\n name: {\n serializedName: \"name\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nameSalt: {\n serializedName: \"name_salt\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nameFee: {\n serializedName: \"name_fee\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n accountId: {\n serializedName: \"account_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NameUpdateTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NameUpdateTx\",\n modelProperties: {\n nameId: {\n serializedName: \"name_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nameTtl: {\n serializedName: \"name_ttl\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n pointers: {\n serializedName: \"pointers\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"NamePointer\"\n }\n }\n }\n },\n clientTtl: {\n serializedName: \"client_ttl\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n accountId: {\n serializedName: \"account_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NameTransferTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NameTransferTx\",\n modelProperties: {\n nameId: {\n serializedName: \"name_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n recipientId: {\n serializedName: \"recipient_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n accountId: {\n serializedName: \"account_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NameRevokeTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NameRevokeTx\",\n modelProperties: {\n nameId: {\n serializedName: \"name_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n accountId: {\n serializedName: \"account_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const CommitmentId: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CommitmentId\",\n modelProperties: {\n commitmentId: {\n serializedName: \"commitment_id\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NameHash: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NameHash\",\n modelProperties: {\n nameId: {\n serializedName: \"name_id\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelCreateTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelCreateTx\",\n modelProperties: {\n initiatorId: {\n serializedName: \"initiator_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n initiatorAmount: {\n serializedName: \"initiator_amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responderId: {\n serializedName: \"responder_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responderAmount: {\n serializedName: \"responder_amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n channelReserve: {\n serializedName: \"channel_reserve\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n lockPeriod: {\n serializedName: \"lock_period\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n delegateIds: {\n serializedName: \"delegate_ids\",\n type: {\n name: \"Composite\",\n className: \"Delegates\"\n }\n }\n }\n }\n};\n\nexport const ChannelDepositTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelDepositTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n round: {\n serializedName: \"round\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelWithdrawTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelWithdrawTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n toId: {\n serializedName: \"to_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n round: {\n serializedName: \"round\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelForceProgressTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelForceProgressTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n payload: {\n serializedName: \"payload\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n round: {\n serializedName: \"round\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n update: {\n serializedName: \"update\",\n type: {\n name: \"Composite\",\n className: \"OffChainUpdate\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n offchainTrees: {\n serializedName: \"offchain_trees\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelCloseMutualTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelCloseMutualTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n initiatorAmountFinal: {\n serializedName: \"initiator_amount_final\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responderAmountFinal: {\n serializedName: \"responder_amount_final\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelCloseSoloTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelCloseSoloTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n payload: {\n serializedName: \"payload\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n poi: {\n serializedName: \"poi\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelSlashTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelSlashTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n payload: {\n serializedName: \"payload\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n poi: {\n serializedName: \"poi\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelSettleTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelSettleTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n initiatorAmountFinal: {\n serializedName: \"initiator_amount_final\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responderAmountFinal: {\n serializedName: \"responder_amount_final\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelSnapshotSoloTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelSnapshotSoloTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n payload: {\n serializedName: \"payload\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelSetDelegatesTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelSetDelegatesTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n initiatorDelegateIds: {\n serializedName: \"initiator_delegate_ids\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n responderDelegateIds: {\n serializedName: \"responder_delegate_ids\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n round: {\n serializedName: \"round\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n payload: {\n serializedName: \"payload\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PubKey: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PubKey\",\n modelProperties: {\n pubKey: {\n serializedName: \"pub_key\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PeerDetails: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PeerDetails\",\n modelProperties: {\n host: {\n serializedName: \"host\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n port: {\n serializedName: \"port\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n firstSeen: {\n serializedName: \"first_seen\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n lastSeen: {\n serializedName: \"last_seen\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n genesisHash: {\n serializedName: \"genesis_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n topHash: {\n serializedName: \"top_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n topDifficulty: {\n serializedName: \"top_difficulty\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n networkId: {\n serializedName: \"network_id\",\n type: {\n name: \"String\"\n }\n },\n nodeVersion: {\n serializedName: \"node_version\",\n type: {\n name: \"String\"\n }\n },\n nodeRevision: {\n serializedName: \"node_revision\",\n type: {\n name: \"String\"\n }\n },\n nodeVendor: {\n serializedName: \"node_vendor\",\n type: {\n name: \"String\"\n }\n },\n nodeOs: {\n serializedName: \"node_os\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const Peers: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Peers\",\n modelProperties: {\n peers: {\n serializedName: \"peers\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n blocked: {\n serializedName: \"blocked\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const PeerCount: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PeerCount\",\n modelProperties: {\n connected: {\n serializedName: \"connected\",\n type: {\n name: \"Composite\",\n className: \"PeerCountConnected\"\n }\n },\n available: {\n serializedName: \"available\",\n type: {\n name: \"Composite\",\n className: \"PeerCountAvailable\"\n }\n },\n blocked: {\n serializedName: \"blocked\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PeerCountConnected: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PeerCountConnected\",\n modelProperties: {\n inbound: {\n serializedName: \"inbound\",\n type: {\n name: \"String\"\n }\n },\n outbound: {\n serializedName: \"outbound\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PeerCountAvailable: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PeerCountAvailable\",\n modelProperties: {\n verified: {\n serializedName: \"verified\",\n type: {\n name: \"String\"\n }\n },\n unverified: {\n serializedName: \"unverified\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ContractCreateTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ContractCreateTx\",\n modelProperties: {\n ownerId: {\n serializedName: \"owner_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n code: {\n serializedName: \"code\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n vmVersion: {\n serializedName: \"vm_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n deposit: {\n serializedName: \"deposit\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gas: {\n serializedName: \"gas\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n callData: {\n serializedName: \"call_data\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ContractCallTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ContractCallTx\",\n modelProperties: {\n callerId: {\n serializedName: \"caller_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n contractId: {\n serializedName: \"contract_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gas: {\n serializedName: \"gas\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callData: {\n serializedName: \"call_data\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const UnsignedTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"UnsignedTx\",\n modelProperties: {\n tx: {\n serializedName: \"tx\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const TokenSupply: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"TokenSupply\",\n modelProperties: {\n accounts: {\n serializedName: \"accounts\",\n type: {\n name: \"String\"\n }\n },\n contracts: {\n serializedName: \"contracts\",\n type: {\n name: \"String\"\n }\n },\n contractOracles: {\n serializedName: \"contract_oracles\",\n type: {\n name: \"String\"\n }\n },\n locked: {\n serializedName: \"locked\",\n type: {\n name: \"String\"\n }\n },\n oracles: {\n serializedName: \"oracles\",\n type: {\n name: \"String\"\n }\n },\n oracleQueries: {\n serializedName: \"oracle_queries\",\n type: {\n name: \"String\"\n }\n },\n pendingRewards: {\n serializedName: \"pending_rewards\",\n type: {\n name: \"String\"\n }\n },\n total: {\n serializedName: \"total\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const GAAttachTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"GAAttachTx\",\n modelProperties: {\n ownerId: {\n serializedName: \"owner_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n code: {\n serializedName: \"code\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n vmVersion: {\n serializedName: \"vm_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gas: {\n serializedName: \"gas\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n callData: {\n serializedName: \"call_data\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n authFun: {\n constraints: {\n Pattern: new RegExp(\"^(0x|0X)?[a-fA-F0-9]+$\")\n },\n serializedName: \"auth_fun\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const GAMetaTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"GAMetaTx\",\n modelProperties: {\n gaId: {\n serializedName: \"ga_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gas: {\n serializedName: \"gas\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n authData: {\n serializedName: \"auth_data\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n tx: {\n serializedName: \"tx\",\n type: {\n name: \"Composite\",\n className: \"SignedTx\"\n }\n }\n }\n }\n};\n\nexport const PayingForTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PayingForTx\",\n modelProperties: {\n payerId: {\n serializedName: \"payer_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n tx: {\n serializedName: \"tx\",\n type: {\n name: \"Composite\",\n className: \"SignedTx\"\n }\n }\n }\n }\n};\n\nexport const CheckTxInPoolResponse: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CheckTxInPoolResponse\",\n modelProperties: {\n status: {\n serializedName: \"status\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OffChainTransfer: coreClient.CompositeMapper = {\n serializedName: \"OffChainTransfer\",\n type: {\n name: \"Composite\",\n className: \"OffChainTransfer\",\n uberParent: \"OffChainUpdate\",\n polymorphicDiscriminator: OffChainUpdate.type.polymorphicDiscriminator,\n modelProperties: {\n ...OffChainUpdate.type.modelProperties,\n from: {\n serializedName: \"from\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n to: {\n serializedName: \"to\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OffChainWithdrawal: coreClient.CompositeMapper = {\n serializedName: \"OffChainWithdrawal\",\n type: {\n name: \"Composite\",\n className: \"OffChainWithdrawal\",\n uberParent: \"OffChainUpdate\",\n polymorphicDiscriminator: OffChainUpdate.type.polymorphicDiscriminator,\n modelProperties: {\n ...OffChainUpdate.type.modelProperties,\n to: {\n serializedName: \"to\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OffChainDeposit: coreClient.CompositeMapper = {\n serializedName: \"OffChainDeposit\",\n type: {\n name: \"Composite\",\n className: \"OffChainDeposit\",\n uberParent: \"OffChainUpdate\",\n polymorphicDiscriminator: OffChainUpdate.type.polymorphicDiscriminator,\n modelProperties: {\n ...OffChainUpdate.type.modelProperties,\n from: {\n serializedName: \"from\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OffChainNewContract: coreClient.CompositeMapper = {\n serializedName: \"OffChainNewContract\",\n type: {\n name: \"Composite\",\n className: \"OffChainNewContract\",\n uberParent: \"OffChainUpdate\",\n polymorphicDiscriminator: OffChainUpdate.type.polymorphicDiscriminator,\n modelProperties: {\n ...OffChainUpdate.type.modelProperties,\n owner: {\n serializedName: \"owner\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n vmVersion: {\n serializedName: \"vm_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n code: {\n serializedName: \"code\",\n type: {\n name: \"Composite\",\n className: \"ByteCode\"\n }\n },\n deposit: {\n serializedName: \"deposit\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callData: {\n serializedName: \"call_data\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OffChainCallContract: coreClient.CompositeMapper = {\n serializedName: \"OffChainCallContract\",\n type: {\n name: \"Composite\",\n className: \"OffChainCallContract\",\n uberParent: \"OffChainUpdate\",\n polymorphicDiscriminator: OffChainUpdate.type.polymorphicDiscriminator,\n modelProperties: {\n ...OffChainUpdate.type.modelProperties,\n caller: {\n serializedName: \"caller\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n contract: {\n serializedName: \"contract\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gas: {\n serializedName: \"gas\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callData: {\n serializedName: \"call_data\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const CreateContractUnsignedTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CreateContractUnsignedTx\",\n modelProperties: {\n ...UnsignedTx.type.modelProperties,\n contractId: {\n serializedName: \"contract_id\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport let discriminators = {\n \"Tx.undefined\": Tx,\n OffChainUpdate: OffChainUpdate,\n \"OffChainUpdate.OffChainTransfer\": OffChainTransfer,\n \"OffChainUpdate.OffChainWithdrawal\": OffChainWithdrawal,\n \"OffChainUpdate.OffChainDeposit\": OffChainDeposit,\n \"OffChainUpdate.OffChainNewContract\": OffChainNewContract,\n \"OffChainUpdate.OffChainCallContract\": OffChainCallContract\n};\n","import {\n OperationParameter,\n OperationURLParameter,\n OperationQueryParameter\n} from \"@azure/core-client\";\nimport {\n DryRunInput as DryRunInputMapper,\n EncodedTx as EncodedTxMapper\n} from \"../models/mappers\";\n\nexport const accept: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue: \"application/json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const $host: OperationURLParameter = {\n parameterPath: \"$host\",\n mapper: {\n serializedName: \"$host\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n skipEncoding: true\n};\n\nexport const intAsString: OperationQueryParameter = {\n parameterPath: \"intAsString\",\n mapper: {\n defaultValue: false,\n serializedName: \"int-as-string\",\n type: {\n name: \"Boolean\"\n }\n }\n};\n\nexport const hash: OperationURLParameter = {\n parameterPath: \"hash\",\n mapper: {\n serializedName: \"hash\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const height: OperationURLParameter = {\n parameterPath: \"height\",\n mapper: {\n constraints: {\n InclusiveMaximum: 18446744073709552000,\n InclusiveMinimum: 0\n },\n serializedName: \"height\",\n required: true,\n type: {\n name: \"Number\"\n }\n }\n};\n\nexport const index: OperationURLParameter = {\n parameterPath: \"index\",\n mapper: {\n constraints: {\n InclusiveMinimum: 1\n },\n serializedName: \"index\",\n required: true,\n type: {\n name: \"Number\"\n }\n }\n};\n\nexport const pubkey: OperationURLParameter = {\n parameterPath: \"pubkey\",\n mapper: {\n serializedName: \"pubkey\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const strategy: OperationQueryParameter = {\n parameterPath: [\"options\", \"strategy\"],\n mapper: {\n defaultValue: \"max\",\n serializedName: \"strategy\",\n type: {\n name: \"Enum\",\n allowedValues: [\"max\", \"continuity\"]\n }\n }\n};\n\nexport const contentType: OperationParameter = {\n parameterPath: [\"options\", \"contentType\"],\n mapper: {\n defaultValue: \"application/json\",\n isConstant: true,\n serializedName: \"Content-Type\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const body: OperationParameter = {\n parameterPath: \"body\",\n mapper: DryRunInputMapper\n};\n\nexport const body1: OperationParameter = {\n parameterPath: \"body\",\n mapper: EncodedTxMapper\n};\n\nexport const fromParam: OperationQueryParameter = {\n parameterPath: [\"options\", \"from\"],\n mapper: {\n serializedName: \"from\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const limit: OperationQueryParameter = {\n parameterPath: [\"options\", \"limit\"],\n mapper: {\n defaultValue: 20,\n constraints: {\n InclusiveMaximum: 1000,\n InclusiveMinimum: 1\n },\n serializedName: \"limit\",\n type: {\n name: \"Number\"\n }\n }\n};\n\nexport const typeParam: OperationQueryParameter = {\n parameterPath: [\"options\", \"type\"],\n mapper: {\n defaultValue: \"all\",\n serializedName: \"type\",\n type: {\n name: \"Enum\",\n allowedValues: [\"open\", \"closed\", \"all\"]\n }\n }\n};\n\nexport const queryId: OperationURLParameter = {\n parameterPath: \"queryId\",\n mapper: {\n serializedName: \"query-id\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const name: OperationURLParameter = {\n parameterPath: \"name\",\n mapper: {\n serializedName: \"name\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n","import * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport * as Parameters from \"./models/parameters\";\nimport * as Mappers from \"./models/mappers\";\nimport {\n NodeOptionalParams,\n GetTopHeaderOptionalParams,\n GetTopHeaderResponse,\n GetCurrentKeyBlockOptionalParams,\n GetCurrentKeyBlockResponse,\n GetCurrentKeyBlockHashOptionalParams,\n GetCurrentKeyBlockHashResponse,\n GetCurrentKeyBlockHeightOptionalParams,\n GetCurrentKeyBlockHeightResponse,\n GetPendingKeyBlockOptionalParams,\n GetPendingKeyBlockResponse,\n GetKeyBlockByHashOptionalParams,\n GetKeyBlockByHashResponse,\n GetKeyBlockByHeightOptionalParams,\n GetKeyBlockByHeightResponse,\n GetMicroBlockHeaderByHashOptionalParams,\n GetMicroBlockHeaderByHashResponse,\n GetMicroBlockTransactionsByHashOptionalParams,\n GetMicroBlockTransactionsByHashResponse,\n GetMicroBlockTransactionByHashAndIndexOptionalParams,\n GetMicroBlockTransactionByHashAndIndexResponse,\n GetMicroBlockTransactionsCountByHashOptionalParams,\n GetMicroBlockTransactionsCountByHashResponse,\n GetCurrentGenerationOptionalParams,\n GetCurrentGenerationResponse,\n GetGenerationByHashOptionalParams,\n GetGenerationByHashResponse,\n GetGenerationByHeightOptionalParams,\n GetGenerationByHeightResponse,\n GetAccountByPubkeyOptionalParams,\n GetAccountByPubkeyResponse,\n GetAccountByPubkeyAndHeightOptionalParams,\n GetAccountByPubkeyAndHeightResponse,\n GetAccountByPubkeyAndHashOptionalParams,\n GetAccountByPubkeyAndHashResponse,\n GetPendingAccountTransactionsByPubkeyOptionalParams,\n GetPendingAccountTransactionsByPubkeyResponse,\n GetAccountNextNonceOptionalParams,\n GetAccountNextNonceResponse,\n DryRunInput,\n ProtectedDryRunTxsOptionalParams,\n ProtectedDryRunTxsResponse,\n GetTransactionByHashOptionalParams,\n GetTransactionByHashResponse,\n GetTransactionInfoByHashOptionalParams,\n GetTransactionInfoByHashResponse,\n EncodedTx,\n PostTransactionOptionalParams,\n PostTransactionResponse,\n GetContractOptionalParams,\n GetContractResponse,\n GetContractCodeOptionalParams,\n GetContractCodeResponse,\n GetContractPoIOptionalParams,\n GetContractPoIResponse,\n GetOracleByPubkeyOptionalParams,\n GetOracleByPubkeyResponse,\n GetOracleQueriesByPubkeyOptionalParams,\n GetOracleQueriesByPubkeyResponse,\n GetOracleQueryByPubkeyAndQueryIdOptionalParams,\n GetOracleQueryByPubkeyAndQueryIdResponse,\n GetNameEntryByNameOptionalParams,\n GetNameEntryByNameResponse,\n GetChannelByPubkeyOptionalParams,\n GetChannelByPubkeyResponse,\n GetPeerPubkeyOptionalParams,\n GetPeerPubkeyResponse,\n GetStatusOptionalParams,\n GetStatusResponse,\n GetChainEndsOptionalParams,\n GetChainEndsResponse\n} from \"./models\";\n\nexport class Node extends coreClient.ServiceClient {\n $host: string;\n intAsString?: boolean;\n\n /**\n * Initializes a new instance of the Node class.\n * @param $host server parameter\n * @param options The parameter options\n */\n constructor($host: string, options?: NodeOptionalParams) {\n if ($host === undefined) {\n throw new Error(\"'$host' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: NodeOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-node/1.0.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n baseUri: options.endpoint ?? options.baseUri ?? \"{$host}\"\n };\n super(optionsWithDefaults);\n\n if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();\n const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(\n (pipelinePolicy) =>\n pipelinePolicy.name ===\n coreRestPipeline.bearerTokenAuthenticationPolicyName\n );\n if (!bearerTokenAuthenticationPolicyFound) {\n this.pipeline.removePolicy({\n name: coreRestPipeline.bearerTokenAuthenticationPolicyName\n });\n this.pipeline.addPolicy(\n coreRestPipeline.bearerTokenAuthenticationPolicy({\n scopes: `${optionsWithDefaults.baseUri}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge:\n coreClient.authorizeRequestOnClaimChallenge\n }\n })\n );\n }\n }\n // Parameter assignments\n this.$host = $host;\n }\n\n /**\n * Get the top header (either key or micro block)\n * @param options The options parameters.\n */\n getTopHeader(\n options?: GetTopHeaderOptionalParams\n ): Promise<GetTopHeaderResponse> {\n return this.sendOperationRequest({ options }, getTopHeaderOperationSpec);\n }\n\n /**\n * Get the current key block\n * @param options The options parameters.\n */\n getCurrentKeyBlock(\n options?: GetCurrentKeyBlockOptionalParams\n ): Promise<GetCurrentKeyBlockResponse> {\n return this.sendOperationRequest(\n { options },\n getCurrentKeyBlockOperationSpec\n );\n }\n\n /**\n * Get the hash of the current key block\n * @param options The options parameters.\n */\n getCurrentKeyBlockHash(\n options?: GetCurrentKeyBlockHashOptionalParams\n ): Promise<GetCurrentKeyBlockHashResponse> {\n return this.sendOperationRequest(\n { options },\n getCurrentKeyBlockHashOperationSpec\n );\n }\n\n /**\n * Get the height of the current key block\n * @param options The options parameters.\n */\n getCurrentKeyBlockHeight(\n options?: GetCurrentKeyBlockHeightOptionalParams\n ): Promise<GetCurrentKeyBlockHeightResponse> {\n return this.sendOperationRequest(\n { options },\n getCurrentKeyBlockHeightOperationSpec\n );\n }\n\n /**\n * Get the pending key block\n * @param options The options parameters.\n */\n getPendingKeyBlock(\n options?: GetPendingKeyBlockOptionalParams\n ): Promise<GetPendingKeyBlockResponse> {\n return this.sendOperationRequest(\n { options },\n getPendingKeyBlockOperationSpec\n );\n }\n\n /**\n * Get a key block by hash\n * @param hash The hash of the block - either a keyblock or a microblock\n * @param options The options parameters.\n */\n getKeyBlockByHash(\n hash: string,\n options?: GetKeyBlockByHashOptionalParams\n ): Promise<GetKeyBlockByHashResponse> {\n return this.sendOperationRequest(\n { hash, options },\n getKeyBlockByHashOperationSpec\n );\n }\n\n /**\n * Get a key block by height\n * @param height The height\n * @param options The options parameters.\n */\n getKeyBlockByHeight(\n height: number,\n options?: GetKeyBlockByHeightOptionalParams\n ): Promise<GetKeyBlockByHeightResponse> {\n return this.sendOperationRequest(\n { height, options },\n getKeyBlockByHeightOperationSpec\n );\n }\n\n /**\n * Get a micro block header by hash\n * @param hash The hash of the block - either a keyblock or a microblock\n * @param options The options parameters.\n */\n getMicroBlockHeaderByHash(\n hash: string,\n options?: GetMicroBlockHeaderByHashOptionalParams\n ): Promise<GetMicroBlockHeaderByHashResponse> {\n return this.sendOperationRequest(\n { hash, options },\n getMicroBlockHeaderByHashOperationSpec\n );\n }\n\n /**\n * Get micro block transactions by hash\n * @param hash The hash of the micro block\n * @param options The options parameters.\n */\n getMicroBlockTransactionsByHash(\n hash: string,\n options?: GetMicroBlockTransactionsByHashOptionalParams\n ): Promise<GetMicroBlockTransactionsByHashResponse> {\n return this.sendOperationRequest(\n { hash, options },\n getMicroBlockTransactionsByHashOperationSpec\n );\n }\n\n /**\n * Get a micro block transaction by hash and index\n * @param hash The hash of the micro block\n * @param index The index of the transaction in a block\n * @param options The options parameters.\n */\n getMicroBlockTransactionByHashAndIndex(\n hash: string,\n index: number,\n options?: GetMicroBlockTransactionByHashAndIndexOptionalParams\n ): Promise<GetMicroBlockTransactionByHashAndIndexResponse> {\n return this.sendOperationRequest(\n { hash, index, options },\n getMicroBlockTransactionByHashAndIndexOperationSpec\n );\n }\n\n /**\n * Get micro block transaction count by hash\n * @param hash The hash of the micro block\n * @param options The options parameters.\n */\n getMicroBlockTransactionsCountByHash(\n hash: string,\n options?: GetMicroBlockTransactionsCountByHashOptionalParams\n ): Promise<GetMicroBlockTransactionsCountByHashResponse> {\n return this.sendOperationRequest(\n { hash, options },\n getMicroBlockTransactionsCountByHashOperationSpec\n );\n }\n\n /**\n * Get the current generation\n * @param options The options parameters.\n */\n getCurrentGeneration(\n options?: GetCurrentGenerationOptionalParams\n ): Promise<GetCurrentGenerationResponse> {\n return this.sendOperationRequest(\n { options },\n getCurrentGenerationOperationSpec\n );\n }\n\n /**\n * Get a generation by hash\n * @param hash The hash of the key block\n * @param options The options parameters.\n */\n getGenerationByHash(\n hash: string,\n options?: GetGenerationByHashOptionalParams\n ): Promise<GetGenerationByHashResponse> {\n return this.sendOperationRequest(\n { hash, options },\n getGenerationByHashOperationSpec\n );\n }\n\n /**\n * Get a generation by height\n * @param height The height\n * @param options The options parameters.\n */\n getGenerationByHeight(\n height: number,\n options?: GetGenerationByHeightOptionalParams\n ): Promise<GetGenerationByHeightResponse> {\n return this.sendOperationRequest(\n { height, options },\n getGenerationByHeightOperationSpec\n );\n }\n\n /**\n * Get an account by public key\n * @param pubkey The public key of the account\n * @param options The options parameters.\n */\n getAccountByPubkey(\n pubkey: string,\n options?: GetAccountByPubkeyOptionalParams\n ): Promise<GetAccountByPubkeyResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getAccountByPubkeyOperationSpec\n );\n }\n\n /**\n * Get an account by public key after the opening key block of the generation at height\n * @param pubkey The public key of the account\n * @param height The height\n * @param options The options parameters.\n */\n getAccountByPubkeyAndHeight(\n pubkey: string,\n height: number,\n options?: GetAccountByPubkeyAndHeightOptionalParams\n ): Promise<GetAccountByPubkeyAndHeightResponse> {\n return this.sendOperationRequest(\n { pubkey, height, options },\n getAccountByPubkeyAndHeightOperationSpec\n );\n }\n\n /**\n * Get an account by public key after the block indicated by hash. Can be either a micro block or a\n * keyblock hash\n * @param pubkey The public key of the account\n * @param hash The hash of the block - either a keyblock or a microblock\n * @param options The options parameters.\n */\n getAccountByPubkeyAndHash(\n pubkey: string,\n hash: string,\n options?: GetAccountByPubkeyAndHashOptionalParams\n ): Promise<GetAccountByPubkeyAndHashResponse> {\n return this.sendOperationRequest(\n { pubkey, hash, options },\n getAccountByPubkeyAndHashOperationSpec\n );\n }\n\n /**\n * Get pending account transactions by public key\n * @param pubkey The public key of the account\n * @param options The options parameters.\n */\n getPendingAccountTransactionsByPubkey(\n pubkey: string,\n options?: GetPendingAccountTransactionsByPubkeyOptionalParams\n ): Promise<GetPendingAccountTransactionsByPubkeyResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getPendingAccountTransactionsByPubkeyOperationSpec\n );\n }\n\n /**\n * Get an account's next nonce; This is computed according to whatever is the current account nonce and\n * what transactions are currently present in the transaction pool\n * @param pubkey The public key of the account\n * @param options The options parameters.\n */\n getAccountNextNonce(\n pubkey: string,\n options?: GetAccountNextNonceOptionalParams\n ): Promise<GetAccountNextNonceResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getAccountNextNonceOperationSpec\n );\n }\n\n /**\n * Dry-run transactions on top of a given block. Supports all TXs except GAMetaTx, PayingForTx and\n * OffchainTx. The maximum gas limit of all calls is capped. The maximum gas limit per request is a\n * global node setting. Since DryRunCallReq object do not have a mandatory gas field, if not set a\n * default value of 1000000 is being used instead.\n * @param body transactions\n * @param options The options parameters.\n */\n protectedDryRunTxs(\n body: DryRunInput,\n options?: ProtectedDryRunTxsOptionalParams\n ): Promise<ProtectedDryRunTxsResponse> {\n return this.sendOperationRequest(\n { body, options },\n protectedDryRunTxsOperationSpec\n );\n }\n\n /**\n * Get a transaction by hash\n * @param hash The hash of the transaction\n * @param options The options parameters.\n */\n getTransactionByHash(\n hash: string,\n options?: GetTransactionByHashOptionalParams\n ): Promise<GetTransactionByHashResponse> {\n return this.sendOperationRequest(\n { hash, options },\n getTransactionByHashOperationSpec\n );\n }\n\n /**\n * @param hash The hash of the transaction\n * @param options The options parameters.\n */\n getTransactionInfoByHash(\n hash: string,\n options?: GetTransactionInfoByHashOptionalParams\n ): Promise<GetTransactionInfoByHashResponse> {\n return this.sendOperationRequest(\n { hash, options },\n getTransactionInfoByHashOperationSpec\n );\n }\n\n /**\n * Post a new transaction\n * @param body The new transaction\n * @param options The options parameters.\n */\n postTransaction(\n body: EncodedTx,\n options?: PostTransactionOptionalParams\n ): Promise<PostTransactionResponse> {\n return this.sendOperationRequest(\n { body, options },\n postTransactionOperationSpec\n );\n }\n\n /**\n * Get a contract by pubkey\n * @param pubkey Contract pubkey to get proof for\n * @param options The options parameters.\n */\n getContract(\n pubkey: string,\n options?: GetContractOptionalParams\n ): Promise<GetContractResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getContractOperationSpec\n );\n }\n\n /**\n * Get contract code by pubkey\n * @param pubkey Contract pubkey to get proof for\n * @param options The options parameters.\n */\n getContractCode(\n pubkey: string,\n options?: GetContractCodeOptionalParams\n ): Promise<GetContractCodeResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getContractCodeOperationSpec\n );\n }\n\n /**\n * Get a proof of inclusion for a contract\n * @param pubkey Contract pubkey to get proof for\n * @param options The options parameters.\n */\n getContractPoI(\n pubkey: string,\n options?: GetContractPoIOptionalParams\n ): Promise<GetContractPoIResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getContractPoIOperationSpec\n );\n }\n\n /**\n * Get an oracle by public key\n * @param pubkey The public key of the oracle\n * @param options The options parameters.\n */\n getOracleByPubkey(\n pubkey: string,\n options?: GetOracleByPubkeyOptionalParams\n ): Promise<GetOracleByPubkeyResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getOracleByPubkeyOperationSpec\n );\n }\n\n /**\n * Get oracle queries by public key\n * @param pubkey The public key of the oracle\n * @param options The options parameters.\n */\n getOracleQueriesByPubkey(\n pubkey: string,\n options?: GetOracleQueriesByPubkeyOptionalParams\n ): Promise<GetOracleQueriesByPubkeyResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getOracleQueriesByPubkeyOperationSpec\n );\n }\n\n /**\n * Get an oracle query by public key and query ID\n * @param pubkey The public key of the oracle\n * @param queryId The ID of the query\n * @param options The options parameters.\n */\n getOracleQueryByPubkeyAndQueryId(\n pubkey: string,\n queryId: string,\n options?: GetOracleQueryByPubkeyAndQueryIdOptionalParams\n ): Promise<GetOracleQueryByPubkeyAndQueryIdResponse> {\n return this.sendOperationRequest(\n { pubkey, queryId, options },\n getOracleQueryByPubkeyAndQueryIdOperationSpec\n );\n }\n\n /**\n * Get name entry from naming system\n * @param name The name key of the name entry\n * @param options The options parameters.\n */\n getNameEntryByName(\n name: string,\n options?: GetNameEntryByNameOptionalParams\n ): Promise<GetNameEntryByNameResponse> {\n return this.sendOperationRequest(\n { name, options },\n getNameEntryByNameOperationSpec\n );\n }\n\n /**\n * Get channel by public key\n * @param pubkey The pubkey of the channel\n * @param options The options parameters.\n */\n getChannelByPubkey(\n pubkey: string,\n options?: GetChannelByPubkeyOptionalParams\n ): Promise<GetChannelByPubkeyResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getChannelByPubkeyOperationSpec\n );\n }\n\n /**\n * Get peer public key\n * @param options The options parameters.\n */\n getPeerPubkey(\n options?: GetPeerPubkeyOptionalParams\n ): Promise<GetPeerPubkeyResponse> {\n return this.sendOperationRequest({ options }, getPeerPubkeyOperationSpec);\n }\n\n /**\n * Get the status of a node\n * @param options The options parameters.\n */\n getStatus(options?: GetStatusOptionalParams): Promise<GetStatusResponse> {\n return this.sendOperationRequest({ options }, getStatusOperationSpec);\n }\n\n /**\n * Get oldest keyblock hashes counting from genesis including orphans\n * @param options The options parameters.\n */\n getChainEnds(\n options?: GetChainEndsOptionalParams\n ): Promise<GetChainEndsResponse> {\n return this.sendOperationRequest({ options }, getChainEndsOperationSpec);\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getTopHeaderOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/headers/top\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Header\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getCurrentKeyBlockOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/key-blocks/current\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.KeyBlock\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getCurrentKeyBlockHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/key-blocks/current/hash\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.HashResponse\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getCurrentKeyBlockHeightOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/key-blocks/current/height\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.HeightResponse\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getPendingKeyBlockOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/key-blocks/pending\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.KeyBlock\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getKeyBlockByHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/key-blocks/hash/{hash}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.KeyBlock\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getKeyBlockByHeightOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/key-blocks/height/{height}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.KeyBlock\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.height],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getMicroBlockHeaderByHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/micro-blocks/hash/{hash}/header\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.MicroBlockHeader\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getMicroBlockTransactionsByHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/micro-blocks/hash/{hash}/transactions\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SignedTxs\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getMicroBlockTransactionByHashAndIndexOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/micro-blocks/hash/{hash}/transactions/index/{index}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SignedTx\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash, Parameters.index],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getMicroBlockTransactionsCountByHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/micro-blocks/hash/{hash}/transactions/count\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.CountResponse\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getCurrentGenerationOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/generations/current\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Generation\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getGenerationByHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/generations/hash/{hash}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Generation\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getGenerationByHeightOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/generations/height/{height}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Generation\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.height],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getAccountByPubkeyOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/accounts/{pubkey}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Account\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getAccountByPubkeyAndHeightOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/accounts/{pubkey}/height/{height}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Account\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.height, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getAccountByPubkeyAndHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/accounts/{pubkey}/hash/{hash}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Account\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getPendingAccountTransactionsByPubkeyOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/accounts/{pubkey}/transactions/pending\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SignedTxs\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getAccountNextNonceOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/accounts/{pubkey}/next-nonce\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.NextNonceResponse\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString, Parameters.strategy],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst protectedDryRunTxsOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/dry-run\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.DryRunResults\n },\n 403: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n requestBody: Parameters.body,\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept, Parameters.contentType],\n mediaType: \"json\",\n serializer\n};\nconst getTransactionByHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/transactions/{hash}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SignedTx\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getTransactionInfoByHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/transactions/{hash}/info\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.TxInfoObject\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst postTransactionOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/transactions\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.PostTxResponse\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n requestBody: Parameters.body1,\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept, Parameters.contentType],\n mediaType: \"json\",\n serializer\n};\nconst getContractOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/contracts/{pubkey}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.ContractObject\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getContractCodeOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/contracts/{pubkey}/code\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.ByteCode\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getContractPoIOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/contracts/{pubkey}/poi\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.PoI\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getOracleByPubkeyOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/oracles/{pubkey}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.RegisteredOracle\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getOracleQueriesByPubkeyOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/oracles/{pubkey}/queries\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.OracleQueries\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [\n Parameters.intAsString,\n Parameters.fromParam,\n Parameters.limit,\n Parameters.typeParam\n ],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getOracleQueryByPubkeyAndQueryIdOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/oracles/{pubkey}/queries/{query-id}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.OracleQuery\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey, Parameters.queryId],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getNameEntryByNameOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/names/{name}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.NameEntry\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.name],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getChannelByPubkeyOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/channels/{pubkey}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Channel\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getPeerPubkeyOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/peers/pubkey\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.PeerPubKey\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getStatusOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/status\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Status\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getChainEndsOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/status/chain-ends\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: {\n type: { name: \"Sequence\", element: { type: { name: \"String\" } } }\n }\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\n","// eslint-disable-next-line max-classes-per-file\nimport BigNumber from 'bignumber.js';\nimport { OperationArguments, OperationSpec } from '@azure/core-client';\nimport {\n genRequestQueuesPolicy, genCombineGetRequestsPolicy, genErrorFormatterPolicy,\n genVersionCheckPolicy,\n} from './utils/autorest';\nimport { Node as NodeApi, NodeOptionalParams, ErrorModel } from './apis/node';\nimport { mapObject } from './utils/other';\nimport { Encoded } from './utils/encoder';\nimport { MissingParamError } from './utils/errors';\n\n/**\n * Obtain networkId from account or node\n */\nexport async function getNetworkId({ networkId }: { networkId?: string } = {}): Promise<string> {\n const res = networkId ?? this.networkId ?? (await this.api?.getStatus())?.networkId;\n if (res != null) return res;\n throw new MissingParamError('networkId is not provided');\n}\n\nconst bigIntPropertyNames = [\n 'balance', 'queryFee', 'fee', 'amount', 'nameFee', 'channelAmount',\n 'initiatorAmount', 'responderAmount', 'channelReserve', 'initiatorAmountFinal',\n 'responderAmountFinal', 'gasPrice', 'deposit',\n] as const;\n\nconst numberPropertyNames = [\n 'time', 'gas', 'gasUsed', 'nameSalt',\n 'nonce', 'nextNonce', 'height', 'blockHeight', 'top', 'topBlockHeight',\n 'ttl', 'nameTtl', 'clientTtl',\n 'inbound', 'outbound', 'peerCount', 'pendingTransactionsCount', 'effectiveAtHeight',\n 'version', 'solutions', 'round',\n] as const;\n\nclass NodeTransformed extends NodeApi {\n async sendOperationRequest(\n operationArguments: OperationArguments,\n operationSpec: OperationSpec,\n ): Promise<any> {\n const args = mapObject(\n operationArguments,\n ([key, value]) => [key, this.#encodeArg(value)],\n ) as OperationArguments;\n return this.#decodeRes(await super.sendOperationRequest(args, operationSpec));\n }\n\n #mapData(data: any, transform: {\n bigInt: (v: any) => any;\n number: (v: any) => any;\n }): unknown {\n if (Array.isArray(data)) return data.map((d) => this.#mapData(d, transform));\n if (data != null && typeof data === 'object') {\n return mapObject(data, ([key, value]) => {\n if (value == null) return [key, value];\n if (bigIntPropertyNames.some((k) => k === key)) return [key, transform.bigInt(value)];\n if (numberPropertyNames.some((k) => k === key)) return [key, transform.number(value)];\n return [key, this.#mapData(value, transform)];\n });\n }\n return data;\n }\n\n #encodeArg(data: any): any {\n return this.#mapData(data, {\n bigInt: (value) => {\n if (value instanceof BigNumber) return value.toFixed();\n return value.toString();\n },\n number: (value) => value.toString(),\n });\n }\n\n #decodeRes(data: any): any {\n return this.#mapData(data, {\n bigInt: (value) => BigInt(value),\n number: (value) => +value,\n });\n }\n}\n\ntype BigIntPropertyNames = typeof bigIntPropertyNames[number];\ntype NumberPropertyNames = typeof numberPropertyNames[number];\ntype PreserveOptional<NewType, OrigType> =\n OrigType extends undefined ? NewType | undefined : NewType;\nexport type TransformNodeType<Type> =\n Type extends (...args: infer Args) => infer Ret\n ? (...args: TransformNodeType<Args>) => TransformNodeType<Ret>\n : Type extends [infer Item, ...infer Rest]\n ? [TransformNodeType<Item>, ...TransformNodeType<Rest>]\n : Type extends Array<infer Item>\n ? Array<TransformNodeType<Item>>\n : Type extends Promise<infer T>\n ? Promise<TransformNodeType<T>>\n : Type extends { [P in any]: any }\n ? {\n [Property in keyof Type]:\n Property extends BigIntPropertyNames\n ? PreserveOptional<bigint, Type[Property]>\n : Property extends NumberPropertyNames\n ? PreserveOptional<number, Type[Property]>\n : Property extends 'txHash'\n ? PreserveOptional<Encoded.TxHash, Type[Property]>\n : TransformNodeType<Type[Property]>\n }\n : Type;\ntype NodeTransformedApi = new (...args: ConstructorParameters<typeof NodeApi>) => {\n [Name in keyof InstanceType<typeof NodeApi>]:\n Name extends 'pipeline' | 'sendRequest' | 'sendOperationRequest'\n ? NodeApi[Name] : TransformNodeType<NodeApi[Name]>\n};\n\nexport interface NodeInfo {\n url: string;\n nodeNetworkId: string;\n version: string;\n consensusProtocolVersion: number;\n}\n\nexport default class Node extends (NodeTransformed as unknown as NodeTransformedApi) {\n url: string;\n\n /**\n * @param url - Url for node API\n * @param options - Options\n * @param options.ignoreVersion - Don't check node version\n */\n constructor(\n url: string,\n { ignoreVersion = false, ...options }: NodeOptionalParams & { ignoreVersion?: boolean } = {},\n ) {\n // eslint-disable-next-line constructor-super\n super(url, {\n allowInsecureConnection: true,\n additionalPolicies: [\n genRequestQueuesPolicy(),\n genCombineGetRequestsPolicy(),\n genErrorFormatterPolicy((body: ErrorModel) => ` ${body.reason}`),\n ],\n ...options,\n });\n this.url = url;\n if (!ignoreVersion) {\n const versionPromise = this.getStatus().then(({ nodeVersion }) => nodeVersion);\n this.pipeline.addPolicy(\n genVersionCheckPolicy('node', '/v3/status', versionPromise, '6.2.0', '7.0.0'),\n );\n }\n this.intAsString = true;\n }\n\n async getNodeInfo(): Promise<NodeInfo> {\n const {\n nodeVersion: version,\n networkId: nodeNetworkId,\n protocols,\n topBlockHeight,\n } = await this.getStatus();\n const consensusProtocolVersion = protocols\n .filter(({ effectiveAtHeight }) => topBlockHeight >= effectiveAtHeight)\n .reduce(\n (acc, p) => (p.effectiveAtHeight > acc.effectiveAtHeight ? p : acc),\n { effectiveAtHeight: -1, version: 0 },\n )\n .version;\n return {\n url: this.url,\n nodeNetworkId,\n version,\n consensusProtocolVersion,\n };\n }\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport { messageToHash, verifyMessage as verifyMessageCrypto, hash } from '../utils/crypto';\nimport { buildTx } from '../tx/builder';\nimport { decode, Encoded } from '../utils/encoder';\nimport { Tag } from '../tx/builder/constants';\nimport { getNetworkId } from '../Node';\nimport { concatBuffers } from '../utils/other';\nimport type { createMetaTx } from '../contract/ga';\n\n/**\n * Check is provided object looks like an instance of AccountBase\n * @param acc - Object to check\n */\nexport const isAccountBase = (acc: AccountBase | any): boolean => (\n !['sign', 'address', 'signTransaction', 'signMessage'].some((f) => typeof acc[f] !== 'function')\n);\n\n/**\n * Account is one of the three basic building blocks of an\n * {@link AeSdk} and provides access to a signing key pair.\n */\nexport default abstract class AccountBase {\n networkId?: string;\n\n /**\n * @param options - Options\n * @param options.networkId - Using for signing transactions\n */\n constructor({ networkId }: { networkId?: string } = {}) {\n this.networkId ??= networkId;\n }\n\n /**\n * Sign encoded transaction\n * @param tx - Transaction to sign\n * @param opt - Options\n * @param opt.innerTx - Sign as inner transaction for PayingFor\n * @returns Signed transaction\n */\n async signTransaction(\n tx: Encoded.Transaction,\n { innerTx, networkId, ...options }: {\n innerTx?: boolean;\n networkId?: string;\n authData?: Parameters<typeof createMetaTx>[1];\n authFun?: Parameters<typeof createMetaTx>[2];\n } & Omit<Partial<Parameters<typeof createMetaTx>[3]>, 'onAccount'> = {},\n ): Promise<Encoded.Transaction> {\n const prefixes = [await this.getNetworkId({ networkId })];\n if (innerTx === true) prefixes.push('inner_tx');\n const rlpBinaryTx = decode(tx);\n const txWithNetworkId = concatBuffers([Buffer.from(prefixes.join('-')), hash(rlpBinaryTx)]);\n\n const signatures = [await this.sign(txWithNetworkId, options)];\n return buildTx({ encodedTx: rlpBinaryTx, signatures }, Tag.SignedTx).tx;\n }\n\n /**\n * Get network Id\n * @returns Network Id\n */\n readonly getNetworkId = getNetworkId;\n\n /**\n * Sign message\n * @param message - Message to sign\n * @param opt - Options\n * @returns Signature as hex string of Uint8Array\n */\n async signMessage(\n message: string,\n { returnHex = false, ...options }: { returnHex?: boolean } = {},\n ): Promise<string | Uint8Array> {\n const sig = await this.sign(messageToHash(message), options);\n return returnHex ? Buffer.from(sig).toString('hex') : sig;\n }\n\n /**\n * Verify message\n * @param message - Message to verify\n * @param signature - Signature\n * @param options - Options\n */\n async verifyMessage(\n message: string,\n signature: string | Uint8Array,\n options?: object,\n ): Promise<boolean> {\n return verifyMessageCrypto(\n message,\n typeof signature === 'string' ? Buffer.from(signature, 'hex') : signature,\n decode(await this.address(options)),\n );\n }\n\n /**\n * Sign data blob\n * @param data - Data blob to sign\n * @param options - Options\n * @returns Signed data blob\n */\n abstract sign(data: string | Uint8Array, options?: any): Promise<Uint8Array>;\n\n /**\n * Obtain account address\n * @returns Public account address\n */\n abstract address(opt?: object): Promise<Encoded.AccountAddress>;\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2018 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport AccountBase from './Base';\nimport { sign, isValidKeypair } from '../utils/crypto';\nimport { isHex } from '../utils/string';\nimport { ArgumentError, InvalidKeypairError, MissingParamError } from '../utils/errors';\nimport { decode, Encoded } from '../utils/encoder';\nimport { createMetaTx } from '../contract/ga';\n\nconst secrets = new WeakMap();\n\nexport interface Keypair {\n publicKey: Encoded.AccountAddress;\n secretKey: string | Uint8Array;\n}\n\n/**\n * In-memory account class\n */\nexport default class AccountMemory extends AccountBase {\n isGa: boolean;\n\n /**\n * @param options - Options\n * @param options.keypair - Key pair to use\n * @param options.keypair.publicKey - Public key\n * @param options.keypair.secretKey - Private key\n * @param options.gaId - Address of generalized account\n */\n constructor(\n { keypair, gaId, ...options }: { keypair?: Keypair; gaId?: Encoded.AccountAddress }\n & ConstructorParameters<typeof AccountBase>[0],\n ) {\n super(options);\n\n this.isGa = gaId != null;\n if (this.isGa && gaId != null) {\n decode(gaId);\n secrets.set(this, { publicKey: gaId });\n return;\n }\n\n if (keypair == null) throw new MissingParamError('Either gaId or keypair is required');\n\n if (\n !Buffer.isBuffer(keypair.secretKey)\n && typeof keypair.secretKey === 'string' && !isHex(keypair.secretKey)\n ) throw new InvalidKeypairError('Secret key must be hex string or Buffer');\n const secretKey = typeof keypair.secretKey === 'string'\n ? Buffer.from(keypair.secretKey, 'hex')\n : keypair.secretKey;\n if (!isValidKeypair(secretKey, decode(keypair.publicKey))) {\n throw new InvalidKeypairError('Invalid Key Pair');\n }\n\n secrets.set(this, {\n secretKey,\n publicKey: keypair.publicKey,\n });\n }\n\n async sign(data: string | Uint8Array): Promise<Uint8Array> {\n if (this.isGa) throw new InvalidKeypairError('You are trying to sign data using generalized account without keypair');\n return sign(data, secrets.get(this).secretKey);\n }\n\n async signTransaction(\n tx: Encoded.Transaction,\n options: Parameters<AccountBase['signTransaction']>[1] = {},\n ): Promise<Encoded.Transaction> {\n if (!this.isGa || options.innerTx === true) return super.signTransaction(tx, options);\n const {\n authData, authFun, onCompiler, onNode,\n } = options;\n if (authFun == null || authData == null || onCompiler == null || onNode == null) {\n throw new ArgumentError('authData, authFun, onCompiler, onNode', 'provided', null);\n }\n return createMetaTx(tx, authData, authFun, { onCompiler, onNode, onAccount: this });\n }\n\n async address(): Promise<Encoded.AccountAddress> {\n return secrets.get(this).publicKey;\n }\n}\n","import * as coreClient from \"@azure/core-client\";\n\nexport const Contract: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Contract\",\n modelProperties: {\n code: {\n serializedName: \"code\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n options: {\n serializedName: \"options\",\n type: {\n name: \"Composite\",\n className: \"CompileOpts\"\n }\n }\n }\n }\n};\n\nexport const CompileOpts: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CompileOpts\",\n modelProperties: {\n backend: {\n serializedName: \"backend\",\n type: {\n name: \"String\"\n }\n },\n fileSystem: {\n serializedName: \"file_system\",\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n },\n srcFile: {\n serializedName: \"src_file\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const Aci: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Aci\",\n modelProperties: {\n encodedAci: {\n serializedName: \"encoded_aci\",\n required: true,\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n },\n externalEncodedAci: {\n serializedName: \"external_encoded_aci\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n }\n }\n },\n interface: {\n serializedName: \"interface\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const CompilerError: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CompilerError\",\n modelProperties: {\n context: {\n serializedName: \"context\",\n type: {\n name: \"String\"\n }\n },\n message: {\n serializedName: \"message\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n pos: {\n serializedName: \"pos\",\n type: {\n name: \"Composite\",\n className: \"ErrorPos\"\n }\n },\n type: {\n serializedName: \"type\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ErrorPos: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ErrorPos\",\n modelProperties: {\n col: {\n serializedName: \"col\",\n required: true,\n type: {\n name: \"Number\"\n }\n },\n file: {\n serializedName: \"file\",\n type: {\n name: \"String\"\n }\n },\n line: {\n serializedName: \"line\",\n required: true,\n type: {\n name: \"Number\"\n }\n }\n }\n }\n};\n\nexport const ErrorModel: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ErrorModel\",\n modelProperties: {\n reason: {\n serializedName: \"reason\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const APIVersion: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"APIVersion\",\n modelProperties: {\n apiVersion: {\n serializedName: \"api-version\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ByteCode: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ByteCode\",\n modelProperties: {\n bytecode: {\n serializedName: \"bytecode\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ByteCodeInput: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ByteCodeInput\",\n modelProperties: {\n bytecode: {\n serializedName: \"bytecode\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const CompilerVersion: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CompilerVersion\",\n modelProperties: {\n version: {\n serializedName: \"version\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const SophiaCallResultInput: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"SophiaCallResultInput\",\n modelProperties: {\n callResult: {\n serializedName: \"call-result\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callValue: {\n serializedName: \"call-value\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n function: {\n serializedName: \"function\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n options: {\n serializedName: \"options\",\n type: {\n name: \"Composite\",\n className: \"CompileOpts\"\n }\n },\n source: {\n serializedName: \"source\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const BytecodeCallResultInput: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"BytecodeCallResultInput\",\n modelProperties: {\n backend: {\n serializedName: \"backend\",\n type: {\n name: \"String\"\n }\n },\n bytecode: {\n serializedName: \"bytecode\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callResult: {\n serializedName: \"call-result\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callValue: {\n serializedName: \"call-value\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n function: {\n serializedName: \"function\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const DecodedCallresult: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DecodedCallresult\",\n modelProperties: {\n function: {\n serializedName: \"function\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n result: {\n serializedName: \"result\",\n required: true,\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n }\n }\n }\n};\n\nexport const DecodeCalldataBytecode: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DecodeCalldataBytecode\",\n modelProperties: {\n backend: {\n serializedName: \"backend\",\n type: {\n name: \"String\"\n }\n },\n bytecode: {\n serializedName: \"bytecode\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n calldata: {\n serializedName: \"calldata\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const DecodedCalldata: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DecodedCalldata\",\n modelProperties: {\n arguments: {\n serializedName: \"arguments\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n }\n }\n },\n function: {\n serializedName: \"function\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const DecodeCalldataSource: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DecodeCalldataSource\",\n modelProperties: {\n calldata: {\n serializedName: \"calldata\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n function: {\n serializedName: \"function\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n options: {\n serializedName: \"options\",\n type: {\n name: \"Composite\",\n className: \"CompileOpts\"\n }\n },\n source: {\n serializedName: \"source\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const SophiaBinaryData: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"SophiaBinaryData\",\n modelProperties: {\n data: {\n serializedName: \"data\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n sophiaType: {\n serializedName: \"sophia-type\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const SophiaJsonData: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"SophiaJsonData\",\n modelProperties: {\n data: {\n serializedName: \"data\",\n required: true,\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n }\n }\n }\n};\n\nexport const FunctionCallInput: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"FunctionCallInput\",\n modelProperties: {\n arguments: {\n serializedName: \"arguments\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n function: {\n serializedName: \"function\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n options: {\n serializedName: \"options\",\n type: {\n name: \"Composite\",\n className: \"CompileOpts\"\n }\n },\n source: {\n serializedName: \"source\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const Calldata: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Calldata\",\n modelProperties: {\n calldata: {\n serializedName: \"calldata\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const FateAssembler: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"FateAssembler\",\n modelProperties: {\n fateAssembler: {\n serializedName: \"fate-assembler\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ValidateByteCodeInput: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ValidateByteCodeInput\",\n modelProperties: {\n bytecode: {\n serializedName: \"bytecode\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n options: {\n serializedName: \"options\",\n type: {\n name: \"Composite\",\n className: \"CompileOpts\"\n }\n },\n source: {\n serializedName: \"source\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n","import { OperationParameter, OperationURLParameter } from \"@azure/core-client\";\nimport {\n Contract as ContractMapper,\n ByteCodeInput as ByteCodeInputMapper,\n SophiaCallResultInput as SophiaCallResultInputMapper,\n BytecodeCallResultInput as BytecodeCallResultInputMapper,\n DecodeCalldataBytecode as DecodeCalldataBytecodeMapper,\n DecodeCalldataSource as DecodeCalldataSourceMapper,\n SophiaBinaryData as SophiaBinaryDataMapper,\n FunctionCallInput as FunctionCallInputMapper,\n ValidateByteCodeInput as ValidateByteCodeInputMapper\n} from \"../models/mappers\";\n\nexport const contentType: OperationParameter = {\n parameterPath: [\"options\", \"contentType\"],\n mapper: {\n defaultValue: \"application/json\",\n isConstant: true,\n serializedName: \"Content-Type\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const body: OperationParameter = {\n parameterPath: \"body\",\n mapper: ContractMapper\n};\n\nexport const accept: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue: \"application/json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const $host: OperationURLParameter = {\n parameterPath: \"$host\",\n mapper: {\n serializedName: \"$host\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n skipEncoding: true\n};\n\nexport const body1: OperationParameter = {\n parameterPath: \"body\",\n mapper: ByteCodeInputMapper\n};\n\nexport const body2: OperationParameter = {\n parameterPath: \"body\",\n mapper: SophiaCallResultInputMapper\n};\n\nexport const body3: OperationParameter = {\n parameterPath: \"body\",\n mapper: BytecodeCallResultInputMapper\n};\n\nexport const body4: OperationParameter = {\n parameterPath: \"body\",\n mapper: DecodeCalldataBytecodeMapper\n};\n\nexport const body5: OperationParameter = {\n parameterPath: \"body\",\n mapper: DecodeCalldataSourceMapper\n};\n\nexport const body6: OperationParameter = {\n parameterPath: \"body\",\n mapper: SophiaBinaryDataMapper\n};\n\nexport const body7: OperationParameter = {\n parameterPath: \"body\",\n mapper: FunctionCallInputMapper\n};\n\nexport const body8: OperationParameter = {\n parameterPath: \"body\",\n mapper: ValidateByteCodeInputMapper\n};\n","import * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport * as Parameters from \"./models/parameters\";\nimport * as Mappers from \"./models/mappers\";\nimport {\n CompilerOptionalParams,\n Contract,\n GenerateACIOptionalParams,\n GenerateACIResponse,\n ApiOptionalParams,\n ApiResponse,\n APIVersionOptionalParams,\n APIVersionResponse,\n CompileContractOptionalParams,\n CompileContractResponse,\n ByteCodeInput,\n GetCompilerVersionOptionalParams,\n GetCompilerVersionResponse,\n SophiaCallResultInput,\n DecodeCallResultOptionalParams,\n DecodeCallResultResponse,\n BytecodeCallResultInput,\n DecodeCallResultBytecodeOptionalParams,\n DecodeCallResultBytecodeResponse,\n DecodeCalldataBytecode,\n DecodeCalldataBytecodeOptionalParams,\n DecodeCalldataBytecodeResponse,\n DecodeCalldataSource,\n DecodeCalldataSourceOptionalParams,\n DecodeCalldataSourceResponse,\n SophiaBinaryData,\n DecodeDataOptionalParams,\n DecodeDataResponse,\n FunctionCallInput,\n EncodeCalldataOptionalParams,\n EncodeCalldataResponse,\n GetFateAssemblerCodeOptionalParams,\n GetFateAssemblerCodeResponse,\n ValidateByteCodeInput,\n ValidateByteCodeOptionalParams,\n VersionOptionalParams,\n VersionResponse\n} from \"./models\";\n\nexport class Compiler extends coreClient.ServiceClient {\n $host: string;\n\n /**\n * Initializes a new instance of the Compiler class.\n * @param $host server parameter\n * @param options The parameter options\n */\n constructor($host: string, options?: CompilerOptionalParams) {\n if ($host === undefined) {\n throw new Error(\"'$host' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: CompilerOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-compiler/1.0.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n baseUri: options.endpoint ?? options.baseUri ?? \"{$host}\"\n };\n super(optionsWithDefaults);\n\n if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();\n const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(\n (pipelinePolicy) =>\n pipelinePolicy.name ===\n coreRestPipeline.bearerTokenAuthenticationPolicyName\n );\n if (!bearerTokenAuthenticationPolicyFound) {\n this.pipeline.removePolicy({\n name: coreRestPipeline.bearerTokenAuthenticationPolicyName\n });\n this.pipeline.addPolicy(\n coreRestPipeline.bearerTokenAuthenticationPolicy({\n scopes: `${optionsWithDefaults.baseUri}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge:\n coreClient.authorizeRequestOnClaimChallenge\n }\n })\n );\n }\n }\n // Parameter assignments\n this.$host = $host;\n }\n\n /**\n * Generate an Aeternity Contract Interface (ACI) for contract\n * @param body contract code\n * @param options The options parameters.\n */\n generateACI(\n body: Contract,\n options?: GenerateACIOptionalParams\n ): Promise<GenerateACIResponse> {\n return this.sendOperationRequest(\n { body, options },\n generateACIOperationSpec\n );\n }\n\n /**\n * Get the Api description\n * @param options The options parameters.\n */\n api(options?: ApiOptionalParams): Promise<ApiResponse> {\n return this.sendOperationRequest({ options }, apiOperationSpec);\n }\n\n /**\n * Get the version of the API\n * @param options The options parameters.\n */\n aPIVersion(options?: APIVersionOptionalParams): Promise<APIVersionResponse> {\n return this.sendOperationRequest({ options }, aPIVersionOperationSpec);\n }\n\n /**\n * Compile a sophia contract from source and return byte code\n * @param body contract code\n * @param options The options parameters.\n */\n compileContract(\n body: Contract,\n options?: CompileContractOptionalParams\n ): Promise<CompileContractResponse> {\n return this.sendOperationRequest(\n { body, options },\n compileContractOperationSpec\n );\n }\n\n /**\n * Extract compiler version from bytecode\n * @param body contract byte array\n * @param options The options parameters.\n */\n getCompilerVersion(\n body: ByteCodeInput,\n options?: GetCompilerVersionOptionalParams\n ): Promise<GetCompilerVersionResponse> {\n return this.sendOperationRequest(\n { body, options },\n getCompilerVersionOperationSpec\n );\n }\n\n /**\n * Decode the result of contract call\n * @param body Binary data in Sophia ABI format\n * @param options The options parameters.\n */\n decodeCallResult(\n body: SophiaCallResultInput,\n options?: DecodeCallResultOptionalParams\n ): Promise<DecodeCallResultResponse> {\n return this.sendOperationRequest(\n { body, options },\n decodeCallResultOperationSpec\n );\n }\n\n /**\n * Decode the result of contract call from Bytecode\n * @param body Call result + compiled contract\n * @param options The options parameters.\n */\n decodeCallResultBytecode(\n body: BytecodeCallResultInput,\n options?: DecodeCallResultBytecodeOptionalParams\n ): Promise<DecodeCallResultBytecodeResponse> {\n return this.sendOperationRequest(\n { body, options },\n decodeCallResultBytecodeOperationSpec\n );\n }\n\n /**\n * Identify function name and arguments in Calldata for a compiled contract\n * @param body Calldata + compiled contract\n * @param options The options parameters.\n */\n decodeCalldataBytecode(\n body: DecodeCalldataBytecode,\n options?: DecodeCalldataBytecodeOptionalParams\n ): Promise<DecodeCalldataBytecodeResponse> {\n return this.sendOperationRequest(\n { body, options },\n decodeCalldataBytecodeOperationSpec\n );\n }\n\n /**\n * Identify function name and arguments in Calldata for a (partial) contract\n * @param body Calldata + contract (stub) code\n * @param options The options parameters.\n */\n decodeCalldataSource(\n body: DecodeCalldataSource,\n options?: DecodeCalldataSourceOptionalParams\n ): Promise<DecodeCalldataSourceResponse> {\n return this.sendOperationRequest(\n { body, options },\n decodeCalldataSourceOperationSpec\n );\n }\n\n /**\n * Decode data as retuned by a contract call. - Legacy decoding\n * @param body Binary data in Sophia ABI format\n * @param options The options parameters.\n */\n decodeData(\n body: SophiaBinaryData,\n options?: DecodeDataOptionalParams\n ): Promise<DecodeDataResponse> {\n return this.sendOperationRequest(\n { body, options },\n decodeDataOperationSpec\n );\n }\n\n /**\n * Encode Sophia function call according to sophia ABI.\n * @param body Sophia function call - contract code + function name + arguments\n * @param options The options parameters.\n */\n encodeCalldata(\n body: FunctionCallInput,\n options?: EncodeCalldataOptionalParams\n ): Promise<EncodeCalldataResponse> {\n return this.sendOperationRequest(\n { body, options },\n encodeCalldataOperationSpec\n );\n }\n\n /**\n * Get FATE assembler code from bytecode\n * @param body contract byte array\n * @param options The options parameters.\n */\n getFateAssemblerCode(\n body: ByteCodeInput,\n options?: GetFateAssemblerCodeOptionalParams\n ): Promise<GetFateAssemblerCodeResponse> {\n return this.sendOperationRequest(\n { body, options },\n getFateAssemblerCodeOperationSpec\n );\n }\n\n /**\n * Verify that an encoded byte array is the result of compiling a given contract\n * @param body contract byte array and source code\n * @param options The options parameters.\n */\n validateByteCode(\n body: ValidateByteCodeInput,\n options?: ValidateByteCodeOptionalParams\n ): Promise<void> {\n return this.sendOperationRequest(\n { body, options },\n validateByteCodeOperationSpec\n );\n }\n\n /**\n * Get the version of the underlying Sophia compiler version\n * @param options The options parameters.\n */\n version(options?: VersionOptionalParams): Promise<VersionResponse> {\n return this.sendOperationRequest({ options }, versionOperationSpec);\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst generateACIOperationSpec: coreClient.OperationSpec = {\n path: \"/aci\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.Aci\n },\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } }\n }\n },\n isError: true\n }\n },\n requestBody: Parameters.body,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst apiOperationSpec: coreClient.OperationSpec = {\n path: \"/api\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: {\n type: { name: \"Dictionary\", value: { type: { name: \"any\" } } }\n }\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst aPIVersionOperationSpec: coreClient.OperationSpec = {\n path: \"/api-version\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.APIVersion\n },\n 500: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst compileContractOperationSpec: coreClient.OperationSpec = {\n path: \"/compile\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.ByteCode\n },\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } }\n }\n },\n isError: true\n }\n },\n requestBody: Parameters.body,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst getCompilerVersionOperationSpec: coreClient.OperationSpec = {\n path: \"/compiler-version\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.CompilerVersion\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n requestBody: Parameters.body1,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst decodeCallResultOperationSpec: coreClient.OperationSpec = {\n path: \"/decode-call-result\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: { type: { name: \"any\" } }\n },\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } }\n }\n },\n isError: true\n }\n },\n requestBody: Parameters.body2,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst decodeCallResultBytecodeOperationSpec: coreClient.OperationSpec = {\n path: \"/decode-call-result/bytecode\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.DecodedCallresult\n },\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } }\n }\n },\n isError: true\n }\n },\n requestBody: Parameters.body3,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst decodeCalldataBytecodeOperationSpec: coreClient.OperationSpec = {\n path: \"/decode-calldata/bytecode\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.DecodedCalldata\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n requestBody: Parameters.body4,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst decodeCalldataSourceOperationSpec: coreClient.OperationSpec = {\n path: \"/decode-calldata/source\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.DecodedCalldata\n },\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } }\n }\n },\n isError: true\n }\n },\n requestBody: Parameters.body5,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst decodeDataOperationSpec: coreClient.OperationSpec = {\n path: \"/decode-data\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.SophiaJsonData\n },\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } }\n }\n },\n isError: true\n }\n },\n requestBody: Parameters.body6,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst encodeCalldataOperationSpec: coreClient.OperationSpec = {\n path: \"/encode-calldata\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.Calldata\n },\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } }\n }\n },\n isError: true\n }\n },\n requestBody: Parameters.body7,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst getFateAssemblerCodeOperationSpec: coreClient.OperationSpec = {\n path: \"/fate-assembler\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.FateAssembler\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n requestBody: Parameters.body1,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst validateByteCodeOperationSpec: coreClient.OperationSpec = {\n path: \"/validate-byte-code\",\n httpMethod: \"POST\",\n responses: {\n 200: {},\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } }\n }\n },\n isError: true\n }\n },\n requestBody: Parameters.body8,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst versionOperationSpec: coreClient.OperationSpec = {\n path: \"/version\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.CompilerVersion\n },\n 500: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport { Compiler as CompilerApi, ErrorModel, CompilerError } from '../apis/compiler';\nimport { genErrorFormatterPolicy, genVersionCheckPolicy } from '../utils/autorest';\n\ntype GeneralCompilerError = ErrorModel & {\n info?: object;\n parameter?: string;\n};\n\n/**\n * Contract Compiler\n *\n * This class include api call's related to contract compiler functionality.\n * @category contract\n * @example Compiler('COMPILER_URL')\n */\nexport default class Compiler extends CompilerApi {\n /**\n * @param compilerUrl - Url for compiler API\n * @param options - Options\n * @param options.ignoreVersion - Don't check compiler version\n */\n constructor(compilerUrl: string, { ignoreVersion }: { ignoreVersion?: boolean } = {}) {\n super(compilerUrl, {\n allowInsecureConnection: true,\n additionalPolicies: [\n genErrorFormatterPolicy((body: GeneralCompilerError | CompilerError[]) => {\n let message = '';\n if ('reason' in body) {\n message += ` ${body.reason\n }${body.parameter != null ? ` in ${body.parameter}` : ''\n // TODO: revising after improving documentation https://github.com/aeternity/aesophia_http/issues/78\n }${body.info != null ? ` (${JSON.stringify(body.info)})` : ''}`;\n }\n if (Array.isArray(body)) {\n message += `\\n${body\n .map((e) => `${e.type}:${e.pos.line}:${e.pos.col}: ${e.message}${e.context != null ? `(${e.context})` : ''}`)\n .map((e) => e.trim()) // TODO: remove after fixing https://github.com/aeternity/aesophia_http/issues/80\n .join('\\n')}`;\n }\n return message;\n }),\n ],\n });\n if (ignoreVersion !== true) {\n const versionPromise = this.aPIVersion().then(({ apiVersion }) => apiVersion);\n this.pipeline.addPolicy(\n genVersionCheckPolicy('compiler', '/api-version', versionPromise, '6.1.0', '7.0.0'),\n );\n }\n }\n}\n","import * as chainMethods from './chain';\nimport * as txMethods from './tx';\nimport * as aensMethods from './aens';\nimport * as spendMethods from './spend';\nimport * as oracleMethods from './oracle';\nimport * as contractMethods from './contract/methods';\nimport * as contractGaMethods from './contract/ga';\nimport * as deprecatedMethods from './deprecated/methods';\nimport { _buildTx } from './tx';\nimport { mapObject } from './utils/other';\nimport Node, { getNetworkId } from './Node';\nimport { AE_AMOUNT_FORMATS } from './utils/amount-formatter';\nimport { AMOUNT } from './tx/builder/schema';\nimport { Tag } from './tx/builder/constants';\nimport MemoryAccount, { Keypair } from './account/Memory';\nimport AccountBase, { isAccountBase } from './account/Base';\nimport {\n CompilerError,\n DuplicateNodeError,\n NodeNotFoundError,\n NotImplementedError,\n TypeError,\n} from './utils/errors';\nimport { Encoded } from './utils/encoder';\nimport Compiler from './contract/Compiler';\n\nexport type Account = Keypair | AccountBase | any;\n\ntype NodeInfo = Awaited<ReturnType<Node['getNodeInfo']>> & { name: string };\n\nfunction getValueOrErrorProxy<Value extends object>(valueCb: () => Value): Value {\n try {\n return valueCb();\n } catch (error) {\n return new Proxy(\n {},\n Object.fromEntries(['get', 'set', 'has'].map((name) => [name, () => { throw error; }])),\n ) as Value;\n }\n}\n\n/**\n * Basic AeSdk class\n *\n * AeSdkBase objects are the composition of:\n * - chain methods\n * - tx methods\n * - aens methods\n * - spend methods\n * - oracle methods\n * - contract methods\n * - contract ga methods\n * Only by providing the joint functionality of them, most more advanced\n * operations, i.e. the ones with actual use value on the chain, become\n * available.\n */\nclass AeSdkBase {\n _options: {\n denomination: AE_AMOUNT_FORMATS;\n amount: number;\n [key: string]: any;\n } = { denomination: AE_AMOUNT_FORMATS.AETTOS, amount: AMOUNT };\n\n pool: Map<string, Node> = new Map();\n\n selectedNodeName?: string;\n\n compilerApi: Compiler;\n\n /**\n * @param options - Options\n * @param options.nodes - Array of nodes\n * @param options.compilerUrl - Url for compiler API\n * @param options.ignoreVersion - Don't check node or compiler version\n */\n constructor(\n {\n nodes = [], compilerUrl, ignoreVersion = false, ...options\n }:\n {\n nodes?: Array<{ name: string; instance: Node }>;\n compilerUrl?: string;\n ignoreVersion?: boolean;\n [key: string]: any; // TODO: consider combining all possible options instead\n } = {},\n ) {\n Object.assign(this._options, options);\n\n nodes.forEach(({ name, instance }, i) => this.addNode(name, instance, i === 0));\n\n if (compilerUrl == null) {\n this.compilerApi = getValueOrErrorProxy(() => {\n throw new CompilerError('You can\\'t use Compiler API. Compiler is not ready!');\n });\n } else this.setCompilerUrl(compilerUrl, { ignoreVersion });\n }\n\n setCompilerUrl(\n compilerUrl: string,\n { ignoreVersion = false }: { ignoreVersion?: boolean } = {},\n ): void {\n this.compilerApi = new Compiler(compilerUrl, { ignoreVersion });\n }\n\n get api(): Node {\n this.ensureNodeConnected();\n return this.pool.get(this.selectedNodeName) as Node;\n }\n\n /**\n * Add Node\n * @param name - Node name\n * @param node - Node instance\n * @param select - Select this node as current\n * @example\n * ```js\n * // add and select new node with name 'testNode'\n * aeSdkBase.addNode('testNode', new Node({ url }), true)\n * ```\n */\n addNode(name: string, node: Node, select = false): void {\n if (this.pool.has(name)) throw new DuplicateNodeError(name);\n\n this.pool.set(name, node);\n if (select || this.selectedNodeName == null) {\n this.selectNode(name);\n }\n }\n\n /**\n * Select Node\n * @param name - Node name\n * @example\n * nodePool.selectNode('testNode')\n */\n selectNode(name: string): void {\n if (!this.pool.has(name)) throw new NodeNotFoundError(`Node with name ${name} not in pool`);\n this.selectedNodeName = name;\n }\n\n /**\n * Get NetworkId of current Node\n * @example\n * nodePool.getNetworkId()\n */\n readonly getNetworkId = getNetworkId;\n\n /**\n * Check if you have selected node\n * @example\n * nodePool.isNodeConnected()\n */\n isNodeConnected(): this is AeSdkBase & { selectedNodeName: string } {\n return this.selectedNodeName != null;\n }\n\n protected ensureNodeConnected(): asserts this is AeSdkBase & { selectedNodeName: string } {\n if (!this.isNodeConnected()) {\n throw new NodeNotFoundError('You can\\'t use Node API. Node is not connected or not defined!');\n }\n }\n\n /**\n * Get information about node\n * @example\n * ```js\n * nodePool.getNodeInfo() // { name, version, networkId, protocol, ... }\n * ```\n */\n async getNodeInfo(): Promise<NodeInfo> {\n this.ensureNodeConnected();\n return {\n name: this.selectedNodeName,\n ...await this.api.getNodeInfo(),\n };\n }\n\n /**\n * Get array of available nodes\n * @example\n * nodePool.getNodesInPool()\n */\n async getNodesInPool(): Promise<NodeInfo[]> {\n return Promise.all(\n Array.from(this.pool.entries()).map(async ([name, node]) => ({\n name,\n ...await node.getNodeInfo(),\n })),\n );\n }\n\n // eslint-disable-next-line class-methods-use-this\n addresses(): Encoded.AccountAddress[] {\n return [];\n }\n\n async address({ onAccount }: { onAccount?: Account } = {}): Promise<Encoded.AccountAddress> {\n return this._resolveAccount(onAccount).address();\n }\n\n async sign(\n data: string | Uint8Array,\n { onAccount, ...options }: { onAccount?: Account } = {},\n ): Promise<Uint8Array> {\n return this._resolveAccount(onAccount).sign(data, options);\n }\n\n async signTransaction(\n tx: Encoded.Transaction,\n { onAccount, ...options }: { onAccount?: Account } & Parameters<AccountBase['signTransaction']>[1] = {},\n ): Promise<Encoded.Transaction> {\n return this._resolveAccount(onAccount)\n .signTransaction(tx, { ...options, networkId: await this.getNetworkId(options) });\n }\n\n async signMessage(\n message: string,\n { onAccount, ...options }: { onAccount?: Account } & Parameters<AccountBase['signMessage']>[1] = {},\n ): Promise<string | Uint8Array> {\n return this._resolveAccount(onAccount).signMessage(message, options);\n }\n\n async verifyMessage(\n message: string,\n signature: string | Uint8Array,\n { onAccount, ...options }: { onAccount?: Account } & Parameters<AccountBase['verifyMessage']>[2] = {},\n ): Promise<boolean> {\n return this._resolveAccount(onAccount).verifyMessage(message, signature, options);\n }\n\n /**\n * Resolves an account\n * @param account - ak-address, instance of AccountBase, or keypair\n */\n // eslint-disable-next-line class-methods-use-this\n _resolveAccount(account?: Account): AccountBase {\n switch (account !== null && typeof account) {\n case 'string':\n throw new NotImplementedError('Address in AccountResolver');\n case 'object':\n return isAccountBase(account) ? account : new MemoryAccount({ keypair: account });\n default:\n throw new TypeError(\n 'Account should be an address (ak-prefixed string), '\n + `keypair, or instance of AccountBase, got ${String(account)} instead`,\n );\n }\n }\n\n _getOptions(): {\n onNode: Node;\n onAccount: AccountBase;\n onCompiler: Compiler;\n } {\n return {\n ...this._options,\n onNode: getValueOrErrorProxy(() => this.api),\n onAccount: getValueOrErrorProxy(() => this._resolveAccount()),\n onCompiler: getValueOrErrorProxy(() => this.compilerApi),\n };\n }\n\n async buildTx<TxType extends Tag>(\n txType: TxType,\n options: Omit<Parameters<typeof _buildTx<TxType>>[1], 'onNode'> & { onNode?: Node },\n ): Promise<Encoded.Transaction> {\n // @ts-expect-error TODO: need to figure out what's wrong here\n return _buildTx<TxType>(txType, {\n ...this._getOptions(),\n ...options,\n });\n }\n}\n\nconst { _buildTx: _, ...txMethodsOther } = txMethods;\nconst { InvalidTxError: _2, ...chainMethodsOther } = chainMethods;\n\nconst methods = {\n ...chainMethodsOther,\n ...txMethodsOther,\n ...aensMethods,\n ...spendMethods,\n ...oracleMethods,\n ...contractMethods,\n ...contractGaMethods,\n ...deprecatedMethods,\n} as const;\n\ntype RequiredKeys<T> = {\n [K in keyof T]-?: {} extends Pick<T, K> ? never : K\n}[keyof T];\n\ntype OptionalIfNotRequired<T extends [any]> = RequiredKeys<T[0]> extends never ? T | [] : T;\n\ntype MakeOptional<Args extends any[]> = Args extends [infer Head, ...infer Tail]\n ? Tail extends []\n ? Head extends object\n ? OptionalIfNotRequired<[Omit<Head, 'onNode' | 'onCompiler' | 'onAccount'>\n & {\n onNode?: Node;\n onCompiler?: Compiler;\n onAccount?: AccountBase | Encoded.AccountAddress | Keypair;\n }]>\n : [Head]\n : [Head, ...MakeOptional<Tail>]\n : never;\n\ntype TransformMethods <Methods extends { [key: string]: Function }> =\n {\n [Name in keyof Methods]:\n Methods[Name] extends (...args: infer Args) => infer Ret\n ? (...args: MakeOptional<Args>) => Ret\n : never\n };\n\ninterface AeSdkBaseMethods extends TransformMethods<typeof methods> {}\n\nObject.assign(AeSdkBase.prototype, mapObject<Function, Function>(\n methods,\n ([name, handler]) => [\n name,\n function methodWrapper(...args: any[]) {\n const instanceOptions = this._getOptions();\n const lastArg = args[args.length - 1];\n if (lastArg != null && typeof lastArg === 'object' && lastArg.constructor === Object) {\n args[args.length - 1] = {\n ...instanceOptions,\n ...lastArg,\n ...lastArg.onAccount != null && { onAccount: this._resolveAccount(lastArg.onAccount) },\n };\n } else args.push(instanceOptions);\n return handler(...args);\n },\n ],\n));\n\nexport default AeSdkBase as new (options?: ConstructorParameters<typeof AeSdkBase>[0]) =>\nAeSdkBase & AeSdkBaseMethods;\n","import AeSdkBase, { Account } from './AeSdkBase';\nimport AccountBase from './account/Base';\nimport { decode, Encoded } from './utils/encoder';\nimport { UnavailableAccountError } from './utils/errors';\n\nexport default class AeSdk extends AeSdkBase {\n accounts: { [key: Encoded.AccountAddress]: AccountBase } = {};\n\n selectedAddress?: Encoded.AccountAddress;\n\n _resolveAccount(\n account: Account | Encoded.AccountAddress = this.selectedAddress,\n ): AccountBase {\n if (typeof account === 'string') {\n const address = account as Encoded.AccountAddress;\n decode(address);\n if (this.accounts[address] == null) throw new UnavailableAccountError(account);\n account = this.accounts[address];\n }\n return super._resolveAccount(account);\n }\n\n /**\n * Get accounts addresses\n * @example addresses()\n */\n addresses(): Encoded.AccountAddress[] {\n return Object.keys(this.accounts) as Encoded.AccountAddress[];\n }\n\n /**\n * Add specific account\n * @param account - Account instance\n * @param options - Options\n * @param options.select - Select account\n * @example addAccount(account)\n */\n async addAccount(account: AccountBase, { select }: { select?: boolean } = {}): Promise<void> {\n const address = await account.address();\n this.accounts[address] = account;\n if (select === true) this.selectAccount(address);\n }\n\n /**\n * Remove specific account\n * @param address - Address of account to remove\n * @example removeAccount(address)\n */\n removeAccount(address: Encoded.AccountAddress): void {\n if (this.accounts[address] == null) {\n console.warn(`removeAccount: Account for ${address} not available`);\n return;\n }\n delete this.accounts[address]; // eslint-disable-line @typescript-eslint/no-dynamic-delete\n if (this.selectedAddress === address) delete this.selectedAddress;\n }\n\n /**\n * Select specific account\n * @param address - Address of account to select\n * @example selectAccount('ak_xxxxxxxx')\n */\n selectAccount(address: Encoded.AccountAddress): void {\n decode(address);\n if (this.accounts[address] == null) throw new UnavailableAccountError(address);\n this.selectedAddress = address;\n }\n}\n","// eslint-disable-next-line max-classes-per-file\nimport { Encoded } from '../utils/encoder';\nimport { BaseError, InternalError } from '../utils/errors';\n\n/**\n * @category aepp wallet communication\n */\nexport const enum MESSAGE_DIRECTION {\n to_waellet = 'to_waellet',\n to_aepp = 'to_aepp',\n}\n\n/**\n * @category aepp wallet communication\n */\nexport const enum WALLET_TYPE {\n window = 'window',\n extension = 'extension',\n}\n\n/**\n * @category aepp wallet communication\n */\nexport const enum SUBSCRIPTION_TYPES {\n subscribe = 'subscribe',\n unsubscribe = 'unsubscribe',\n}\n\n/**\n * @category aepp wallet communication\n */\nexport const enum METHODS {\n readyToConnect = 'connection.announcePresence',\n updateAddress = 'address.update',\n address = 'address.get',\n connect = 'connection.open',\n sign = 'transaction.sign',\n signMessage = 'message.sign',\n subscribeAddress = 'address.subscribe',\n updateNetwork = 'networkId.update',\n closeConnection = 'connection.close',\n}\n\n/**\n * @category aepp wallet communication\n */\nexport const enum RPC_STATUS {\n CONNECTED = 'CONNECTED',\n DISCONNECTED = 'DISCONNECTED',\n WAITING_FOR_CONNECTION_REQUEST = 'WAITING_FOR_CONNECTION_REQUEST',\n}\n\ninterface RpcErrorAsJson {\n code: number;\n message: string;\n data?: any;\n}\n\nconst rpcErrors: Array<(new (data?: any) => RpcError) & { code: number }> = [];\n\n/**\n * @category exception\n */\nexport abstract class RpcError extends BaseError {\n static code: number;\n\n code: number;\n\n data?: any;\n\n toJSON(): RpcErrorAsJson {\n return {\n code: this.code,\n message: this.message,\n data: this.data,\n };\n }\n\n static deserialize(json: RpcErrorAsJson): RpcError {\n const RpcErr = rpcErrors.find((cl) => cl.code === json.code);\n if (RpcErr == null) throw new InternalError(`Can't find RpcError with code: ${json.code}`);\n return new RpcErr(json.data);\n }\n}\n\n/**\n * @category exception\n */\nexport class RpcInvalidTransactionError extends RpcError {\n static code = 2;\n\n code = 2;\n\n constructor(data?: any) {\n super('Invalid transaction');\n this.data = data;\n this.name = 'RpcInvalidTransactionError';\n }\n}\nrpcErrors.push(RpcInvalidTransactionError);\n\n/**\n * @category exception\n */\nexport class RpcBroadcastError extends RpcError {\n static code = 3;\n\n code = 3;\n\n constructor(data?: any) {\n super('Broadcast failed');\n this.data = data;\n this.name = 'RpcBroadcastError';\n }\n}\nrpcErrors.push(RpcBroadcastError);\n\n/**\n * @category exception\n */\nexport class RpcRejectedByUserError extends RpcError {\n static code = 4;\n\n code = 4;\n\n constructor(data?: any) {\n super('Operation rejected by user');\n this.data = data;\n this.name = 'RpcRejectedByUserError';\n }\n}\nrpcErrors.push(RpcRejectedByUserError);\n\n/**\n * @category exception\n */\nexport class RpcUnsupportedProtocolError extends RpcError {\n static code = 5;\n\n code = 5;\n\n constructor() {\n super('Unsupported Protocol Version');\n this.name = 'RpcUnsupportedProtocolError';\n }\n}\nrpcErrors.push(RpcUnsupportedProtocolError);\n\n/**\n * @category exception\n */\nexport class RpcConnectionDenyError extends RpcError {\n static code = 9;\n\n code = 9;\n\n constructor(data?: any) {\n super('Wallet deny your connection request');\n this.data = data;\n this.name = 'RpcConnectionDenyError';\n }\n}\nrpcErrors.push(RpcConnectionDenyError);\n\n/**\n * @category exception\n */\nexport class RpcNotAuthorizeError extends RpcError {\n static code = 10;\n\n code = 10;\n\n constructor() {\n super('You are not connected to the wallet');\n this.name = 'RpcNotAuthorizeError';\n }\n}\nrpcErrors.push(RpcNotAuthorizeError);\n\n/**\n * @category exception\n */\nexport class RpcPermissionDenyError extends RpcError {\n static code = 11;\n\n code = 11;\n\n constructor(address: Encoded.AccountAddress) {\n super(`You are not subscribed for account ${address}`);\n this.data = address;\n this.name = 'RpcPermissionDenyError';\n }\n}\nrpcErrors.push(RpcPermissionDenyError);\n\n/**\n * @category exception\n */\nexport class RpcInternalError extends RpcError {\n static code = 12;\n\n code = 12;\n\n constructor() {\n super('The peer failed to execute your request due to unknown error');\n this.name = 'RpcInternalError';\n }\n}\nrpcErrors.push(RpcInternalError);\n\n/**\n * @category exception\n */\nexport class RpcMethodNotFoundError extends RpcError {\n static code = -32601;\n\n code = -32601;\n\n constructor() {\n super('Method not found');\n this.name = 'RpcMethodNotFoundError';\n }\n}\nrpcErrors.push(RpcMethodNotFoundError);\n","import AccountBase from './Base';\nimport { METHODS } from '../aepp-wallet-communication/schema';\nimport { NotImplementedError } from '../utils/errors';\nimport { Encoded } from '../utils/encoder';\n\n/**\n * Account provided by wallet\n * @param params - Params\n * @param params.rpcClient - RpcClient instance\n * @param params.address - RPC account address\n * @returns AccountRpc instance\n */\nexport default class AccountRpc extends AccountBase {\n _rpcClient: any;\n\n _address: Encoded.AccountAddress;\n\n constructor(\n { rpcClient, address, ...options }: { rpcClient: any; address: Encoded.AccountAddress }\n & ConstructorParameters<typeof AccountBase>[0],\n ) {\n super(options);\n this._rpcClient = rpcClient;\n this._address = address;\n }\n\n // eslint-disable-next-line class-methods-use-this\n async sign(): Promise<Uint8Array> {\n throw new NotImplementedError('RAW signing using wallet');\n }\n\n async address(): Promise<Encoded.AccountAddress> {\n return this._address;\n }\n\n /**\n * @returns Signed transaction\n */\n async signTransaction(\n tx: Encoded.Transaction,\n { innerTx, networkId }: Parameters<AccountBase['signTransaction']>[1] = {},\n ): Promise<Encoded.Transaction> {\n if (innerTx != null) throw new NotImplementedError('innerTx option in AccountRpc');\n const res = await this._rpcClient.request(METHODS.sign, {\n onAccount: this._address,\n tx,\n returnSigned: true,\n /**\n * @deprecated Wallet provided networkId will be used (current network)\n * required to maintain backward compatibility with wallets using SDK v11.0.1 and below\n * @see {@link https://github.com/aeternity/aepp-sdk-js/commit/153fd89a52c4eab39fcd659b356b36d32129c1ba}\n */\n networkId,\n });\n return res.signedTransaction;\n }\n\n /**\n * @returns Signed message\n */\n async signMessage(\n message: string,\n { returnHex = false }: Parameters<AccountBase['signMessage']>[1] = {},\n ): Promise<string | Uint8Array> {\n const { signature } = await this._rpcClient\n .request(METHODS.signMessage, { onAccount: this._address, message });\n return returnHex ? signature : Buffer.from(signature, 'hex');\n }\n}\n","export default function _classExtractFieldDescriptor(receiver, privateMap, action) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to \" + action + \" private field on non-instance\");\n }\n\n return privateMap.get(receiver);\n}","import classApplyDescriptorGet from \"./classApplyDescriptorGet.js\";\nimport classExtractFieldDescriptor from \"./classExtractFieldDescriptor.js\";\nexport default function _classPrivateFieldGet(receiver, privateMap) {\n var descriptor = classExtractFieldDescriptor(receiver, privateMap, \"get\");\n return classApplyDescriptorGet(receiver, descriptor);\n}","export default function _classApplyDescriptorGet(receiver, descriptor) {\n if (descriptor.get) {\n return descriptor.get.call(receiver);\n }\n\n return descriptor.value;\n}","import classApplyDescriptorSet from \"./classApplyDescriptorSet.js\";\nimport classExtractFieldDescriptor from \"./classExtractFieldDescriptor.js\";\nexport default function _classPrivateFieldSet(receiver, privateMap, value) {\n var descriptor = classExtractFieldDescriptor(receiver, privateMap, \"set\");\n classApplyDescriptorSet(receiver, descriptor, value);\n return value;\n}","export default function _classApplyDescriptorSet(receiver, descriptor, value) {\n if (descriptor.set) {\n descriptor.set.call(receiver, value);\n } else {\n if (!descriptor.writable) {\n throw new TypeError(\"attempted to set read only private field\");\n }\n\n descriptor.value = value;\n }\n}","import { RpcError, RpcInternalError, RpcMethodNotFoundError } from '../schema';\nimport BrowserConnection from '../connection/Browser';\nimport { InvalidRpcMessageError, MissingCallbackError } from '../../utils/errors';\n\ninterface JsonRpcRequest {\n jsonrpc: '2.0';\n id: number;\n method: string;\n params?: any;\n}\n\ninterface JsonRpcResponse {\n jsonrpc: '2.0';\n id: number;\n method: string;\n result?: any;\n error?: {\n code: number;\n message: string;\n data?: any;\n };\n}\n\ntype RpcApiHandler = (p?: any) => any | undefined;\ntype RpcApi<Api> = { [k in keyof Api]: RpcApiHandler };\ntype WithOrigin<Api extends RpcApi<Api>> = {\n [k in keyof Api]: (p: Parameters<Api[k]>[0], origin: string) => ReturnType<Api[k]>\n};\n\n/**\n * Contain functionality for using RPC conection\n * @category aepp wallet communication\n * @param connection - Connection object\n * @param onDisconnect - Disconnect callback\n * @param methods - Object containing handlers for each request by name\n */\nexport default class RpcClient <\n RemoteApi extends RpcApi<RemoteApi>, LocalApi extends RpcApi<LocalApi>,\n> {\n connection: BrowserConnection;\n\n #callbacks = new Map<number, { resolve: (v: any) => void; reject: (e: Error) => void }>();\n\n #messageId = 0;\n\n #methods: WithOrigin<LocalApi>;\n\n constructor(\n connection: BrowserConnection,\n onDisconnect: () => void,\n methods: WithOrigin<LocalApi>,\n ) {\n this.connection = connection;\n this.#methods = methods;\n connection.connect(this.#handleMessage.bind(this), onDisconnect);\n }\n\n async #handleMessage(msg: JsonRpcRequest | JsonRpcResponse, origin: string): Promise<void> {\n if (msg?.jsonrpc !== '2.0') throw new InvalidRpcMessageError(JSON.stringify(msg));\n if ('result' in msg || 'error' in msg) {\n this.#processResponse(msg);\n return;\n }\n\n const request = msg as JsonRpcRequest;\n let result; let\n error;\n try {\n if (!(request.method in this.#methods)) throw new RpcMethodNotFoundError();\n const methodName = request.method as keyof LocalApi;\n result = await this.#methods[methodName](request.params, origin);\n } catch (e) {\n error = e instanceof RpcError ? e : new RpcInternalError();\n }\n if (request.id != null) {\n this.#sendResponse(request.id, request.method as keyof LocalApi, result, error);\n }\n }\n\n #sendRequest(\n id: number | undefined,\n method: keyof RemoteApi | keyof LocalApi,\n params?: any,\n ): void {\n this.connection.sendMessage({\n jsonrpc: '2.0',\n ...id != null ? { id } : {},\n method,\n ...params != null ? { params } : {},\n });\n }\n\n #sendResponse(\n id: number,\n method: keyof RemoteApi | keyof LocalApi, // TODO: remove as far it is not required in JSON RPC\n result?: any,\n error?: any,\n ): void {\n this.connection.sendMessage({\n jsonrpc: '2.0',\n id,\n method,\n ...error != null ? { error } : { result },\n });\n }\n\n /**\n * Make a request\n * @param name - Method name\n * @param params - Method params\n * @returns Promise which will be resolved after receiving response message\n */\n async request<Name extends keyof RemoteApi>(\n name: Name,\n params: Parameters<RemoteApi[Name]>[0],\n ): Promise<ReturnType<RemoteApi[Name]>> {\n this.#sendRequest(this.#messageId += 1, name, params);\n return new Promise((resolve, reject) => {\n this.#callbacks.set(this.#messageId, { resolve, reject });\n });\n }\n\n /**\n * Make a notification\n * @param name - Method name\n * @param params - Method params\n */\n notify<Name extends keyof RemoteApi>(name: Name, params: Parameters<RemoteApi[Name]>[0]): void {\n this.#sendRequest(undefined, name, params);\n }\n\n /**\n * Process response message\n * @param msg - Message object\n */\n #processResponse({ id, error, result }: { id: number; error?: any; result?: any }): void {\n const callbacks = this.#callbacks.get(id);\n if (callbacks == null) throw new MissingCallbackError(id);\n if (error != null) callbacks.reject(RpcError.deserialize(error));\n else callbacks.resolve(result);\n this.#callbacks.delete(id);\n }\n}\n","import AeSdkBase, { Account } from './AeSdkBase';\nimport AccountBase from './account/Base';\nimport AccountRpc from './account/Rpc';\nimport { decode, Encoded } from './utils/encoder';\nimport {\n Accounts, RPC_VERSION, WalletInfo, Network, WalletApi, AeppApi,\n} from './aepp-wallet-communication/rpc/types';\nimport RpcClient from './aepp-wallet-communication/rpc/RpcClient';\nimport { METHODS, SUBSCRIPTION_TYPES } from './aepp-wallet-communication/schema';\nimport {\n AlreadyConnectedError,\n NoWalletConnectedError,\n UnsubscribedAccountError,\n UnAuthorizedAccountError,\n RpcConnectionError,\n} from './utils/errors';\nimport Node from './Node';\nimport BrowserConnection from './aepp-wallet-communication/connection/Browser';\n\n/**\n * RPC handler for AEPP side\n * Contain functionality for wallet interaction and connect it to sdk\n * @category aepp wallet communication\n */\nexport default class AeSdkAepp extends AeSdkBase {\n name: string;\n\n onAddressChange: (a: Accounts) => void;\n\n onDisconnect: (p: any) => void;\n\n onNetworkChange: (a: Network) => void;\n\n rpcClient?: RpcClient<WalletApi, AeppApi>;\n\n _accounts?: Accounts;\n\n /**\n * @param options - Options\n * @param options.name - Aepp name\n * @param options.onAddressChange - Call-back function for update address event\n * @param options.onDisconnect - Call-back function for disconnect event\n * @param options.onNetworkChange - Call-back function for update network event\n */\n constructor({\n name,\n onAddressChange = () => {},\n onDisconnect = () => {},\n onNetworkChange = () => {},\n ...other\n }: {\n name: string;\n onAddressChange: (a: Accounts) => void;\n onDisconnect: (p: any) => void;\n onNetworkChange: (a: Network) => void;\n } & ConstructorParameters<typeof AeSdkBase>[0]) {\n super(other);\n this.onAddressChange = onAddressChange;\n this.onDisconnect = onDisconnect;\n this.onNetworkChange = onNetworkChange;\n this.name = name;\n }\n\n _resolveAccount(account: Account = this.addresses()[0]): AccountBase {\n if (typeof account === 'string') {\n const address = account as Encoded.AccountAddress;\n decode(address);\n if (!this.addresses().includes(address)) throw new UnAuthorizedAccountError(address);\n account = new AccountRpc({ rpcClient: this.rpcClient, address });\n }\n if (account == null) this._ensureAccountAccess();\n return super._resolveAccount(account);\n }\n\n addresses(): Encoded.AccountAddress[] {\n if (this._accounts == null) return [];\n const current = Object.keys(this._accounts.current)[0];\n return [\n ...current != null ? [current] : [], ...Object.keys(this._accounts.connected),\n ] as Encoded.AccountAddress[];\n }\n\n /**\n * Connect to wallet\n * @param connection - Wallet connection object\n * @param options - Options\n * @param options.connectNode - Request wallet to bind node\n * @param options.name - Node name\n * @param options.select - Select this node as current\n */\n async connectToWallet(\n connection: BrowserConnection,\n { connectNode = false, name = 'wallet-node', select = false }:\n { connectNode?: boolean; name?: string; select?: boolean } = {},\n ): Promise<WalletInfo> {\n if (this.rpcClient != null) throw new AlreadyConnectedError('You are already connected to wallet');\n let disconnectParams: any;\n const client = new RpcClient<WalletApi, AeppApi>(\n connection,\n () => {\n delete this.rpcClient;\n delete this._accounts;\n this.onDisconnect(disconnectParams);\n },\n {\n [METHODS.updateAddress]: (params) => {\n this._accounts = params;\n this.onAddressChange(params);\n },\n [METHODS.updateNetwork]: (params) => {\n const { node } = params;\n if (node != null) this.addNode(node.name, new Node(node.url), true);\n this.onNetworkChange(params);\n },\n [METHODS.closeConnection]: (params) => {\n disconnectParams = params;\n client.connection.disconnect();\n },\n [METHODS.readyToConnect]: () => {},\n },\n );\n const { node, ...walletInfo } = await client\n .request(METHODS.connect, { name: this.name, version: RPC_VERSION, connectNode });\n if (connectNode) {\n if (node == null) throw new RpcConnectionError('Missing URLs of the Node');\n this.addNode(name, new Node(node.url), select);\n }\n this.rpcClient = client;\n return walletInfo;\n }\n\n /**\n * Disconnect from wallet\n */\n disconnectWallet(): void {\n this._ensureConnected();\n this.rpcClient.notify(METHODS.closeConnection, { reason: 'bye' });\n this.rpcClient.connection.disconnect();\n }\n\n /**\n * Ask addresses from wallet\n * @returns Addresses from wallet\n */\n async askAddresses(): Promise<Encoded.AccountAddress[]> {\n this._ensureAccountAccess();\n return this.rpcClient.request(METHODS.address, undefined);\n }\n\n /**\n * Subscribe for addresses from wallet\n * @param type - Subscription type\n * @param value - Should be one of 'current' (the selected account), 'connected' (all)\n * @returns Accounts from wallet\n */\n async subscribeAddress(\n type: SUBSCRIPTION_TYPES,\n value: 'current' | 'connected',\n ): Promise<ReturnType<WalletApi[METHODS.subscribeAddress]>> {\n this._ensureConnected();\n const result = await this.rpcClient.request(METHODS.subscribeAddress, { type, value });\n this._accounts = result.address;\n return result;\n }\n\n _ensureConnected(): asserts this is AeSdkAepp & { rpcClient: NonNullable<AeSdkAepp['rpcClient']> } {\n if (this.rpcClient != null) return;\n throw new NoWalletConnectedError('You are not connected to Wallet');\n }\n\n _ensureAccountAccess(): asserts this is AeSdkAepp & { rpcClient: NonNullable<AeSdkAepp['rpcClient']> } {\n this._ensureConnected();\n if (this.addresses().length !== 0) return;\n throw new UnsubscribedAccountError();\n }\n}\n","import { send } from '../../spend';\nimport { Encoded } from '../../utils/encoder';\nimport { METHODS, SUBSCRIPTION_TYPES, WALLET_TYPE } from '../schema';\n\nexport interface WalletInfo {\n id: string;\n name: string;\n networkId: string;\n origin: string;\n type: WALLET_TYPE;\n}\n\nexport interface Accounts {\n connected: { [pub: Encoded.AccountAddress]: {} };\n current: { [pub: Encoded.AccountAddress]: {} };\n}\n\nexport interface Node {\n name: string;\n url: string;\n}\n\nexport interface Network {\n networkId: string;\n node?: Node;\n}\n\ntype Icons = Array<{ src: string; sizes?: string; type?: string; purpose?: string }>;\n\nexport const RPC_VERSION = 1;\n\nexport interface WalletApi {\n [METHODS.connect]: (\n p: { name: string; icons?: Icons; version: typeof RPC_VERSION; connectNode: boolean }\n ) => Promise<WalletInfo & { node?: Node }>;\n\n [METHODS.closeConnection]: (p: any) => void;\n\n [METHODS.subscribeAddress]: (\n p: { type: SUBSCRIPTION_TYPES; value: 'connected' | 'current' }\n ) => Promise<{ subscription: Array<'connected' | 'current'>; address: Accounts }>;\n\n [METHODS.address]: () => Promise<Encoded.AccountAddress[]>;\n\n [METHODS.sign]: ((\n p: { tx: Encoded.Transaction; onAccount: Encoded.AccountAddress; returnSigned: boolean }\n ) => Promise<{\n /**\n * @deprecated this is not a hash at all, will be removed later at the same time\n * as dropping ability to broadcast transaction by wallet\n */\n transactionHash?: Awaited<ReturnType<typeof send>>;\n signedTransaction?: Encoded.Transaction;\n }>);\n\n [METHODS.signMessage]: (\n p: { message: string; onAccount: Encoded.AccountAddress }\n ) => Promise<{ signature: string }>;\n}\n\nexport interface AeppApi {\n [METHODS.updateAddress]: (a: Accounts) => void;\n [METHODS.updateNetwork]: (a: Network) => void;\n [METHODS.readyToConnect]: (w: WalletInfo) => void;\n [METHODS.closeConnection]: (p: any) => void;\n}\n","import JsonBig from 'json-bigint';\nimport BigNumber from 'bignumber.js';\nimport { mapObject } from './other';\n\nconst jsonBig = JsonBig({ storeAsString: true });\n\nconst convertValuesToBigNumbers = (value: any): any => {\n if (typeof value === 'object' && value !== null && value.constructor === Object) {\n return mapObject(value, ([k, v]) => [k, convertValuesToBigNumbers(v)]);\n }\n if (Array.isArray(value)) {\n return value.map((item) => convertValuesToBigNumbers(item));\n }\n if (typeof value === 'string' && new BigNumber(value).toString(10) === value) {\n const bn = new BigNumber(value);\n bn.toJSON = () => bn.toString(10);\n return bn;\n }\n return value;\n};\n\nexport default {\n stringify: (...args: Parameters<typeof JsonBig['stringify']>): string => (\n jsonBig.stringify(convertValuesToBigNumbers(args[0]), ...args.slice(1))\n ),\n parse: jsonBig.parse,\n};\n","import { v4 as uuid } from '@aeternity/uuid';\nimport AeSdk from './AeSdk';\nimport { Account } from './AeSdkBase';\nimport verifyTransaction from './tx/validator';\nimport RpcClient from './aepp-wallet-communication/rpc/RpcClient';\nimport {\n METHODS, RPC_STATUS, SUBSCRIPTION_TYPES, WALLET_TYPE,\n RpcBroadcastError, RpcInvalidTransactionError,\n RpcNotAuthorizeError, RpcPermissionDenyError, RpcUnsupportedProtocolError,\n} from './aepp-wallet-communication/schema';\nimport { InternalError, UnknownRpcClientError } from './utils/errors';\nimport AccountBase from './account/Base';\nimport BrowserConnection from './aepp-wallet-communication/connection/Browser';\nimport {\n Accounts,\n AeppApi,\n Network,\n RPC_VERSION,\n WalletApi,\n WalletInfo,\n} from './aepp-wallet-communication/rpc/types';\nimport { Encoded } from './utils/encoder';\nimport jsonBig from './utils/json-big';\n\ntype RpcClientWallet = RpcClient<AeppApi, WalletApi>;\n\ntype OnConnection = (\n clientId: string, params: Omit<Parameters<WalletApi[METHODS.connect]>[0], 'version'>, origin: string\n) => void;\n\ntype OnSubscription = (\n clientId: string, params: Parameters<WalletApi[METHODS.subscribeAddress]>[0], origin: string\n) => void;\n\ntype OnSign = (\n clientId: string, params: Parameters<WalletApi[METHODS.sign]>[0], origin: string\n) => Promise<{ tx?: Encoded.Transaction; onAccount?: Account } | undefined> | Promise<void>;\n\ntype OnDisconnect = (\n clientId: string, params: Parameters<WalletApi[METHODS.closeConnection]>[0]\n) => void;\n\ntype OnAskAccounts = (\n clientId: string, params: undefined, origin: string\n) => void;\n\ntype OnMessageSign = (\n clientId: string, params: Parameters<WalletApi[METHODS.signMessage]>[0], origin: string\n) => Promise<{ onAccount?: Account } | undefined> | Promise<void>;\n\ninterface RpcClientsInfo {\n id: string;\n status: RPC_STATUS;\n connectNode: boolean;\n addressSubscription: Set<'connected' | 'current'>;\n rpc: RpcClientWallet;\n}\n\n/**\n * Contain functionality for aepp interaction and managing multiple aepps\n * @category aepp wallet communication\n */\nexport default class AeSdkWallet extends AeSdk {\n id: string;\n\n _type: WALLET_TYPE;\n\n name: string;\n\n _clients: Map<string, RpcClientsInfo>;\n\n onConnection: OnConnection;\n\n onSubscription: OnSubscription;\n\n onSign: OnSign;\n\n onDisconnect: OnDisconnect;\n\n onAskAccounts: OnAskAccounts;\n\n onMessageSign: OnMessageSign;\n\n /**\n * @param options - Options\n * @param options.name - Wallet name\n * @param options.id - Wallet id\n * @param options.type - Wallet type\n * @param options.onConnection - Call-back function for incoming AEPP connection\n * @param options.onSubscription - Call-back function for incoming AEPP account subscription\n * @param options.onSign - Call-back function for incoming AEPP sign request\n * @param options.onAskAccounts - Call-back function for incoming AEPP get address request\n * @param options.onMessageSign - Call-back function for incoming AEPP sign message request\n * @param options.onDisconnect - Call-back function for disconnect event\n */\n constructor({\n name,\n id,\n type,\n onConnection,\n onSubscription,\n onSign,\n onDisconnect,\n onAskAccounts,\n onMessageSign,\n ...options\n }: {\n id: string;\n type: WALLET_TYPE;\n name: string;\n onConnection: OnConnection;\n onSubscription: OnSubscription;\n onSign: OnSign;\n onDisconnect: OnDisconnect;\n onAskAccounts: OnAskAccounts;\n onMessageSign: OnMessageSign;\n } & ConstructorParameters<typeof AeSdk>[0]) {\n super(options);\n this.onConnection = onConnection;\n this.onSubscription = onSubscription;\n this.onSign = onSign;\n this.onDisconnect = onDisconnect;\n this.onAskAccounts = onAskAccounts;\n this.onMessageSign = onMessageSign;\n this._clients = new Map();\n this.name = name;\n this.id = id;\n this._type = type;\n }\n\n _pushAccountsToApps(): void {\n Array.from(this._clients.keys())\n .filter((clientId) => this._isRpcClientSubscribed(clientId))\n .map((clientId) => this._getClient(clientId).rpc)\n .forEach((client) => client.notify(METHODS.updateAddress, this.getAccounts()));\n }\n\n selectAccount(address: Encoded.AccountAddress): void {\n super.selectAccount(address);\n this._pushAccountsToApps();\n }\n\n async addAccount(\n account: AccountBase,\n options?: Parameters<AeSdk['addAccount']>[1],\n ): Promise<void> {\n await super.addAccount(account, options);\n this._pushAccountsToApps();\n }\n\n _getNode(): { node: Network['node'] } {\n this.ensureNodeConnected();\n return { node: { url: this.api.url, name: this.selectedNodeName } };\n }\n\n async selectNode(name: string): Promise<void> {\n super.selectNode(name);\n const networkId = await this.getNetworkId();\n Array.from(this._clients.keys())\n .filter((clientId) => this._isRpcClientConnected(clientId))\n .map((clientId) => this._getClient(clientId))\n .forEach((client) => {\n client.rpc.notify(METHODS.updateNetwork, {\n networkId,\n ...client.connectNode && this._getNode(),\n });\n });\n }\n\n _getClient(clientId: string): RpcClientsInfo {\n const client = this._clients.get(clientId);\n if (client == null) throw new UnknownRpcClientError(clientId);\n return client;\n }\n\n _isRpcClientSubscribed(clientId: string): boolean {\n return this._isRpcClientConnected(clientId)\n && this._getClient(clientId).addressSubscription.size !== 0;\n }\n\n _isRpcClientConnected(clientId: string): boolean {\n return RPC_STATUS.CONNECTED === this._getClient(clientId).status\n && this._getClient(clientId).rpc.connection.isConnected();\n }\n\n _disconnectRpcClient(clientId: string): void {\n const client = this._getClient(clientId);\n client.rpc.connection.disconnect();\n client.status = RPC_STATUS.DISCONNECTED;\n client.addressSubscription = new Set();\n }\n\n /**\n * Remove specific RpcClient by ID\n * @param id - Client ID\n */\n removeRpcClient(id: string): void {\n this._disconnectRpcClient(id);\n this._clients.delete(id);\n }\n\n /**\n * Add new client by AEPP connection\n * @param clientConnection - AEPP connection object\n * @returns Client ID\n */\n addRpcClient(clientConnection: BrowserConnection): string {\n // @TODO detect if aepp has some history based on origin????\n // if yes use this instance for connection\n const id = uuid();\n let disconnectParams: any;\n const client: RpcClientsInfo = {\n id,\n status: RPC_STATUS.WAITING_FOR_CONNECTION_REQUEST,\n addressSubscription: new Set(),\n connectNode: false,\n rpc: new RpcClient<AeppApi, WalletApi>(\n clientConnection,\n () => {\n this._clients.delete(id);\n this.onDisconnect(id, disconnectParams); // also related info\n },\n {\n [METHODS.closeConnection]: (params) => {\n disconnectParams = params;\n this._disconnectRpcClient(id);\n },\n // Store client info and prepare two fn for each client `connect` and `denyConnection`\n // which automatically prepare and send response for that client\n [METHODS.connect]: async ({\n name, version, icons, connectNode,\n }, origin) => {\n if (version !== RPC_VERSION) throw new RpcUnsupportedProtocolError();\n\n await this.onConnection(id, { name, icons, connectNode }, origin);\n client.status = RPC_STATUS.CONNECTED;\n client.connectNode = connectNode;\n return {\n ...await this.getWalletInfo(),\n ...connectNode && this._getNode(),\n };\n },\n [METHODS.subscribeAddress]: async ({ type, value }, origin) => {\n if (!this._isRpcClientConnected(id)) throw new RpcNotAuthorizeError();\n\n await this.onSubscription(id, { type, value }, origin);\n\n switch (type) {\n case SUBSCRIPTION_TYPES.subscribe:\n client.addressSubscription.add(value);\n break;\n case SUBSCRIPTION_TYPES.unsubscribe:\n client.addressSubscription.delete(value);\n break;\n default:\n throw new InternalError(`Unknown subscription type: ${type}`);\n }\n\n return {\n subscription: Array.from(client.addressSubscription),\n address: this.getAccounts(),\n };\n },\n [METHODS.address]: async (params, origin) => {\n if (!this._isRpcClientSubscribed(id)) throw new RpcNotAuthorizeError();\n await this.onAskAccounts(id, params, origin);\n return this.addresses();\n },\n [METHODS.sign]: async ({ tx, onAccount, returnSigned }, origin) => {\n if (!this._isRpcClientConnected(id)) throw new RpcNotAuthorizeError();\n onAccount ??= await this.address();\n if (!this.addresses().includes(onAccount)) {\n throw new RpcPermissionDenyError(onAccount);\n }\n\n const overrides = await this.onSign(id, { tx, returnSigned, onAccount }, origin);\n onAccount = overrides?.onAccount ?? onAccount;\n tx = overrides?.tx ?? tx;\n if (returnSigned) {\n return { signedTransaction: await this.signTransaction(tx, { onAccount }) };\n }\n try {\n return jsonBig.parse(jsonBig.stringify({\n transactionHash: await this.send(tx, { onAccount, verify: false }),\n }));\n } catch (error) {\n const validation = await verifyTransaction(tx, this.api);\n if (validation.length > 0) throw new RpcInvalidTransactionError(validation);\n throw new RpcBroadcastError(error.message);\n }\n },\n [METHODS.signMessage]: async ({ message, onAccount }, origin) => {\n if (!this._isRpcClientConnected(id)) throw new RpcNotAuthorizeError();\n onAccount ??= await this.address();\n if (!this.addresses().includes(onAccount)) {\n throw new RpcPermissionDenyError(onAccount);\n }\n\n const overrides = await this.onMessageSign(id, { message, onAccount }, origin);\n onAccount = overrides?.onAccount ?? onAccount;\n return {\n // TODO: fix signMessage return type\n signature: await this.signMessage(message, { onAccount, returnHex: true }) as\n unknown as string,\n };\n },\n },\n ),\n };\n this._clients.set(id, client);\n return id;\n }\n\n /**\n * Send shareWalletInfo message to notify AEPP about wallet\n * @param clientId - ID of RPC client send message to\n */\n async shareWalletInfo(clientId: string): Promise<void> {\n this._getClient(clientId).rpc.notify(METHODS.readyToConnect, await this.getWalletInfo());\n }\n\n /**\n * Get Wallet info object\n * @returns Object with wallet information\n */\n async getWalletInfo(): Promise<WalletInfo> {\n return {\n id: this.id,\n name: this.name,\n networkId: await this.getNetworkId(),\n origin: window.location.origin,\n type: this._type,\n };\n }\n\n /**\n * Get Wallet accounts\n * @returns Object with accounts information (\\{ connected: Object, current: Object \\})\n */\n getAccounts(): Accounts {\n return {\n current: this.selectedAddress != null ? { [this.selectedAddress]: {} } : {},\n connected: this.addresses()\n .filter((a) => a !== this.selectedAddress)\n .reduce((acc, a) => ({ ...acc, [a]: {} }), {}),\n };\n }\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2018 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\nimport { w3cwebsocket as W3CWebSocket } from 'websocket';\nimport { EventEmitter } from 'events';\nimport BigNumber from 'bignumber.js';\nimport type Channel from '.';\nimport JsonBig from '../utils/json-big';\nimport { pascalToSnake } from '../utils/string';\nimport { Encoded } from '../utils/encoder';\nimport {\n BaseError, ChannelCallError, ChannelPingTimedOutError, UnknownChannelStateError,\n} from '../utils/errors';\n\ninterface ChannelAction {\n guard: (channel: Channel, state?: ChannelFsm) => boolean;\n action: (channel: Channel, state?: ChannelFsm) => ChannelFsm;\n}\n\nexport type SignTxWithTag = (tag: string, tx: Encoded.Transaction, options?: object) => (\n Promise<Encoded.Transaction>\n);\n// TODO: SignTx shouldn't return number or null\nexport type SignTx = (tx: Encoded.Transaction, options?: object) => (\n Promise<Encoded.Transaction | number | null>\n);\n\nexport interface ChannelOptions {\n existingFsmId?: string;\n url: string;\n role: 'initiator' | 'responder';\n initiatorId: Encoded.AccountAddress;\n responderId: Encoded.AccountAddress;\n pushAmount: number;\n initiatorAmount: BigNumber;\n responderAmount: BigNumber;\n channelReserve?: BigNumber | number;\n signedTx?: string;\n ttl?: number;\n host: string;\n port: number;\n lockPeriod: number;\n existingChannelId?: string;\n offChainTx?: string;\n reconnectTx?: string;\n timeoutIdle?: number;\n timeoutFundingCreate?: number;\n timeoutFundingSign?: number;\n timeoutFundingLock?: number;\n timeoutSign?: number;\n timeoutAccept?: number;\n timeoutInitialized?: number;\n timeoutAwaitingOpen?: number;\n statePassword?: string;\n debug: boolean;\n sign: SignTxWithTag;\n offchainTx?: string;\n}\n\nexport interface ChannelHandler extends Function {\n enter?: Function;\n}\n\nexport interface ChannelState {\n signedTx: any;\n resolve: (r?: any) => void;\n reject: (e: BaseError) => void;\n sign: SignTx;\n handler?: ChannelHandler;\n onOnChainTx?: (tx: Encoded.Transaction) => void;\n onOwnWithdrawLocked?: () => void;\n onWithdrawLocked?: () => void;\n onOwnDepositLocked?: () => void;\n onDepositLocked?: () => void;\n closeTx?: string;\n}\n\nexport interface ChannelFsm {\n handler: ChannelHandler;\n state?: ChannelState | {\n resolve: Function;\n reject: Function;\n };\n}\n\nexport interface ChannelMessage {\n id?: number;\n jsonrpc: string;\n method: string;\n params: any;\n payload?: any;\n data?: any;\n error?: ChannelMessageError;\n}\n\ninterface ChannelMessageError {\n code: number;\n message: string;\n data: [{\n message: string;\n code: number;\n }];\n request: ChannelMessage;\n}\n\n// Send ping message every 10 seconds\nconst PING_TIMEOUT_MS = 10000;\n// Close connection if pong message is not received within 5 seconds\nconst PONG_TIMEOUT_MS = 5000;\n\n// TODO: move to Channel instance to avoid is-null checks and for easier debugging\nexport const options = new WeakMap<Channel, ChannelOptions>();\nexport const status = new WeakMap<Channel, string>();\nexport const state = new WeakMap<Channel, Encoded.Transaction>();\nconst fsm = new WeakMap<Channel, ChannelFsm>();\nconst websockets = new WeakMap<Channel, W3CWebSocket>();\nexport const eventEmitters = new WeakMap<Channel, EventEmitter>();\nconst messageQueue = new WeakMap<Channel, string[]>();\nconst messageQueueLocked = new WeakMap<Channel, boolean>();\nconst actionQueue = new WeakMap<Channel, ChannelAction[]>();\nconst actionQueueLocked = new WeakMap<Channel, boolean>();\nconst sequence = new WeakMap<Channel, number>();\nexport const channelId = new WeakMap<Channel, string>();\nconst rpcCallbacks = new WeakMap<Channel, Map<number, Function>>();\nconst pingTimeoutId = new WeakMap<Channel, NodeJS.Timeout>();\nconst pongTimeoutId = new WeakMap<Channel, NodeJS.Timeout>();\nexport const fsmId = new WeakMap<Channel, string>();\n\nexport function emit(channel: Channel, ...args: any[]): void {\n const [eventName, ...rest] = args;\n eventEmitters.get(channel)?.emit(eventName, ...rest);\n}\n\nfunction enterState(channel: Channel, nextState: ChannelFsm): void {\n if (nextState == null) {\n throw new UnknownChannelStateError();\n }\n fsm.set(channel, nextState);\n if (nextState?.handler?.enter != null) {\n nextState.handler.enter(channel);\n }\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n void dequeueAction(channel);\n}\n\nexport function changeStatus(channel: Channel, newStatus: string): void {\n const prevStatus = status.get(channel);\n if (newStatus !== prevStatus) {\n status.set(channel, newStatus);\n emit(channel, 'statusChanged', newStatus);\n }\n}\n\nexport function changeState(channel: Channel, newState: Encoded.Transaction): void {\n state.set(channel, newState);\n emit(channel, 'stateChanged', newState);\n}\n\nexport function send(channel: Channel, message: ChannelMessage): void {\n const debug: boolean = options.get(channel)?.debug ?? false;\n if (debug) console.log('Send message: ', message);\n\n websockets.get(channel)?.send(JsonBig.stringify(message));\n}\n\nasync function dequeueAction(channel: Channel): Promise<void> {\n const locked = actionQueueLocked.get(channel);\n const queue = actionQueue.get(channel) ?? [];\n if (Boolean(locked) || queue.length === 0) {\n return;\n }\n const singleFsm = fsm.get(channel);\n if (singleFsm == null) return;\n const index = queue.findIndex((action: ChannelAction) => action.guard(channel, singleFsm));\n if (index === -1) {\n return;\n }\n actionQueue.set(channel, queue.filter((_: ChannelAction, i: number) => index !== i));\n actionQueueLocked.set(channel, true);\n const nextState: ChannelFsm = await Promise.resolve(queue[index].action(channel, singleFsm));\n actionQueueLocked.set(channel, false);\n enterState(channel, nextState);\n}\n\nexport function enqueueAction(\n channel: Channel,\n guard: ChannelAction['guard'],\n action: ChannelAction['action'],\n): void {\n const queue = actionQueue.get(channel) ?? [];\n actionQueue.set(channel, [\n ...queue,\n { guard, action },\n ]);\n void dequeueAction(channel);\n}\n\nasync function handleMessage(channel: Channel, message: string): Promise<void> {\n const fsmState = fsm.get(channel);\n if (fsmState == null) throw new UnknownChannelStateError();\n const { handler, state: st } = fsmState;\n enterState(channel, await Promise.resolve(handler(channel, message, st)));\n}\n\nasync function dequeueMessage(channel: Channel): Promise<void> {\n const locked: boolean = messageQueueLocked.get(channel) ?? false;\n if (locked) return;\n const messages: string[] = messageQueue.get(channel) ?? [];\n if (messages.length === 0) return;\n messageQueueLocked.set(channel, true);\n while (messages.length > 0) {\n const message: string = messages.shift() ?? '';\n try {\n await handleMessage(channel, message);\n } catch (error) {\n console.error('Error handling incoming message:');\n console.error(message);\n console.error(error);\n }\n }\n messageQueueLocked.set(channel, false);\n}\n\nexport function disconnect(channel: Channel): void {\n websockets.get(channel)?.close();\n const pingTimeoutIdValue = pingTimeoutId.get(channel);\n const pongTimeoutIdValue = pongTimeoutId.get(channel);\n if (pingTimeoutIdValue != null) clearTimeout(pingTimeoutIdValue);\n if (pongTimeoutIdValue != null) clearTimeout(pongTimeoutIdValue);\n}\n\nfunction ping(channel: Channel): void {\n const pingTimeoutIdValue = pingTimeoutId.get(channel);\n const pongTimeoutIdValue = pongTimeoutId.get(channel);\n if (pingTimeoutIdValue != null) clearTimeout(pingTimeoutIdValue);\n if (pongTimeoutIdValue != null) clearTimeout(pongTimeoutIdValue);\n pingTimeoutId.set(channel, setTimeout(() => {\n send(channel, {\n jsonrpc: '2.0',\n method: 'channels.system',\n params: {\n action: 'ping',\n },\n });\n pongTimeoutId.set(channel, setTimeout(() => {\n disconnect(channel);\n emit(channel, 'error', new ChannelPingTimedOutError());\n }, PONG_TIMEOUT_MS));\n }, PING_TIMEOUT_MS));\n}\n\nfunction onMessage(channel: Channel, data: string): void {\n const message = JsonBig.parse(data);\n const debug: boolean = options.get(channel)?.debug ?? false;\n if (debug) console.log('Receive message: ', message);\n if (message.id != null) {\n const callback = rpcCallbacks.get(channel)?.get(message.id);\n try {\n callback?.(message);\n } finally {\n rpcCallbacks.get(channel)?.delete(message.id);\n }\n return;\n }\n if (message.method === 'channels.message') {\n emit(channel, 'message', message.params.data.message);\n return;\n }\n if (message.method === 'channels.system.pong') {\n if (\n (message.params.channel_id === channelId.get(channel))\n // Skip channelId check if channelId is not known yet\n || (channelId.get(channel) == null)\n ) {\n ping(channel);\n }\n return;\n }\n messageQueue.get(channel)?.push(message);\n void dequeueMessage(channel);\n}\n\nexport async function call(channel: Channel, method: string, params: any): Promise<any> {\n return new Promise((resolve, reject) => {\n const currentSequence: number = sequence.get(channel) ?? 0;\n const id = sequence.set(channel, currentSequence + 1).get(channel) ?? 1;\n rpcCallbacks.get(channel)?.set(\n id,\n (message: { result: PromiseLike<any>; error?: ChannelMessageError }) => {\n if (message.error != null) {\n const [{ message: details } = { message: '' }] = message.error.data ?? [];\n return reject(new ChannelCallError(message.error.message + details));\n }\n return resolve(message.result);\n },\n );\n send(channel, {\n jsonrpc: '2.0', method, id, params,\n });\n });\n}\n\nexport async function initialize(\n channel: Channel,\n connectionHandler: Function,\n openHandler: Function,\n { url, ...channelOptions }: ChannelOptions,\n): Promise<void> {\n options.set(channel, { url, ...channelOptions });\n fsm.set(channel, { handler: connectionHandler });\n eventEmitters.set(channel, new EventEmitter());\n sequence.set(channel, 0);\n rpcCallbacks.set(channel, new Map());\n messageQueue.set(channel, []);\n\n const wsUrl = new URL(url);\n Object.entries(channelOptions)\n .filter(([key]) => !['sign', 'debug'].includes(key))\n .forEach(([key, value]) => wsUrl.searchParams.set(pascalToSnake(key), value));\n wsUrl.searchParams.set('protocol', 'json-rpc');\n changeStatus(channel, 'connecting');\n const ws = new W3CWebSocket(wsUrl.toString());\n await new Promise<void>((resolve, reject) => {\n Object.assign(ws, {\n onerror: reject,\n onopen: async () => {\n resolve();\n changeStatus(channel, 'connected');\n if (channelOptions.reconnectTx != null) {\n enterState(channel, { handler: openHandler });\n const signedTx = (await call(channel, 'channels.get.offchain_state', {})).signed_tx;\n changeState(channel, signedTx);\n }\n ping(channel);\n },\n onclose: () => {\n changeStatus(channel, 'disconnected');\n const pingTimeoutIdValue = pingTimeoutId.get(channel);\n const pongTimeoutIdValue = pongTimeoutId.get(channel);\n if (pingTimeoutIdValue != null) clearTimeout(pingTimeoutIdValue);\n if (pongTimeoutIdValue != null) clearTimeout(pongTimeoutIdValue);\n },\n onmessage: ({ data }: { data: string }) => onMessage(channel, data),\n });\n });\n websockets.set(channel, ws);\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2018 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n/* eslint-disable consistent-return */\n/* eslint-disable default-case */\n/* eslint-disable @typescript-eslint/no-use-before-define */\nimport { generateKeyPair, encodeContractAddress } from '../utils/crypto';\nimport {\n ChannelState,\n options,\n changeStatus,\n changeState,\n call,\n send,\n emit,\n channelId,\n disconnect,\n fsmId,\n ChannelMessage,\n ChannelFsm,\n SignTx,\n} from './internal';\nimport { unpackTx, buildTx } from '../tx/builder';\nimport { encode, Encoded, Encoding } from '../utils/encoder';\nimport {\n IllegalArgumentError,\n InsufficientBalanceError,\n ChannelConnectionError,\n UnexpectedChannelMessageError,\n} from '../utils/errors';\nimport type Channel from '.';\nimport { Tag } from '../tx/builder/constants';\n\nexport async function appendSignature(\n tx: Encoded.Transaction,\n signFn: SignTx,\n): Promise<Encoded.Transaction | number | null> {\n const { signatures, encodedTx } = unpackTx(tx, Tag.SignedTx).tx;\n const result = await signFn(encode(encodedTx.rlpEncoded, Encoding.Transaction));\n if (typeof result === 'string') {\n const { tx: signedTx } = unpackTx(result, Tag.SignedTx);\n return buildTx({\n signatures: signatures.concat(signedTx.signatures),\n encodedTx: signedTx.encodedTx.rlpEncoded,\n }, Tag.SignedTx).tx;\n }\n return result;\n}\n\nfunction handleUnexpectedMessage(\n _channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm {\n state?.reject?.(Object.assign(\n new UnexpectedChannelMessageError(`Unexpected message received:\\n\\n${JSON.stringify(message)}`),\n { wsMessage: message },\n ));\n return { handler: channelOpen };\n}\n\nexport function awaitingConnection(\n channel: Channel,\n message: ChannelMessage,\n): ChannelFsm | undefined {\n if (message.method === 'channels.info') {\n const channelInfoStatus: string = message.params.data.event;\n if (['channel_accept', 'funding_created'].includes(channelInfoStatus)) {\n changeStatus(channel, {\n channel_accept: 'accepted',\n funding_created: 'halfSigned',\n }[channelInfoStatus as 'channel_accept' | 'funding_created']);\n return { handler: awaitingChannelCreateTx };\n }\n if (message.params.data.event === 'channel_reestablished') {\n return { handler: awaitingOpenConfirmation };\n }\n if (message.params.data.event === 'fsm_up') {\n fsmId.set(channel, message.params.data.fsm_id);\n return { handler: awaitingConnection };\n }\n return { handler: awaitingConnection };\n }\n if (message.method === 'channels.error') {\n emit(channel, 'error', new ChannelConnectionError(message?.payload?.message));\n return { handler: channelClosed };\n }\n}\n\nexport async function awaitingReconnection(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): Promise<ChannelFsm> {\n if (message.method === 'channels.info') {\n if (message.params.data.event === 'fsm_up') {\n fsmId.set(channel, message.params.data.fsm_id);\n changeState(channel, (await call(channel, 'channels.get.offchain_state', {})).signed_tx);\n return { handler: channelOpen };\n }\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport async function awaitingChannelCreateTx(\n channel: Channel,\n message: ChannelMessage,\n): Promise<ChannelFsm | undefined> {\n const channelOptions = options.get(channel);\n if (channelOptions != null) {\n const tag = {\n initiator: 'initiator_sign',\n responder: 'responder_sign',\n }[channelOptions.role];\n if (message.method === `channels.sign.${tag}`) {\n if (message.params.data.tx != null) {\n const signedTx = await channelOptions.sign(tag, message.params.data.tx);\n send(channel, { jsonrpc: '2.0', method: `channels.${tag}`, params: { tx: signedTx } });\n return { handler: awaitingOnChainTx };\n }\n const signedTx = await appendSignature(\n message.params.data.signed_tx,\n async (tx) => channelOptions.sign(tag, tx),\n );\n send(channel, { jsonrpc: '2.0', method: `channels.${tag}`, params: { signed_tx: signedTx } });\n return { handler: awaitingOnChainTx };\n }\n }\n}\n\nexport function awaitingOnChainTx(\n channel: Channel,\n message: ChannelMessage,\n): ChannelFsm | undefined {\n const channelOptions = options.get(channel);\n if (channelOptions != null) {\n if (message.method === 'channels.on_chain_tx') {\n if (\n message.params.data.info === 'funding_signed'\n && channelOptions.role === 'initiator'\n ) {\n return { handler: awaitingBlockInclusion };\n }\n if (\n message.params.data.info === 'funding_created'\n && channelOptions.role === 'responder'\n ) {\n return { handler: awaitingBlockInclusion };\n }\n }\n if (\n message.method === 'channels.info'\n && message.params.data.event === 'funding_signed'\n && channelOptions.role === 'initiator'\n ) {\n channelId.set(channel, message.params.channel_id);\n changeStatus(channel, 'signed');\n return { handler: awaitingOnChainTx };\n }\n }\n}\n\nexport function awaitingBlockInclusion(\n channel: Channel,\n message: ChannelMessage,\n): ChannelFsm | undefined {\n if (message.method === 'channels.info') {\n const handlers: {\n [key: string]: (channel: Channel, message: ChannelMessage) => ChannelFsm | undefined;\n } = {\n funding_created: awaitingBlockInclusion,\n own_funding_locked: awaitingBlockInclusion,\n funding_locked: awaitingOpenConfirmation,\n };\n const handler = handlers[message.params.data.event as string];\n if (handler != null) {\n return { handler };\n }\n }\n if (message.method === 'channels.on_chain_tx') {\n emit(channel, 'onChainTx', message.params.data.tx, {\n info: message.params.data.info,\n type: message.params.data.type,\n });\n return { handler: awaitingBlockInclusion };\n }\n}\n\nexport function awaitingOpenConfirmation(\n channel: Channel,\n message: ChannelMessage,\n): ChannelFsm | undefined {\n if (message.method === 'channels.info' && message.params.data.event === 'open') {\n channelId.set(channel, message.params.channel_id);\n return { handler: awaitingInitialState };\n }\n}\n\nexport function awaitingInitialState(\n channel: Channel,\n message: ChannelMessage,\n): ChannelFsm | undefined {\n if (message.method === 'channels.update') {\n changeState(channel, message.params.data.state);\n return { handler: channelOpen };\n }\n}\n\nexport async function channelOpen(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): Promise<ChannelFsm | undefined> {\n switch (message.method) {\n case 'channels.info':\n switch (message.params.data.event) {\n case 'update':\n case 'withdraw_created':\n case 'deposit_created':\n return { handler: awaitingTxSignRequest };\n case 'own_withdraw_locked':\n case 'withdraw_locked':\n case 'own_deposit_locked':\n case 'deposit_locked':\n case 'peer_disconnected':\n case 'channel_reestablished':\n case 'open':\n // TODO: Better handling of peer_disconnected event.\n //\n // We should enter intermediate state where offchain transactions\n // are blocked until channel is reestablished.\n emit(channel, message.params.data.event);\n return { handler: channelOpen };\n case 'fsm_up':\n fsmId.set(channel, message.params.data.fsm_id);\n return { handler: channelOpen };\n case 'timeout':\n case 'close_mutual':\n return { handler: channelOpen };\n case 'closing':\n changeStatus(channel, 'closing');\n return { handler: channelOpen };\n case 'closed_confirmed':\n changeStatus(channel, 'closed');\n return { handler: channelClosed };\n case 'died':\n changeStatus(channel, 'died');\n return { handler: channelClosed };\n case 'shutdown':\n return { handler: channelOpen };\n }\n break;\n case 'channels.on_chain_tx':\n emit(channel, 'onChainTx', message.params.data.tx, {\n info: message.params.data.info,\n type: message.params.data.type,\n });\n return { handler: channelOpen };\n case 'channels.leave':\n // TODO: emit event\n return { handler: channelOpen };\n case 'channels.update':\n changeState(channel, message.params.data.state);\n return { handler: channelOpen };\n case 'channels.sign.shutdown_sign_ack':\n return awaitingTxSignRequest(channel, message, state);\n }\n}\nchannelOpen.enter = (channel: Channel) => {\n changeStatus(channel, 'open');\n};\n\nexport async function awaitingOffChainTx(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): Promise<ChannelFsm> {\n if (message.method === 'channels.sign.update') {\n const { sign } = state;\n if (message.params.data.tx != null) {\n const signedTx = await sign(message.params.data.tx, { updates: message.params.data.updates });\n send(channel, { jsonrpc: '2.0', method: 'channels.update', params: { tx: signedTx } });\n return { handler: awaitingOffChainUpdate, state };\n }\n const signedTx = await appendSignature(\n message.params.data.signed_tx,\n async (tx) => sign(tx, { updates: message.params.data.updates }),\n );\n if (typeof signedTx === 'string') {\n send(channel, { jsonrpc: '2.0', method: 'channels.update', params: { signed_tx: signedTx } });\n return { handler: awaitingOffChainUpdate, state };\n }\n if (typeof signedTx === 'number') {\n send(channel, { jsonrpc: '2.0', method: 'channels.update', params: { error: signedTx } });\n return { handler: awaitingOffChainTx, state };\n }\n }\n if (message.method === 'channels.error') {\n state.reject(new ChannelConnectionError(message.data.message));\n return { handler: channelOpen };\n }\n if (message.error != null) {\n const { data } = message.error ?? { data: [] };\n if (data.find((i) => i.code === 1001) != null) {\n state.reject(new InsufficientBalanceError('Insufficient balance'));\n } else if (data.find((i) => i.code === 1002) != null) {\n state.reject(new IllegalArgumentError('Amount cannot be negative'));\n } else {\n state.reject(new ChannelConnectionError(message.error.message));\n }\n return { handler: channelOpen };\n }\n if (message.method === 'channels.conflict') {\n state.resolve({\n accepted: false,\n errorCode: message.params.data.error_code,\n errorMessage: message.params.data.error_msg,\n });\n return { handler: channelOpen };\n }\n if (message.method === 'channels.info') {\n if (message.params.data.event === 'aborted_update') {\n state.resolve({ accepted: false });\n return { handler: channelOpen };\n }\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport function awaitingOffChainUpdate(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm | undefined {\n if (message.method === 'channels.update') {\n changeState(channel, message.params.data.state);\n state.resolve({ accepted: true, signedTx: message.params.data.state });\n return { handler: channelOpen };\n }\n if (message.method === 'channels.conflict') {\n state.resolve({\n accepted: false,\n errorCode: message.params.data.error_code,\n errorMessage: message.params.data.error_msg,\n });\n return { handler: channelOpen };\n }\n if (message.method === 'channels.info') {\n if (message.params.data.event === 'aborted_update') {\n state.resolve({ accepted: false });\n return { handler: channelOpen };\n }\n }\n if (message.error != null) {\n state.reject(new ChannelConnectionError(message.error.message));\n return { handler: channelOpen };\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport async function awaitingTxSignRequest(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): Promise<ChannelFsm | undefined> {\n const [, tag] = message.method.match(/^channels\\.sign\\.([^.]+)$/) ?? [];\n const channelOptions = options.get(channel);\n if (tag != null && (channelOptions != null)) {\n if (message.params.data.tx != null) {\n const signedTx = await channelOptions.sign(tag, message.params.data.tx, {\n updates: message.params.data.updates,\n });\n if (signedTx != null) {\n send(channel, { jsonrpc: '2.0', method: `channels.${tag}`, params: { tx: signedTx } });\n return { handler: channelOpen };\n }\n } else {\n const signedTx = await appendSignature(\n message.params.data.signed_tx,\n async (tx) => channelOptions.sign(tag, tx, { updates: message.params.data.updates }),\n );\n if (typeof signedTx === 'string') {\n send(channel, { jsonrpc: '2.0', method: `channels.${tag}`, params: { signed_tx: signedTx } });\n return { handler: channelOpen };\n }\n if (typeof signedTx === 'number') {\n send(channel, { jsonrpc: '2.0', method: `channels.${tag}`, params: { error: signedTx } });\n return { handler: awaitingUpdateConflict, state };\n }\n }\n // soft-reject via competing update\n send(channel, {\n jsonrpc: '2.0',\n method: 'channels.update.new',\n params: {\n from: generateKeyPair().publicKey,\n to: generateKeyPair().publicKey,\n amount: 1,\n },\n });\n return { handler: awaitingUpdateConflict, state };\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport function awaitingUpdateConflict(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm {\n if (message.error != null) {\n return { handler: awaitingUpdateConflict, state };\n }\n if (message.method === 'channels.conflict') {\n return { handler: channelOpen };\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport async function awaitingShutdownTx(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): Promise<ChannelFsm | undefined> {\n if (message.method === 'channels.sign.shutdown_sign') {\n if (message.params.data.tx != null) {\n const signedTx = await state.sign(message.params.data.tx);\n send(channel, { jsonrpc: '2.0', method: 'channels.shutdown_sign', params: { tx: signedTx } });\n return { handler: awaitingShutdownOnChainTx, state };\n }\n const signedTx = await appendSignature(\n message.params.data.signed_tx,\n async (tx) => state.sign(tx),\n );\n send(channel, { jsonrpc: '2.0', method: 'channels.shutdown_sign', params: { signed_tx: signedTx } });\n return { handler: awaitingShutdownOnChainTx, state };\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport function awaitingShutdownOnChainTx(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm {\n if (message.method === 'channels.on_chain_tx') {\n // state.resolve(message.params.data.tx)\n return { handler: channelClosed, state };\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport function awaitingLeave(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm {\n if (message.method === 'channels.leave') {\n state.resolve({ channelId: message.params.channel_id, signedTx: message.params.data.state });\n disconnect(channel);\n return { handler: channelClosed };\n }\n if (message.method === 'channels.error') {\n state.reject(new ChannelConnectionError(message.data.message));\n return { handler: channelOpen };\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport async function awaitingWithdrawTx(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): Promise<ChannelFsm | undefined> {\n if (message.method === 'channels.sign.withdraw_tx') {\n const { sign } = state;\n if (message.params.data.tx != null) {\n const signedTx = await sign(message.params.data.tx, { updates: message.params.data.updates });\n send(channel, { jsonrpc: '2.0', method: 'channels.withdraw_tx', params: { tx: signedTx } });\n return { handler: awaitingWithdrawCompletion, state };\n }\n const signedTx = await appendSignature(\n message.params.data.signed_tx,\n async (tx) => sign(tx, { updates: message.params.data.updates }),\n );\n if (typeof signedTx === 'string') {\n send(channel, { jsonrpc: '2.0', method: 'channels.withdraw_tx', params: { signed_tx: signedTx } });\n return { handler: awaitingWithdrawCompletion, state };\n }\n if (typeof signedTx === 'number') {\n send(channel, { jsonrpc: '2.0', method: 'channels.withdraw_tx', params: { error: signedTx } });\n return { handler: awaitingWithdrawCompletion, state };\n }\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport function awaitingWithdrawCompletion(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm {\n if (message.method === 'channels.on_chain_tx') {\n state.onOnChainTx?.(message.params.data.tx);\n return { handler: awaitingWithdrawCompletion, state };\n }\n if (message.method === 'channels.info') {\n if (['own_withdraw_locked', 'withdraw_locked'].includes(message.params.data.event)) {\n const callbacks: {\n [key: string]: Function | undefined;\n } = {\n own_withdraw_locked: state.onOwnWithdrawLocked,\n withdraw_locked: state.onWithdrawLocked,\n };\n callbacks[message.params.data.event]?.();\n return { handler: awaitingWithdrawCompletion, state };\n }\n }\n if (message.method === 'channels.update') {\n changeState(channel, message.params.data.state);\n state.resolve({ accepted: true, signedTx: message.params.data.state });\n return { handler: channelOpen };\n }\n if (message.method === 'channels.conflict') {\n state.resolve({\n accepted: false,\n errorCode: message.params.data.error_code,\n errorMessage: message.params.data.error_msg,\n });\n return { handler: channelOpen };\n }\n if (message.method === 'channels.info') {\n if (message.params.data.event === 'aborted_update') {\n state.resolve({ accepted: false });\n return { handler: channelOpen };\n }\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport async function awaitingDepositTx(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): Promise<ChannelFsm | undefined> {\n if (message.method === 'channels.sign.deposit_tx') {\n const { sign } = state;\n if (message.params.data.tx != null) {\n const signedTx = await sign(\n message.params.data.tx,\n { updates: message.params.data.updates },\n );\n send(channel, { jsonrpc: '2.0', method: 'channels.deposit_tx', params: { tx: signedTx } });\n return { handler: awaitingDepositCompletion, state };\n }\n const signedTx = await appendSignature(\n message.params.data.signed_tx,\n async (tx) => sign(tx, { updates: message.params.data.updates }),\n );\n if (typeof signedTx === 'string') {\n send(channel, { jsonrpc: '2.0', method: 'channels.deposit_tx', params: { signed_tx: signedTx } });\n return { handler: awaitingDepositCompletion, state };\n }\n if (typeof signedTx === 'number') {\n send(channel, { jsonrpc: '2.0', method: 'channels.deposit_tx', params: { error: signedTx } });\n return { handler: awaitingDepositCompletion, state };\n }\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport function awaitingDepositCompletion(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm {\n if (message.method === 'channels.on_chain_tx') {\n state.onOnChainTx?.(message.params.data.tx);\n return { handler: awaitingDepositCompletion, state };\n }\n if (message.method === 'channels.info') {\n if (['own_deposit_locked', 'deposit_locked'].includes(message.params.data.event)) {\n const callbacks: {\n [key: string]: Function | undefined;\n } = {\n own_deposit_locked: state.onOwnDepositLocked,\n deposit_locked: state.onDepositLocked,\n };\n callbacks[message.params.data.event]?.();\n return { handler: awaitingDepositCompletion, state };\n }\n }\n if (message.method === 'channels.update') {\n changeState(channel, message.params.data.state);\n state.resolve({ accepted: true, signedTx: message.params.data.state });\n return { handler: channelOpen };\n }\n if (message.method === 'channels.conflict') {\n state.resolve({\n accepted: false,\n errorCode: message.params.data.error_code,\n errorMessage: message.params.data.error_msg,\n });\n return { handler: channelOpen };\n }\n if (message.method === 'channels.info') {\n if (message.params.data.event === 'aborted_update') {\n state.resolve({ accepted: false });\n return { handler: channelOpen };\n }\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport async function awaitingNewContractTx(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): Promise<ChannelFsm | undefined> {\n if (message.method === 'channels.sign.update') {\n if (message.params.data.tx != null) {\n const signedTx = await state.sign(message.params.data.tx);\n send(channel, { jsonrpc: '2.0', method: 'channels.update', params: { tx: signedTx } });\n return { handler: awaitingNewContractCompletion, state };\n }\n const signedTx = await appendSignature(\n message.params.data.signed_tx,\n async (tx) => state.sign(tx),\n );\n if (typeof signedTx === 'string') {\n send(channel, { jsonrpc: '2.0', method: 'channels.update', params: { signed_tx: signedTx } });\n return { handler: awaitingNewContractCompletion, state };\n }\n if (typeof signedTx === 'number') {\n send(channel, { jsonrpc: '2.0', method: 'channels.update', params: { error: signedTx } });\n return { handler: awaitingNewContractCompletion, state };\n }\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport function awaitingNewContractCompletion(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm {\n const channelOptions = options.get(channel);\n if (message.method === 'channels.update') {\n const { round } = unpackTx(message.params.data.state, Tag.SignedTx).tx.encodedTx.tx;\n if (channelOptions?.role != null) {\n let role: null | 'initiatorId' | 'responderId' = null;\n if (channelOptions.role === 'initiator') role = 'initiatorId';\n if (channelOptions.role === 'responder') role = 'responderId';\n if (role != null) {\n const owner = channelOptions?.[role];\n changeState(channel, message.params.data.state);\n state.resolve({\n accepted: true,\n address: encodeContractAddress(owner, round),\n signedTx: message.params.data.state,\n });\n return { handler: channelOpen };\n }\n }\n }\n if (message.method === 'channels.conflict') {\n state.resolve({\n accepted: false,\n errorCode: message.params.data.error_code,\n errorMessage: message.params.data.error_msg,\n });\n return { handler: channelOpen };\n }\n if (message.method === 'channels.info') {\n if (message.params.data.event === 'aborted_update') {\n state.resolve({ accepted: false });\n return { handler: channelOpen };\n }\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport async function awaitingCallContractUpdateTx(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): Promise<ChannelFsm | undefined> {\n if (message.method === 'channels.sign.update') {\n if (message.params.data.tx != null) {\n const signedTx = await state.sign(\n message.params.data.tx,\n { updates: message.params.data.updates },\n );\n send(channel, { jsonrpc: '2.0', method: 'channels.update', params: { tx: signedTx } });\n return { handler: awaitingCallContractCompletion, state };\n }\n const signedTx = await appendSignature(\n message.params.data.signed_tx,\n async (tx) => state.sign(tx, { updates: message.params.data.updates }),\n );\n if (typeof signedTx === 'string') {\n send(channel, { jsonrpc: '2.0', method: 'channels.update', params: { signed_tx: signedTx } });\n return { handler: awaitingCallContractCompletion, state };\n }\n if (typeof signedTx === 'number') {\n send(channel, { jsonrpc: '2.0', method: 'channels.update', params: { error: signedTx } });\n return { handler: awaitingCallContractCompletion, state };\n }\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport async function awaitingCallContractForceProgressUpdate(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): Promise<ChannelFsm | undefined> {\n if (message.method === 'channels.sign.force_progress_tx') {\n const signedTx = await appendSignature(\n message.params.data.signed_tx,\n async (tx) => state.sign(tx, { updates: message.params.data.updates }),\n );\n send(\n channel,\n { jsonrpc: '2.0', method: 'channels.force_progress_sign', params: { signed_tx: signedTx } },\n );\n return { handler: awaitingForceProgressCompletion, state };\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport function awaitingForceProgressCompletion(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm {\n if (message.method === 'channels.on_chain_tx') {\n state.onOnChainTx?.(message.params.data.tx);\n emit(channel, 'onChainTx', message.params.data.tx, {\n info: message.params.data.info,\n type: message.params.data.type,\n });\n state.resolve({ accepted: true, tx: message.params.data.tx });\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport function awaitingCallContractCompletion(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm {\n if (message.method === 'channels.update') {\n changeState(channel, message.params.data.state);\n state.resolve({ accepted: true, signedTx: message.params.data.state });\n return { handler: channelOpen };\n }\n if (message.method === 'channels.conflict') {\n state.resolve({\n accepted: false,\n errorCode: message.params.data.error_code,\n errorMessage: message.params.data.error_msg,\n });\n return { handler: channelOpen };\n }\n if (message.method === 'channels.info') {\n if (message.params.data.event === 'aborted_update') {\n state.resolve({ accepted: false });\n return { handler: channelOpen };\n }\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport function awaitingCallsPruned(\n _channels: Channel[],\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm {\n if (message.method === 'channels.calls_pruned.reply') {\n state.resolve();\n return { handler: channelOpen };\n }\n state.reject(new UnexpectedChannelMessageError('Unexpected message received'));\n return { handler: channelClosed };\n}\n\nexport function channelClosed(\n _channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm {\n if (state == null) return { handler: channelClosed };\n if (message.params.data.event === 'closing') return { handler: channelClosed, state };\n if (message.params.data.info === 'channel_closed') {\n state.closeTx = message.params.data.tx;\n return { handler: channelClosed, state };\n }\n if (message.params.data.event === 'closed_confirmed') {\n state.resolve(state.closeTx);\n return { handler: channelClosed };\n }\n return { handler: channelClosed, state };\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2018 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport BigNumber from 'bignumber.js';\nimport { snakeToPascal } from '../utils/string';\nimport { buildTx, unpackTx } from '../tx/builder';\nimport { MIN_GAS_PRICE, Tag } from '../tx/builder/constants';\nimport * as handlers from './handlers';\nimport {\n eventEmitters,\n status as channelStatus,\n state as channelState,\n initialize,\n enqueueAction,\n send,\n channelId,\n call,\n disconnect as channelDisconnect,\n fsmId as channelFsmId,\n SignTx,\n ChannelOptions,\n ChannelState,\n} from './internal';\nimport { UnknownChannelStateError, ChannelError } from '../utils/errors';\nimport { Encoded } from '../utils/encoder';\nimport { ContractCallReturnType } from '../apis/node';\nimport { pause } from '../utils/other';\n\nfunction snakeToPascalObjKeys<Type>(obj: object): Type {\n return Object.entries(obj).reduce((result, [key, val]) => ({\n ...result,\n [snakeToPascal(key)]: val,\n }), {}) as Type;\n}\n\ntype EventCallback = (...args: any[]) => void;\n\ninterface CallContractOptions {\n amount?: number | BigNumber;\n callData?: Encoded.ContractBytearray;\n abiVersion?: number;\n contract?: Encoded.ContractAddress;\n returnValue?: any;\n gasUsed?: number | BigNumber;\n gasPrice?: number | BigNumber;\n height?: number;\n callerNonce?: number;\n log?: any;\n returnType?: ContractCallReturnType;\n}\n\ninterface Contract {\n abiVersion: number;\n active: boolean;\n deposit: number | BigNumber;\n id: string;\n ownerId: string;\n referrerIds: string[];\n vmVersion: number;\n}\n\n/**\n * Channel\n * @example\n * ```js\n * await Channel.initialize({\n * url: 'ws://localhost:3001',\n * role: 'initiator'\n * initiatorId: 'ak_Y1NRjHuoc3CGMYMvCmdHSBpJsMDR6Ra2t5zjhRcbtMeXXLpLH',\n * responderId: 'ak_V6an1xhec1xVaAhLuak7QoEbi6t7w5hEtYWp9bMKaJ19i6A9E',\n * initiatorAmount: 1e18,\n * responderAmount: 1e18,\n * pushAmount: 0,\n * channelReserve: 0,\n * ttl: 1000,\n * host: 'localhost',\n * port: 3002,\n * lockPeriod: 10,\n * async sign (tag, tx) => await account.signTransaction(tx)\n * })\n * ```\n */\nexport default class Channel {\n /**\n * @param options - Channel params\n * @param options.url - Channel url (for example: \"ws://localhost:3001\")\n * @param options.role - Participant role (\"initiator\" or \"responder\")\n * @param options.initiatorId - Initiator's public key\n * @param options.responderId - Responder's public key\n * @param options.pushAmount - Initial deposit in favour of the responder by the initiator\n * @param options.initiatorAmount - Amount of coins the initiator has committed to\n * the channel\n * @param options.responderAmount - Amount of coins the responder has committed to\n * the channel\n * @param options.channelReserve - The minimum amount both peers need to maintain\n * @param options.ttl - Minimum block height to include the channel_create_tx\n * @param options.host - Host of the responder's node\n * @param options.port - The port of the responders node\n * @param options.lockPeriod - Amount of blocks for disputing a solo close\n * @param options.existingChannelId - Existing channel id (required if reestablishing a\n * channel)\n * @param options.offchainTx - Offchain transaction (required if reestablishing\n * a channel)\n * @param options.timeoutIdle - The time waiting for a new event to be initiated\n * (default: 600000)\n * @param options.timeoutFundingCreate - The time waiting for the initiator to produce\n * the create channel transaction after the noise session had been established (default: 120000)\n * @param options.timeoutFundingSign - The time frame the other client has to sign an\n * off-chain update after our client had initiated and signed it. This applies only for double\n * signed on-chain intended updates: channel create transaction, deposit, withdrawal and etc.\n * (default: 120000)\n * @param options.timeoutFundingLock - The time frame the other client has to confirm an\n * on-chain transaction reaching maturity (passing minimum depth) after the local node has\n * detected this. This applies only for double signed on-chain intended updates: channel create\n * transaction, deposit, withdrawal and etc. (default: 360000)\n * @param options.timeoutSign - The time frame the client has to return a signed\n * off-chain update or to decline it. This applies for all off-chain updates (default: 500000)\n * @param options.timeoutAccept - The time frame the other client has to react to an\n * event. This applies for all off-chain updates that are not meant to land on-chain, as well as\n * some special cases: opening a noise connection, mutual closing acknowledgement and\n * reestablishing an existing channel (default: 120000)\n * @param options.timeoutInitialized - the time frame the responder has to accept an\n * incoming noise session. Applicable only for initiator (default: timeout_accept's value)\n * @param options.timeoutAwaitingOpen - The time frame the initiator has to start an\n * outgoing noise session to the responder's node. Applicable only for responder (default:\n * timeout_idle's value)\n * @param options.debug=false - Log websocket communication\n * @param options.sign - Function which verifies and signs transactions\n */\n static async initialize(options: ChannelOptions): Promise<Channel> {\n const channel = new Channel();\n await initialize(\n channel,\n options.existingFsmId != null ? handlers.awaitingReconnection : handlers.awaitingConnection,\n handlers.channelOpen,\n options,\n );\n return channel;\n }\n\n /**\n * Register event listener function\n *\n * Possible events:\n *\n * - \"error\"\n * - \"onChainTx\"\n * - \"ownWithdrawLocked\"\n * - \"withdrawLocked\"\n * - \"ownDepositLocked\"\n * - \"depositLocked\"\n *\n * TODO: the event list looks outdated\n *\n * @param eventName - Event name\n * @param callback - Callback function\n */\n // TODO define specific callback type depending on the event name\n on(eventName: string, callback: EventCallback): void {\n const eventEmitter = eventEmitters.get(this);\n if (eventEmitter == null) throw new UnknownChannelStateError();\n eventEmitter.on(eventName, callback);\n }\n\n /**\n * Remove event listener function\n * @param eventName - Event name\n * @param callback - Callback function\n */\n off(eventName: string, callback: EventCallback): void {\n const eventEmitter = eventEmitters.get(this);\n if (eventEmitter == null) throw new UnknownChannelStateError();\n eventEmitter.removeListener(eventName, callback);\n }\n\n /**\n * Close the connection\n */\n disconnect(): void {\n return channelDisconnect(this);\n }\n\n /**\n * Get current status\n *\n */\n status(): string {\n const status = channelStatus.get(this);\n if (status == null) throw new UnknownChannelStateError();\n return status;\n }\n\n /**\n * Get current state\n */\n async state(): Promise<ChannelState> {\n return snakeToPascalObjKeys(await call(this, 'channels.get.offchain_state', {}));\n }\n\n /**\n * Get current round\n *\n * If round cannot be determined (for example when channel has not been opened)\n * it will return `null`.\n *\n */\n round(): number | null {\n const state = channelState.get(this);\n if (state == null) {\n return null;\n }\n const { txType, tx } = unpackTx(state, Tag.SignedTx).tx.encodedTx;\n switch (txType) {\n case Tag.ChannelCreateTx:\n return 1;\n case Tag.ChannelOffChainTx:\n case Tag.ChannelWithdrawTx:\n case Tag.ChannelDepositTx:\n return tx.round;\n default:\n return null;\n }\n }\n\n /**\n * Get channel id\n *\n */\n id(): string {\n const id = channelId.get(this);\n if (id == null) throw new ChannelError('Channel is not initialized');\n return id;\n }\n\n /**\n * Get channel's fsm id\n *\n */\n fsmId(): string {\n const id = channelFsmId.get(this);\n if (id == null) throw new ChannelError('Channel is not initialized');\n return id;\n }\n\n /**\n * Trigger a transfer update\n *\n * The transfer update is moving coins from one channel account to another.\n * The update is a change to be applied on top of the latest state.\n *\n * Sender and receiver are the channel parties. Both the initiator and responder\n * can take those roles. Any public key outside the channel is considered invalid.\n *\n * @param from - Sender's public address\n * @param to - Receiver's public address\n * @param amount - Transaction amount\n * @param sign - Function which verifies and signs offchain transaction\n * @param metadata - Metadata\n\n * @example\n * ```js\n * channel.update(\n * 'ak_Y1NRjHuoc3CGMYMvCmdHSBpJsMDR6Ra2t5zjhRcbtMeXXLpLH',\n * 'ak_V6an1xhec1xVaAhLuak7QoEbi6t7w5hEtYWp9bMKaJ19i6A9E',\n * 10,\n * async (tx) => await account.signTransaction(tx)\n * ).then(({ accepted, signedTx }) =>\n * if (accepted) {\n * console.log('Update has been accepted')\n * }\n * )\n * ```\n */\n async update(\n from: Encoded.AccountAddress,\n to: Encoded.AccountAddress,\n amount: number | BigNumber,\n sign: SignTx,\n metadata: string[] = [],\n ): Promise<{\n accepted: boolean;\n signedTx?: Encoded.Transaction;\n errorCode?: number;\n errorMessage?: string;\n }> {\n return new Promise((resolve, reject) => {\n enqueueAction(\n this,\n (_channel, state) => state?.handler === handlers.channelOpen,\n (channel) => {\n send(channel, {\n jsonrpc: '2.0',\n method: 'channels.update.new',\n params: {\n from, to, amount, meta: metadata,\n },\n });\n return {\n handler: handlers.awaitingOffChainTx,\n state: {\n resolve,\n reject,\n sign,\n },\n };\n },\n );\n });\n }\n\n /**\n * Get proof of inclusion\n *\n * If a certain address of an account or a contract is not found\n * in the state tree - the response is an error.\n *\n * @param addresses - Addresses\n * @param addresses.accounts - List of account addresses to include in poi\n * @param addresses.contracts - List of contract addresses to include in poi\n * @example\n * ```js\n * channel.poi({\n * accounts: [\n * 'ak_Y1NRjHuoc3CGMYMvCmdHSBpJsMDR6Ra2t5zjhRcbtMeXXLpLH',\n * 'ak_V6an1xhec1xVaAhLuak7QoEbi6t7w5hEtYWp9bMKaJ19i6A9E'\n * ],\n * contracts: ['ct_2dCUAWYZdrWfACz3a2faJeKVTVrfDYxCQHCqAt5zM15f3u2UfA']\n * }).then(poi => console.log(poi))\n * ```\n */\n async poi(\n { accounts, contracts }: {\n accounts: Encoded.AccountAddress[];\n contracts?: Encoded.ContractAddress[];\n },\n ): Promise<Encoded.Poi> {\n return (await call(this, 'channels.get.poi', { accounts, contracts })).poi;\n }\n\n /**\n * Get balances\n *\n * The accounts param contains a list of addresses to fetch balances of.\n * Those can be either account balances or a contract ones, encoded as an account addresses.\n *\n * If a certain account address had not being found in the state tree - it is simply\n * skipped in the response.\n *\n * @param accounts - List of addresses to fetch balances from\n * @example\n * ```js\n * channel.balances([\n * 'ak_Y1NRjHuoc3CGMYMvCmdHSBpJsMDR6Ra2t5zjhRcbtMeXXLpLH',\n * 'ak_V6an1xhec1xVaAhLuak7QoEbi6t7w5hEtYWp9bMKaJ19i6A9E'\n * 'ct_2dCUAWYZdrWfACz3a2faJeKVTVrfDYxCQHCqAt5zM15f3u2UfA'\n * ]).then(balances =>\n * console.log(balances['ak_Y1NRjHuoc3CGMYMvCmdHSBpJsMDR6Ra2t5zjhRcbtMeXXLpLH'])\n * )\n * ```\n */\n async balances(\n accounts: Encoded.AccountAddress[],\n ): Promise<{ [key: Encoded.AccountAddress]: string }> {\n return Object.fromEntries(\n (await call(this, 'channels.get.balances', { accounts }))\n .map((item: {\n account: Encoded.AccountAddress;\n balance: string;\n }) => [item.account, item.balance]),\n );\n }\n\n /**\n * Leave channel\n *\n * It is possible to leave a channel and then later reestablish the channel\n * off-chain state and continue operation. When a leave method is called,\n * the channel fsm passes it on to the peer fsm, reports the current mutually\n * signed state and then terminates.\n *\n * The channel can be reestablished by instantiating another Channel instance\n * with two extra params: existingChannelId and offchainTx (returned from leave\n * method as channelId and signedTx respectively).\n *\n * @example\n * ```js\n * channel.leave().then(({ channelId, signedTx }) => {\n * console.log(channelId)\n * console.log(signedTx)\n * })\n * ```\n */\n async leave(): Promise<{ channelId: string; signedTx: Encoded.Transaction }> {\n return new Promise((resolve, reject) => {\n enqueueAction(\n this,\n (channel, state) => state?.handler === handlers.channelOpen,\n (channel) => {\n send(channel, { jsonrpc: '2.0', method: 'channels.leave', params: {} });\n return {\n handler: handlers.awaitingLeave,\n state: { resolve, reject },\n };\n },\n );\n });\n }\n\n /**\n * Trigger mutual close\n *\n * At any moment after the channel is opened, a closing procedure can be triggered.\n * This can be done by either of the parties. The process is similar to the off-chain updates.\n *\n * @param sign - Function which verifies and signs mutual close transaction\n * @example\n * ```js\n * channel.shutdown(\n * async (tx) => await account.signTransaction(tx)\n * ).then(tx => console.log('on_chain_tx', tx))\n * ```\n */\n async shutdown(sign: Function): Promise<Encoded.Transaction> {\n return new Promise((resolve, reject) => {\n enqueueAction(\n this,\n (_channel, state) => state?.handler === handlers.channelOpen,\n (channel) => {\n send(channel, { jsonrpc: '2.0', method: 'channels.shutdown', params: {} });\n return {\n handler: handlers.awaitingShutdownTx,\n state: {\n sign,\n resolve,\n reject,\n },\n };\n },\n );\n });\n }\n\n /**\n * Withdraw coins from the channel\n *\n * After the channel had been opened any of the participants can initiate a withdrawal.\n * The process closely resembles the update. The most notable difference is that the\n * transaction has been co-signed: it is channel_withdraw_tx and after the procedure\n * is finished - it is being posted on-chain.\n *\n * Any of the participants can initiate a withdrawal. The only requirements are:\n *\n * - Channel is already opened\n * - No off-chain update/deposit/withdrawal is currently being performed\n * - Channel is not being closed or in a solo closing state\n * - The withdrawal amount must be equal to or greater than zero, and cannot exceed\n * the available balance on the channel (minus the channel_reserve)\n *\n * After the other party had signed the withdraw transaction, the transaction is posted\n * on-chain and onOnChainTx callback is called with on-chain transaction as first argument.\n * After computing transaction hash it can be tracked on the chain: entering the mempool,\n * block inclusion and a number of confirmations.\n *\n * After the minimum_depth block confirmations onOwnWithdrawLocked callback is called\n * (without any arguments).\n *\n * When the other party had confirmed that the block height needed is reached\n * onWithdrawLocked callback is called (without any arguments).\n *\n * @param amount - Amount of coins to withdraw\n * @param sign - Function which verifies and signs withdraw transaction\n * @param callbacks - Callbacks\n * @param callbacks.onOnChainTx - Called when withdraw transaction has been posted\n * on chain\n * @param callbacks.onOwnWithdrawLocked\n * @param callbacks.onWithdrawLocked\n * @example\n * ```js\n * channel.withdraw(\n * 100,\n * async (tx) => await account.signTransaction(tx),\n * { onOnChainTx: (tx) => console.log('on_chain_tx', tx) }\n * ).then(({ accepted, signedTx }) => {\n * if (accepted) {\n * console.log('Withdrawal has been accepted')\n * } else {\n * console.log('Withdrawal has been rejected')\n * }\n * })\n * ```\n */\n async withdraw(\n amount: number | BigNumber,\n sign: SignTx,\n { onOnChainTx, onOwnWithdrawLocked, onWithdrawLocked }:\n Pick<ChannelState, 'onOnChainTx' | 'onOwnWithdrawLocked' | 'onWithdrawLocked'> = {},\n ): Promise<{ accepted: boolean; signedTx: Encoded.Transaction }> {\n return new Promise((resolve, reject) => {\n enqueueAction(\n this,\n (_channel, state) => state?.handler === handlers.channelOpen,\n (channel) => {\n send(channel, { jsonrpc: '2.0', method: 'channels.withdraw', params: { amount } });\n return {\n handler: handlers.awaitingWithdrawTx,\n state: {\n sign,\n resolve,\n reject,\n onOnChainTx,\n onOwnWithdrawLocked,\n onWithdrawLocked,\n },\n };\n },\n );\n });\n }\n\n /**\n * Deposit coins into the channel\n *\n * After the channel had been opened any of the participants can initiate a deposit.\n * The process closely resembles the update. The most notable difference is that the\n * transaction has been co-signed: it is channel_deposit_tx and after the procedure\n * is finished - it is being posted on-chain.\n *\n * Any of the participants can initiate a deposit. The only requirements are:\n *\n * - Channel is already opened\n * - No off-chain update/deposit/withdrawal is currently being performed\n * - Channel is not being closed or in a solo closing state\n * - The deposit amount must be equal to or greater than zero, and cannot exceed\n * the available balance on the channel (minus the channel_reserve)\n *\n * After the other party had signed the deposit transaction, the transaction is posted\n * on-chain and onOnChainTx callback is called with on-chain transaction as first argument.\n * After computing transaction hash it can be tracked on the chain: entering the mempool,\n * block inclusion and a number of confirmations.\n *\n * After the minimum_depth block confirmations onOwnDepositLocked callback is called\n * (without any arguments).\n *\n * When the other party had confirmed that the block height needed is reached\n * onDepositLocked callback is called (without any arguments).\n *\n * @param amount - Amount of coins to deposit\n * @param sign - Function which verifies and signs deposit transaction\n * @param callbacks - Callbacks\n * @param callbacks.onOnChainTx - Called when deposit transaction has been posted\n * on chain\n * @param callbacks.onOwnDepositLocked\n * @param callbacks.onDepositLocked\n * @example\n * ```js\n * channel.deposit(\n * 100,\n * async (tx) => await account.signTransaction(tx),\n * { onOnChainTx: (tx) => console.log('on_chain_tx', tx) }\n * ).then(({ accepted, state }) => {\n * if (accepted) {\n * console.log('Deposit has been accepted')\n * console.log('The new state is:', state)\n * } else {\n * console.log('Deposit has been rejected')\n * }\n * })\n * ```\n */\n async deposit(\n amount: number | BigNumber,\n sign: SignTx,\n { onOnChainTx, onOwnDepositLocked, onDepositLocked }:\n Pick<ChannelState, 'onOnChainTx' | 'onOwnDepositLocked' | 'onDepositLocked'> = {},\n ): Promise<{ accepted: boolean; state: ChannelState }> {\n return new Promise((resolve, reject) => {\n enqueueAction(\n this,\n (_channel, state) => state?.handler === handlers.channelOpen,\n (channel) => {\n send(channel, { jsonrpc: '2.0', method: 'channels.deposit', params: { amount } });\n return {\n handler: handlers.awaitingDepositTx,\n state: {\n sign,\n resolve,\n reject,\n onOnChainTx,\n onOwnDepositLocked,\n onDepositLocked,\n },\n };\n },\n );\n });\n }\n\n /**\n * Trigger create contract update\n *\n * The create contract update is creating a contract inside the channel's internal state tree.\n * The update is a change to be applied on top of the latest state.\n *\n * That would create a contract with the poster being the owner of it. Poster commits initially\n * a deposit amount of coins to the new contract.\n *\n * @param options - Options\n * @param options.code - Api encoded compiled AEVM byte code\n * @param options.callData - Api encoded compiled AEVM call data for the code\n * @param options.deposit - Initial amount the owner of the contract commits to it\n * @param options.vmVersion - Version of the Virtual Machine\n * @param options.abiVersion - Version of the Application Binary Interface\n * @param sign - Function which verifies and signs create contract transaction\n * @example\n * ```js\n * channel.createContract({\n * code: 'cb_HKtpipK4aCgYb17wZ...',\n * callData: 'cb_1111111111111111...',\n * deposit: 10,\n * vmVersion: 3,\n * abiVersion: 1\n * }).then(({ accepted, signedTx, address }) => {\n * if (accepted) {\n * console.log('New contract has been created')\n * console.log('Contract address:', address)\n * } else {\n * console.log('New contract has been rejected')\n * }\n * })\n * ```\n */\n async createContract(\n {\n code, callData, deposit, vmVersion, abiVersion,\n }: {\n code: Encoded.ContractBytearray;\n callData: Encoded.ContractBytearray;\n deposit: number | BigNumber;\n vmVersion: number;\n abiVersion: number;\n },\n sign: SignTx,\n ): Promise<{\n accepted: boolean; signedTx: Encoded.Transaction; address: Encoded.ContractAddress;\n }> {\n return new Promise((resolve, reject) => {\n enqueueAction(\n this,\n (_channel, state) => state?.handler === handlers.channelOpen,\n (channel) => {\n send(channel, {\n jsonrpc: '2.0',\n method: 'channels.update.new_contract',\n params: {\n code,\n call_data: callData,\n deposit,\n vm_version: vmVersion,\n abi_version: abiVersion,\n },\n });\n return {\n handler: handlers.awaitingNewContractTx,\n state: {\n sign,\n resolve,\n reject,\n },\n };\n },\n );\n });\n }\n\n /**\n * Trigger call a contract update\n *\n * The call contract update is calling a preexisting contract inside the channel's\n * internal state tree. The update is a change to be applied on top of the latest state.\n *\n * That would call a contract with the poster being the caller of it. Poster commits\n * an amount of coins to the contract.\n *\n * The call would also create a call object inside the channel state tree. It contains\n * the result of the contract call.\n *\n * It is worth mentioning that the gas is not consumed, because this is an off-chain\n * contract call. It would be consumed if it were an on-chain one. This could happen\n * if a call with a similar computation amount is to be forced on-chain.\n *\n * @param options - Options\n * @param options.amount - Amount the caller of the contract commits to it\n * @param options.callData - ABI encoded compiled AEVM call data for the code\n * @param options.contract - Address of the contract to call\n * @param options.abiVersion - Version of the ABI\n * @param sign - Function which verifies and signs contract call transaction\n * @example\n * ```js\n * channel.callContract({\n * contract: 'ct_9sRA9AVE4BYTAkh5RNfJYmwQe1NZ4MErasQLXZkFWG43TPBqa',\n * callData: 'cb_1111111111111111...',\n * amount: 0,\n * abiVersion: 1\n * }).then(({ accepted, signedTx }) => {\n * if (accepted) {\n * console.log('Contract called succesfully')\n * } else {\n * console.log('Contract call has been rejected')\n * }\n * })\n * ```\n */\n async callContract(\n {\n amount, callData, contract, abiVersion,\n }: CallContractOptions,\n sign: SignTx,\n ): Promise<{ accepted: boolean; signedTx: Encoded.Transaction }> {\n return new Promise((resolve, reject) => {\n enqueueAction(\n this,\n (_channel, state) => state?.handler === handlers.channelOpen,\n (channel) => {\n send(channel, {\n jsonrpc: '2.0',\n method: 'channels.update.call_contract',\n params: {\n amount,\n call_data: callData,\n contract_id: contract,\n abi_version: abiVersion,\n },\n });\n return {\n handler: handlers.awaitingCallContractUpdateTx,\n state: { resolve, reject, sign },\n };\n },\n );\n });\n }\n\n /**\n * Trigger a force progress contract call\n * This call is going on-chain\n * @param options - Options\n * @param options.amount - Amount the caller of the contract commits to it\n * @param options.callData - ABI encoded compiled AEVM call data for the code\n * @param options.contract - Address of the contract to call\n * @param options.abiVersion - Version of the ABI\n * @param options.gasPrice=1000000000]\n * @param options.gasLimit=1000000]\n * @param sign - Function which verifies and signs contract force progress transaction\n * @param callbacks - Callbacks\n * @example\n * ```js\n * channel.forceProgress({\n * contract: 'ct_9sRA9AVE4BYTAkh5RNfJYmwQe1NZ4MErasQLXZkFWG43TPBqa',\n * callData: 'cb_1111111111111111...',\n * amount: 0,\n * abiVersion: 1,\n * gasPrice: 1000005554\n * }).then(({ accepted, signedTx }) => {\n * if (accepted) {\n * console.log('Contract force progress call successful')\n * } else {\n * console.log('Contract force progress call has been rejected')\n * }\n * })\n * ```\n */\n async forceProgress(\n {\n amount, callData, contract, abiVersion, gasLimit = 1000000, gasPrice = MIN_GAS_PRICE,\n }: {\n amount: number;\n callData: Encoded.ContractBytearray;\n contract: Encoded.ContractAddress;\n abiVersion: number;\n gasLimit?: number;\n gasPrice?: number;\n },\n sign: SignTx,\n { onOnChainTx }: Pick<ChannelState, 'onOnChainTx'> = {},\n ): Promise<{\n accepted: boolean;\n signedTx: Encoded.Transaction;\n tx: Encoded.Transaction | Uint8Array;\n }> {\n return new Promise((resolve, reject) => {\n enqueueAction(\n this,\n (_channel, state) => state?.handler === handlers.channelOpen,\n (channel) => {\n send(channel, {\n jsonrpc: '2.0',\n method: 'channels.force_progress',\n params: {\n amount,\n call_data: callData,\n contract_id: contract,\n abi_version: abiVersion,\n gas_price: gasPrice,\n gas: gasLimit,\n },\n });\n return {\n handler: handlers.awaitingCallContractForceProgressUpdate,\n state: {\n resolve, reject, sign, onOnChainTx,\n },\n };\n },\n );\n });\n }\n\n /**\n * Call contract using dry-run\n *\n * In order to get the result of a potential contract call, one might need to\n * dry-run a contract call. It takes the exact same arguments as a call would\n * and returns the call object.\n *\n * The call is executed in the channel's state, but it does not impact the state\n * whatsoever. It uses as an environment the latest channel's state and the current\n * top of the blockchain as seen by the node.\n *\n * @param options - Options\n * @param options.amount - Amount the caller of the contract commits to it\n * @param options.callData - ABI encoded compiled AEVM call data for the code\n * @param options.contract - Address of the contract to call\n * @param options.abiVersion - Version of the ABI\n * @example\n * ```js\n * channel.callContractStatic({\n * contract: 'ct_9sRA9AVE4BYTAkh5RNfJYmwQe1NZ4MErasQLXZkFWG43TPBqa',\n * callData: 'cb_1111111111111111...',\n * amount: 0,\n * abiVersion: 1\n * }).then(({ returnValue, gasUsed }) => {\n * console.log('Returned value:', returnValue)\n * console.log('Gas used:', gasUsed)\n * })\n * ```\n */\n async callContractStatic(\n {\n amount, callData, contract, abiVersion,\n }: {\n amount: number;\n callData: Encoded.ContractBytearray;\n contract: Encoded.ContractAddress;\n abiVersion: number;\n },\n ): Promise<CallContractOptions> {\n return snakeToPascalObjKeys(await call(this, 'channels.dry_run.call_contract', {\n amount,\n call_data: callData,\n contract_id: contract,\n abi_version: abiVersion,\n }));\n }\n\n /**\n * Get contract call result\n *\n * The combination of a caller, contract and a round of execution determines the\n * contract call. Providing an incorrect set of those results in an error response.\n *\n * @param options - Options\n * @param options.caller - Address of contract caller\n * @param options.contract - Address of the contract\n * @param options.round - Round when contract was called\n * @example\n * ```js\n * channel.getContractCall({\n * caller: 'ak_Y1NRjHuoc3CGMYMvCmdHSBpJsMDR6Ra2t5zjhRcbtMeXXLpLH',\n * contract: 'ct_9sRA9AVE4BYTAkh5RNfJYmwQe1NZ4MErasQLXZkFWG43TPBqa',\n * round: 3\n * }).then(({ returnType, returnValue }) => {\n * if (returnType === 'ok') console.log(returnValue)\n * })\n * ```\n */\n async getContractCall(\n { caller, contract, round }: {\n caller: Encoded.AccountAddress;\n contract: Encoded.ContractAddress;\n round: number;\n },\n ): Promise<{\n returnType: ContractCallReturnType;\n returnValue: string;\n gasPrice: number | BigNumber;\n gasUsed: number | BigNumber;\n height: number;\n log: string;\n }> {\n return snakeToPascalObjKeys(\n await call(this, 'channels.get.contract_call', {\n caller_id: caller,\n contract_id: contract,\n round,\n }),\n );\n }\n\n /**\n * Get the latest contract state\n *\n * @param contract - Address of the contract\n * @example\n * ```js\n * channel.getContractState(\n * 'ct_9sRA9AVE4BYTAkh5RNfJYmwQe1NZ4MErasQLXZkFWG43TPBqa'\n * ).then(({ contract }) => {\n * console.log('deposit:', contract.deposit)\n * })\n * ```\n */\n async getContractState(\n contract: Encoded.ContractAddress,\n ): Promise<{ contract: Contract; contractState: object }> {\n const result = await call(this, 'channels.get.contract', { pubkey: contract });\n return snakeToPascalObjKeys({\n ...result,\n contract: snakeToPascalObjKeys(result.contract),\n });\n }\n\n /**\n * Clean up all locally stored contract calls\n *\n * Contract calls are kept locally in order for the participant to be able to look them up.\n * They consume memory and in order for the participant to free it - one can prune all messages.\n * This cleans up all locally stored contract calls and those will no longer be available for\n * fetching and inspection.\n */\n async cleanContractCalls(): Promise<void> {\n return new Promise((resolve, reject) => {\n enqueueAction(\n this,\n (_channel, state) => state?.handler === handlers.channelOpen,\n (channel) => {\n send(channel, {\n jsonrpc: '2.0',\n method: 'channels.clean_contract_calls',\n params: {},\n });\n return {\n handler: handlers.awaitingCallsPruned,\n state: { resolve, reject },\n };\n },\n );\n });\n }\n\n /**\n * Send generic message\n *\n * If message is an object it will be serialized into JSON string\n * before sending.\n *\n * If there is ongoing update that has not yet been finished the message\n * will be sent after that update is finalized.\n *\n * @param message - Message\n * @param recipient - Address of the recipient\n * @example\n * ```js\n * channel.sendMessage(\n * 'hello world',\n * 'ak_Y1NRjHuoc3CGMYMvCmdHSBpJsMDR6Ra2t5zjhRcbtMeXXLpLH'\n * )\n * ```\n */\n async sendMessage(\n message: string | object,\n recipient: Encoded.AccountAddress,\n ): Promise<void> {\n const info = typeof message === 'object' ? JSON.stringify(message) : message;\n if (this.status() === 'connecting') {\n await new Promise<void>((resolve) => {\n const onStatusChanged = (status: string): void => {\n if (status === 'connecting') return;\n resolve();\n this.off('statusChanged', onStatusChanged);\n };\n this.on('statusChanged', onStatusChanged);\n });\n // For some reason we can't immediately send a message when connection is\n // established. Thus we wait 500ms which seems to work.\n await pause(500);\n }\n send(this, {\n jsonrpc: '2.0',\n method: 'channels.message',\n params: { info, to: recipient },\n });\n }\n\n static async reconnect(options: ChannelOptions, txParams: any): Promise<Channel> {\n const { sign } = options;\n\n return Channel.initialize({\n ...options,\n reconnectTx: await sign('reconnect', buildTx(txParams, Tag.ChannelClientReconnectTx).tx),\n });\n }\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\nimport BrowserConnection from './connection/Browser';\n\n/**\n * Browser connection proxy\n * Provide functionality to easily forward messages from one connection to another and back\n * @category aepp wallet communication\n * @param con1 - first connection\n * @param con2 - second connection\n * @returns a function to stop proxying\n */\nexport default (con1: BrowserConnection, con2: BrowserConnection): () => void => {\n con1.connect((msg: any) => con2.sendMessage(msg), () => con2.disconnect());\n con2.connect((msg: any) => con1.sendMessage(msg), () => con1.disconnect());\n\n return () => {\n con1.disconnect();\n con2.disconnect();\n };\n};\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\nimport { AlreadyConnectedError, NoWalletConnectedError } from '../../utils/errors';\n\n/**\n * Browser connection base interface\n * @category aepp wallet communication\n */\nexport default abstract class BrowserConnection {\n debug: boolean;\n\n protected constructor({ debug = false }: { debug?: boolean }) {\n this.debug = debug;\n }\n\n /**\n * Connect\n * @param onMessage - Message handler\n * @param onDisconnect - trigger when runtime connection in closed\n */\n connect(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onMessage: (message: any, origin: string, source: any) => void,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onDisconnect: () => void,\n ): void {\n if (this.isConnected()) throw new AlreadyConnectedError('You already connected');\n }\n\n /**\n * Disconnect\n */\n disconnect(): void {\n if (!this.isConnected()) throw new NoWalletConnectedError('You dont have connection. Please connect before');\n }\n\n /**\n * Receive message\n */\n protected receiveMessage(message: any): void {\n if (this.debug) console.log('Receive message:', message);\n }\n\n /**\n * Send message\n */\n sendMessage(message: any): void {\n if (this.debug) console.log('Send message:', message);\n }\n\n /**\n * Check if connected\n * @returns Is connected\n */\n abstract isConnected(): boolean;\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\nimport BrowserConnection from './Browser';\nimport { MESSAGE_DIRECTION } from '../schema';\nimport { InternalError, RpcConnectionError } from '../../utils/errors';\n\nexport type ImplPostMessage = Pick<Window, 'addEventListener' | 'removeEventListener' | 'postMessage'>;\n\n/**\n * Browser window Post Message connector module\n * @category aepp wallet communication\n */\nexport default class BrowserWindowMessageConnection extends BrowserConnection {\n origin?: string;\n\n sendDirection?: MESSAGE_DIRECTION;\n\n receiveDirection: MESSAGE_DIRECTION;\n\n listener?: (this: Window, ev: MessageEvent<any>) => void;\n\n #onDisconnect?: () => void;\n\n #target?: ImplPostMessage;\n\n #self: ImplPostMessage;\n\n /**\n * @param options - Options\n * @param options.target Target window for message\n * @param options.self Host window for message\n * @param options.origin Origin of receiver\n * @param options.sendDirection Wrapping messages into additional struct\n * `({ type: 'to_aepp' || 'to_waellet', data })`\n * Used for handling messages between content script and page\n * @param options.receiveDirection Unwrapping messages from additional struct\n */\n constructor({\n target,\n self = window,\n origin,\n sendDirection,\n receiveDirection = MESSAGE_DIRECTION.to_aepp,\n ...options\n }: {\n target?: ImplPostMessage;\n self?: ImplPostMessage;\n origin?: string;\n sendDirection?: MESSAGE_DIRECTION;\n receiveDirection?: MESSAGE_DIRECTION;\n debug?: boolean;\n } = {}) {\n super(options);\n this.#target = target;\n this.#self = self;\n this.origin = origin;\n this.sendDirection = sendDirection;\n this.receiveDirection = receiveDirection;\n }\n\n isConnected(): boolean {\n return this.listener != null;\n }\n\n connect(\n onMessage: (message: any, origin: string, source: MessageEventSource | null) => void,\n onDisconnect: () => void,\n ): void {\n super.connect(onMessage, onDisconnect);\n this.listener = (message: MessageEvent<any>) => {\n // TODO: strict validate origin and source instead of checking message structure\n if (\n typeof message.data !== 'object'\n || (message.data.jsonrpc ?? message.data.data?.jsonrpc) !== '2.0'\n ) return;\n if (this.origin != null && this.origin !== message.origin) return;\n if (this.#target != null && this.#target !== message.source) return;\n this.receiveMessage(message);\n let { data } = message;\n if (data.type != null) {\n if (message.data.type !== this.receiveDirection) return;\n data = data.data;\n }\n onMessage(data, message.origin, message.source);\n };\n this.#self.addEventListener('message', this.listener);\n this.#onDisconnect = onDisconnect;\n }\n\n disconnect(): void {\n super.disconnect();\n if (this.listener == null || this.#onDisconnect == null) {\n throw new InternalError('Expected to not happen, required for TS');\n }\n this.#self.removeEventListener('message', this.listener);\n delete this.listener;\n this.#onDisconnect();\n this.#onDisconnect = undefined;\n }\n\n sendMessage(msg: any): void {\n if (this.#target == null) throw new RpcConnectionError('Can\\'t send messages without target');\n const message = this.sendDirection != null ? { type: this.sendDirection, data: msg } : msg;\n super.sendMessage(message);\n this.#target.postMessage(message, this.origin ?? '*');\n }\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\nimport BrowserConnection from './connection/Browser';\nimport BrowserWindowMessageConnection from './connection/BrowserWindowMessage';\nimport { MESSAGE_DIRECTION, METHODS } from './schema';\nimport { UnsupportedPlatformError } from '../utils/errors';\n\ninterface Wallet {\n info: {\n id: string;\n type: string;\n origin: string;\n };\n getConnection: () => BrowserWindowMessageConnection;\n}\ninterface Wallets { [key: string]: Wallet }\n\n/**\n * A function to detect available wallets\n * @category aepp wallet communication\n * @param connection - connection to use to detect wallets\n * @param onDetected - call-back function which trigger on new wallet\n * @returns a function to stop scanning\n */\nexport default (\n connection: BrowserConnection,\n onDetected: ({ wallets, newWallet }: { wallets: Wallets; newWallet?: Wallet }) => void,\n): () => void => {\n if (window == null) throw new UnsupportedPlatformError('Window object not found, you can run wallet detector only in browser');\n const wallets: Wallets = {};\n\n connection.connect((\n { method, params }: { method: string; params: Wallet['info'] },\n origin: string,\n source: Window,\n ) => {\n if (method !== METHODS.readyToConnect || wallets[params.id] != null) return;\n\n const wallet = {\n info: params,\n getConnection() {\n const isExtension = params.type === 'extension';\n return new BrowserWindowMessageConnection({\n sendDirection: isExtension ? MESSAGE_DIRECTION.to_waellet : undefined,\n receiveDirection: isExtension ? MESSAGE_DIRECTION.to_aepp : undefined,\n target: source,\n origin: isExtension ? window.origin : params.origin,\n });\n },\n };\n wallets[wallet.info.id] = wallet;\n onDetected({ wallets, newWallet: wallet });\n }, () => {});\n if (Object.keys(wallets).length > 0) onDetected({ wallets });\n\n return () => connection.disconnect();\n};\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\nimport { Runtime } from 'webextension-polyfill';\nimport BrowserConnection from './Browser';\n\n/**\n * BrowserRuntimeConnection\n * Handle browser runtime communication\n * @category aepp wallet communication\n */\nexport default class BrowserRuntimeConnection extends BrowserConnection {\n port: Runtime.Port;\n\n constructor({ port, ...options }: { port: Runtime.Port; debug: boolean }) {\n super(options);\n this.port = port;\n }\n\n disconnect(): void {\n super.disconnect();\n this.port.disconnect();\n }\n\n connect(\n onMessage: (message: any, origin: string, source: Runtime.Port) => void,\n onDisconnect: () => void,\n ): void {\n super.connect(onMessage, onDisconnect);\n this.port.onMessage.addListener((message, port) => {\n this.receiveMessage(message);\n onMessage(message, port.name, port);\n });\n this.port.onDisconnect.addListener(onDisconnect);\n }\n\n sendMessage(message: any): void {\n super.sendMessage(message);\n this.port.postMessage(message);\n }\n\n isConnected(): boolean {\n return this.port.onMessage.hasListeners();\n }\n}\n"],"names":["root","factory","exports","module","require","define","amd","self","__WEBPACK_EXTERNAL_MODULE__9408__","__WEBPACK_EXTERNAL_MODULE__5192__","__WEBPACK_EXTERNAL_MODULE__3485__","__WEBPACK_EXTERNAL_MODULE__3783__","__WEBPACK_EXTERNAL_MODULE__79__","__WEBPACK_EXTERNAL_MODULE__7480__","__WEBPACK_EXTERNAL_MODULE__3983__","__WEBPACK_EXTERNAL_MODULE__7289__","__WEBPACK_EXTERNAL_MODULE__9882__","__WEBPACK_EXTERNAL_MODULE__1986__","__WEBPACK_EXTERNAL_MODULE__8236__","__WEBPACK_EXTERNAL_MODULE__7946__","__WEBPACK_EXTERNAL_MODULE__4711__","__WEBPACK_EXTERNAL_MODULE__5039__","__WEBPACK_EXTERNAL_MODULE__2716__","__WEBPACK_EXTERNAL_MODULE__8079__","__WEBPACK_EXTERNAL_MODULE__3735__","util","ADD64AA","v","a","b","o0","o1","ADD64AC","b0","b1","B2B_GET32","arr","i","B2B_G","c","d","ix","iy","x0","m","x1","y0","y1","xor0","xor1","BLAKE2B_IV32","Uint32Array","SIGMA82","Uint8Array","map","x","blake2bCompress","ctx","last","h","t","parameterBlock","blake2bInit","outlen","key","salt","personal","Error","length","fill","set","blake2bUpdate","input","blake2bFinal","out","blake2b","normalizeInput","blake2bHex","output","toHex","uint32ToHex","val","toString","substring","ret","TextEncoder","encode","bytes","Array","prototype","call","n","join","debugPrint","label","size","msg","toUpperCase","console","log","testSpeed","hashFn","N","M","startMs","Date","getTime","genMs","hashHex","hashMs","ms","Math","round","parent","entryVirtual","includes","isPrototypeOf","arrayMethod","stringMethod","ArrayPrototype","StringPrototype","String","it","own","Object","defineProperty","desc","sham","isCallable","tryToString","$TypeError","TypeError","argument","isObject","$String","toIndexedObject","toAbsoluteIndex","lengthOfArrayLike","createMethod","IS_INCLUDES","$this","el","fromIndex","value","O","index","indexOf","uncurryThis","stringSlice","slice","TO_STRING_TAG_SUPPORT","classofRaw","TO_STRING_TAG","wellKnownSymbol","$Object","CORRECT_ARGUMENTS","arguments","tag","result","undefined","error","tryGet","callee","MATCH","METHOD_NAME","regexp","error1","error2","DESCRIPTORS","definePropertyModule","createPropertyDescriptor","object","f","bitmap","enumerable","configurable","writable","global","fails","get","document","EXISTS","createElement","getBuiltIn","match","version","userAgent","process","Deno","versions","v8","split","path","CONSTRUCTOR","apply","getOwnPropertyDescriptor","isForced","bind","createNonEnumerableProperty","hasOwn","wrapConstructor","NativeConstructor","Wrapper","this","options","source","USE_NATIVE","VIRTUAL_PROTOTYPE","sourceProperty","targetProperty","nativeProperty","resultProperty","descriptor","TARGET","target","GLOBAL","STATIC","stat","PROTO","proto","nativeSource","targetPrototype","forced","dontCallGetSet","wrap","real","exec","NATIVE_BIND","FunctionPrototype","Function","Reflect","aCallable","fn","that","test","hasOwnProperty","aFunction","variable","namespace","method","V","P","func","check","globalThis","window","g","toObject","classof","propertyIsEnumerable","replacement","feature","detection","data","normalize","POLYFILL","NATIVE","string","replace","toLowerCase","isRegExp","USE_SYMBOL_AS_UID","$Symbol","toLength","obj","ceil","floor","trunc","V8_VERSION","getOwnPropertySymbols","symbol","Symbol","IE8_DOM_DEFINE","V8_PROTOTYPE_DEFINE_BUG","anObject","toPropertyKey","$defineProperty","$getOwnPropertyDescriptor","Attributes","current","propertyIsEnumerableModule","$propertyIsEnumerable","NASHORN_BUG","pref","valueOf","defineGlobalProperty","SHARED","store","IS_PURE","push","mode","copyright","license","toIntegerOrInfinity","max","min","integer","IndexedObject","requireObjectCoercible","number","isSymbol","getMethod","ordinaryToPrimitive","TO_PRIMITIVE","exoticToPrim","toPrimitive","id","postfix","random","NATIVE_SYMBOL","iterator","shared","uid","WellKnownSymbolsStore","symbolFor","createWellKnownSymbol","withoutSetter","name","description","$","$includes","addToUnscopables","notARegExp","correctIsRegExpLogic","stringIndexOf","searchString","create","ctor","superCtor","super_","constructor","TempCtor","buffer","Buffer","copyProps","src","dst","SafeBuffer","arg","encodingOrOffset","from","alloc","allocUnsafe","allocUnsafeSlow","encoding","buf","SlowBuffer","Hash","blockSize","finalSize","_block","_finalSize","_blockSize","_len","update","enc","block","accum","offset","assigned","remainder","_update","digest","rem","bits","writeUInt32BE","lowBits","highBits","hash","_hash","inherits","K","W","Sha256","init","_w","ch","y","z","maj","sigma0","sigma1","gamma0","_a","_b","_c","_d","_e","_f","_g","_h","e","readInt32BE","j","T1","T2","H","writeInt32BE","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","definition","o","prop","r","toStringTag","bigNumber","integerValue","BigNumber","BaseError","message","super","AccountError","AensError","AeppError","ChannelError","CompilerError","ContractError","CryptographyError","NodeError","TransactionError","WalletError","ArgumentError","argumentName","requirement","argumentValue","IllegalArgumentError","ArgumentCountMismatchError","functionName","requiredCount","providedCount","InsufficientBalanceError","MissingParamError","NoSerializerFoundError","RequestTimedOutError","height","TxTimedOutError","blocks","th","UnsupportedPlatformError","UnsupportedProtocolError","NotImplementedError","UnsupportedVersionError","dependency","geVersion","ltVersion","InternalError","UnexpectedTsError","InvalidKeypairError","UnavailableAccountError","address","AensPointerContextError","nameOrId","prefix","InsufficientNameFeeError","nameFee","minNameFee","InvalidAensNameError","InvalidRpcMessageError","MissingCallbackError","UnAuthorizedAccountError","onAccount","UnknownRpcClientError","UnsubscribedAccountError","ChannelCallError","ChannelConnectionError","ChannelPingTimedOutError","UnexpectedChannelMessageError","UnknownChannelStateError","InvalidAuthDataError","BytecodeMismatchError","DuplicateContractError","InactiveContractError","contractAddress","InvalidMethodInvocationError","MissingContractAddressError","MissingContractDefError","MissingFunctionNameError","NodeInvocationError","transaction","NoSuchContractFunctionError","NotPayableFunctionError","amount","MissingEventDefinitionError","eventNameHash","eventAddress","AmbiguousEventDefinitionError","matchedEvents","InvalidChecksumError","InvalidPasswordError","MerkleTreeHashMismatchError","MissingNodeInTreeError","UnknownNodeLengthError","nodeLength","UnknownPathNibbleError","nibble","DuplicateNodeError","NodeNotFoundError","DecodeError","PayloadLengthError","DryRunError","IllegalBidFeeError","InvalidSignatureError","InvalidTxParamsError","PrefixNotFoundError","SchemaNotFoundError","schemaName","TagNotFoundError","TxNotInChainError","txHash","UnknownTxError","UnsupportedABIversionError","UnsupportedVMversionError","AlreadyConnectedError","NoWalletConnectedError","RpcConnectionError","AE_AMOUNT_FORMATS","DENOMINATION_MAGNITUDE","AE","MILI_AE","MICRO_AE","NANO_AE","PICO_AE","FEMTO_AE","AETTOS","formatAmount","denomination","targetDenomination","isNaN","Number","isInteger","shiftedBy","toFixed","toAe","toAettos","isHex","str","bigNumberToByteArray","hexString","toBytes","big","str2buf","isBase64","bytesToHex","hexToBytes","s","pause","async","Promise","resolve","setTimeout","duration","mapObject","fromEntries","entries","concatBuffers","concat","list","totalLength","isKeyOfObject","Encoding","sha256hash","base64Types","ContractBytearray","ContractStoreKey","ContractStoreValue","Transaction","OracleQuery","OracleResponse","State","Poi","StateTrees","CallStateTree","Bytearray","base58Types","KeyBlockHash","MicroBlockHash","BlockPofHash","BlockTxHash","BlockStateHash","Channel","ContractAddress","TxHash","OracleAddress","OracleQueryId","AccountAddress","Signature","Commitment","PeerPubkey","Name","byteSizeForType","ensureValidLength","type","reqLen","getChecksum","payload","addChecksum","getPayload","equals","base64","decode","base58","bs58Encode","bs58Decode","parseType","maybeType","base64Type","find","base58Type","encodedPayload","extra","encoder","getAddressFromPriv","secret","secretBuffer","nacl","publicKey","isAddressValid","genSalt","MAX_SAFE_INTEGER","encodeUnsigned","binary","findIndex","encodeContractAddress","owner","nonce","generateKeyPairFromSecret","generateKeyPair","raw","keyPair","publicBuffer","secretKey","sign","privateKey","verify","signature","publicKeyBuffer","messageToHash","p","varuintEncode","signMessage","verifyMessage","isValidKeypair","NAME_TTL","NAME_MAX_TTL","NAME_MAX_CLIENT_TTL","CLIENT_TTL","MIN_GAS_PRICE","NAME_FEE_MULTIPLIER","NAME_FEE_BID_INCREMENT","NAME_BID_TIMEOUT_BLOCKS","NAME_MAX_LENGTH_FEE","NAME_BID_MAX_LENGTH","NAME_BID_RANGES","times","Tag","idTagToEncoding","writeId","hashId","item","array","idTag","readId","readUIntBE","buildContractId","ownerId","oracleQueryId","senderId","oracleId","nonceBE","_int32","formatSalt","padStart","produceNameId","commitmentHash","writeInt","readInt","buildPointers","pointers","readPointers","AENS_SUFFIX","isNameValid","endsWith","encodingToPointerKey","getDefaultPointerKey","identifier","getMinimumNameFee","nameLength","computeBidFee","startFee","increment","plus","computeAuctionEndBlock","claimHeight","isAuctionName","serialize","deserialize","uInt","serializeAettos","serializeOptional","coinAmount","getOracleRelativeTtl","params","txType","ttlKeys","OracleRegisterTx","OracleExtendTx","OracleQueryTx","OracleResponseTx","buildFee","buildTx","rlpEncoded","txObject","factor","ChannelForceProgressTx","ChannelOffChainTx","ChannelOffChainUpdateCallContract","ChannelOffChainUpdateCreateContract","ChannelOffChainUpdateDeposit","ChannelOffChainUpdateWithdraw","ChannelOffChainUpdateTransfer","ContractCreateTx","ContractCallTx","GaAttachTx","GaMetaTx","PayingForTx","TX_FEE_BASE_GAS","txSize","relativeTtl","innerTxSize","minus","TX_FEE_OTHER_GAS","tx","encodedTx","_value","rebuildTx","_computingMinFee","minFee","previousFee","fee","eq","calculateMinFee","gt","shortUInt","gasMax","_computingGasLimit","gasLimitMax","dividedBy","calculateGasLimitMax","gasLimit","field","txFields","_uInt","_shortUInt","_coinAmount","deposit","_deposit","_fee","_gasLimit","gasPrice","_gasPrice","_name","_nameFee","nameId","ORACLE_TTL_TYPES","TX_TTL","QUERY_FEE","ORACLE_TTL","delta","QUERY_TTL","RESPONSE_TTL","AMOUNT","MAX_AUTH_FUN_GAS","DRY_RUN_ACCOUNT","pub","VM_VERSIONS","ABI_VERSIONS","PROTOCOL_VERSIONS","PROTOCOL_VM_ABI","IRIS","vmVersion","FATE_2","abiVersion","FATE","SOPHIA","NO_ABI","FIELD_TYPES","BASE_TX","TX_SCHEMA","Account","SignedTx","signatures","rlpBinary","SpendTx","NamePreclaimTx","NameClaimTx","NameUpdateTx","NameTransferTx","NameRevokeTx","Contract","ctVersion","bool","ids","ContractCall","callReturnType","rawBinary","ttlType","ChannelCreateTx","ChannelCloseMutualTx","ChannelCloseSoloTx","ChannelSlashTx","ChannelDepositTx","ChannelWithdrawTx","ChannelSettleTx","stateTree","hex","ChannelSnapshotSoloTx","callStack","ChannelClientReconnectTx","TreesPoi","mptrees","Mtree","rlpBinaries","MtreeValue","ContractsMtree","CallsMtree","ChannelsMtree","NameserviceMtree","OraclesMtree","AccountsMtree","CompilerSophia","sophiaCodeTypeInfo","NodeType","MPTree","node","rlpEncode","rootHash","nodes","forEach","nodeHash","parseNode","Branch","filter","Extension","isEqual","tree","Leaf","mptHash","_key","searchFrom","deserializeField","vm","abi","unpackTx","offChainUpdates","reduce","acc","funHash","fnName","argType","outType","serializeField","validateField","prefixes","isArray","Boolean","some","validateParams","schema","excludeKeys","unpackRawTx","fieldType","assign","_params","vsn","schemas","keys","VSN","filteredSchema","valid","JSON","stringify","overrideParams","rlpDecode","objId","buildTxHash","rawTx","startsWith","buildContractIdByContractTx","contractTx","validators","getSenderAddress","verifyTransaction","parentTxTypes","account","consensusProtocolVersion","nodeNetworkId","all","getAccountByPubkey","catch","balance","then","getCurrentKeyBlockHeight","getNodeInfo","flat","_getPollInterval","_expectedMineRate","_microBlockCycle","_maxPollInterval","base","microblock","txWithNetworkId","txHashWithNetworkId","decodedPub","checkedKeys","ttl","cost","lte","validNonce","txProtocol","contractId","active","getContract","response","parsedBody","reason","InvalidTxError","validation","getHeight","onNode","poll","interval","getTransactionByHash","blockHeight","awaitHeight","currentHeight","waitForTxConfirm","confirm","newBlockHeight","sendTransaction","waitMined","__queue","postTransaction","requestOptions","customHeaders","pollResult","txData","confirmationHeight","verifyTx","getAccount","getAccountByPubkeyAndHeight","getAccountByPubkeyAndHash","getBalance","format","getCurrentGeneration","getGeneration","hashOrHeight","getGenerationByHeight","getGenerationByHash","getMicroBlockTransactions","getMicroBlockTransactionsByHash","transactions","getKeyBlock","getKeyBlockByHeight","getKeyBlockByHash","getMicroBlockHeader","getMicroBlockHeaderByHash","txDryRunRequests","Map","txDryRunHandler","rs","delete","dryRunRes","protectedDryRunTxs","top","txEvents","txs","req","accounts","Set","accountAddress","pubKey","reject","results","idx","resultPayload","txDryRun","combine","requests","timeout","getContractByteCode","getContractCode","getName","getNameEntryByName","resolveName","resolveByNode","pointer","DERIVED_KEY_FUNCTIONS","pass","memlimit_kib","mem","opslimit","time","hashLen","ArgonType","CRYPTO_FUNCTIONS","encrypt","decrypt","res","CRYPTO_DEFAULTS","secret_type","symmetric_alg","kdf","kdf_params","parallelism","plaintext","algo","deriveKey","password","kdfParams","recover","crypto","ciphertext","cipher_params","dump","opt","derivedKey","public_key","uuid","getVmVersion","supportedProtocol","protocolForTX","prepareTxParams","absoluteTtl","strategy","getAccountNextNonce","nextNonce","getCurrentKeyBlock","_buildTx","senderKey","extraParams","syncBuildTx","Ecb","aesjs","encryptKey","binaryData","hashedPasswordBytes","decryptKey","encrypted","encryptedBytes","DerivationError","ED25519_CURVE","HARDENED_OFFSET","deriveChild","chainCode","indexBuffer","I","hmac","derivePathFromKey","segments","fromString","toPathArray","segment","parentKey","getMasterKeyFromSeed","seed","derivePathFromSeed","masterKey","formatAccount","getKeyPair","generateSaveHDWalletFromSeed","walletKey","getSaveHDWalletAccounts","saveHDWallet","accountCount","_","getHdWalletAccountFromSeed","accountIdx","send","authFun","innerTx","signed","signTransaction","networkId","getStatus","spend","recipientIdOrName","recipientId","transferFunds","fraction","desiredAmount","payForTransaction","payerId","aensRevoke","accountId","aensUpdate","extendPointers","allPointers","clientTtl","nameTtl","aensTransfer","aensQuery","nameEntry","freeze","aensClaim","claimTx","nameSalt","nameInter","aensPreclaim","commitmentId","preclaimTx","opts","aensBid","getContractInstance","onCompiler","bytecode","aci","_aci","fileSystem","validateBytecode","otherOptions","generateACI","code","instance","encodedAci","contract","calldata","Calldata","externalEncodedAci","deployInfo","callStatic","_options","_fn","decodeEvents","_events","methods","onChanBytecode","validateByteCode","compile","compileContract","handleCallError","returnType","returnValue","decodeFateString","sendAndProcess","callInfo","getTransactionInfoByHash","getFunctionACI","functions","payable","getContractNameByEvent","nameHash","contractAddressToName","addressToName","event","variant","events","eventName","BigInt","calcHash","_estimateGas","gasUsed","deploy","callData","fnACI","callerId","txOpt","callObj","dryRunOther","decodedResult","returns","decodedEvents","omitUnknown","topics","contractName","decoded","decodeEvent","args","aciArgs","stateful","genHandler","pop","delegateSignatureCommon","createAensDelegationSignature","createOracleDelegationSignature","queryId","pollForQueries","onQuery","knownQueryIds","checkNewQueries","queries","getOracleQueriesByPubkey","oracleQueries","has","add","stopped","pollForQueryResponse","getOracleQueryByPubkeyAndQueryId","responseBuffer","getQueryObject","record","decodedQuery","query","decodedResponse","respond","respondToQuery","pollForResponse","postQueryToOracle","queryFee","getOracleByPubkey","oracleQueryTx","queryTtlType","queryTtlValue","responseTtlType","responseTtlValue","extendOracleTtl","oracleExtendTx","oracleTtlType","oracleTtlValue","getOracleObject","oracleRespondTx","pollQueries","postQuery","extendOracle","getQuery","handler","lastArg","registerOracle","queryFormat","responseFormat","oracleRegisterTx","isGA","createGeneralizedAccount","authFnName","gaContractId","createMetaTx","rawTransaction","authData","wrapInEmptySignedTx","authCallData","wrappedTx","gaId","metaTxRlp","buildAuthTxHash","signUsingGA","createSalt","GAS_MAX","TX_TYPE","ID_TAG","commitment","oracle","channel","PREFIX_ID_TAG","ak","nm","cm","ok","ct","ID_TAG_PREFIX","POINTER_KEY_BY_PREFIX","_defineProperty","genRequestQueuesPolicy","requestQueues","policy","request","next","headers","getResponse","position","genCombineGetRequestsPolicy","pendingGetRequests","url","body","genErrorFormatterPolicy","getMessage","RestError","bodyAsText","parse","URL","pathname","genVersionCheckPolicy","ignorePath","versionPromise","getComponents","versionComponents","geComponents","ltComponents","componentsToNumber","components","reverse","vNumber","geNumber","ltNumber","semverSatisfies","Header","className","modelProperties","serializedName","required","prevHash","prevKeyHash","stateHash","miner","beneficiary","pow","constraints","MinItems","MaxItems","element","info","pofHash","txsHash","ErrorModel","KeyBlock","HashResponse","HeightResponse","MicroBlockHeader","SignedTxs","blockHash","Tx","uberParent","polymorphicDiscriminator","clientName","initiatorId","initiatorAmount","responderId","responderAmount","channelReserve","lockPeriod","delegateIds","channelId","fromId","toId","offchainTrees","initiatorAmountFinal","responderAmountFinal","poi","initiatorDelegateIds","responderDelegateIds","oracleTtl","queryTtl","responseTtl","gas","Pattern","RegExp","allowedValues","Delegates","initiator","responder","OffChainUpdate","op","RelativeTTL","defaultValue","isConstant","Ttl","NamePointer","CountResponse","count","Generation","keyBlock","microBlocks","kind","NextNonceResponse","DryRunInput","DryRunAccount","DryRunInputItem","callReq","DryRunCallReq","caller","context","DryRunCallContext","DryRunResults","DryRunResult","ContractCallObject","callerNonce","Event","TxInfoObject","gaInfo","txInfo","GAObject","innerObject","EncodedTx","PostTxResponse","ContractObject","referrerIds","ByteCode","PoI","RegisteredOracle","OracleQueries","senderNonce","NameEntry","channelAmount","soloRound","lockedUntil","PeerPubKey","pubkey","Status","genesisKeyBlockHash","solutions","difficulty","syncing","syncProgress","InclusiveMaximum","InclusiveMinimum","listening","protocols","nodeVersion","nodeRevision","peerCount","peerConnections","pendingTransactionsCount","peerPubkey","topKeyBlockHash","topBlockHeight","Protocol","effectiveAtHeight","PeerConnections","inbound","outbound","OracleRespondTx","CommitmentId","NameHash","ChannelSetDelegatesTx","PubKey","PeerDetails","host","port","firstSeen","lastSeen","genesisHash","topHash","topDifficulty","nodeVendor","nodeOs","Peers","peers","blocked","PeerCount","connected","available","PeerCountConnected","PeerCountAvailable","verified","unverified","UnsignedTx","TokenSupply","contracts","contractOracles","locked","oracles","pendingRewards","total","GAAttachTx","GAMetaTx","CheckTxInPoolResponse","status","OffChainTransfer","to","OffChainWithdrawal","OffChainDeposit","OffChainNewContract","OffChainCallContract","CreateContractUnsignedTx","discriminators","accept","parameterPath","mapper","$host","skipEncoding","intAsString","contentType","DryRunInputMapper","body1","EncodedTxMapper","Node","coreClient","packageDetails","userAgentPrefix","userAgentOptions","optionsWithDefaults","requestContentType","baseUri","endpoint","pipeline","getOrderedPolicies","pipelinePolicy","coreRestPipeline","removePolicy","addPolicy","scopes","challengeCallbacks","authorizeRequestOnChallenge","getTopHeader","sendOperationRequest","getTopHeaderOperationSpec","getCurrentKeyBlockOperationSpec","getCurrentKeyBlockHash","getCurrentKeyBlockHashOperationSpec","getCurrentKeyBlockHeightOperationSpec","getPendingKeyBlock","getPendingKeyBlockOperationSpec","getKeyBlockByHashOperationSpec","getKeyBlockByHeightOperationSpec","getMicroBlockHeaderByHashOperationSpec","getMicroBlockTransactionsByHashOperationSpec","getMicroBlockTransactionByHashAndIndex","getMicroBlockTransactionByHashAndIndexOperationSpec","getMicroBlockTransactionsCountByHash","getMicroBlockTransactionsCountByHashOperationSpec","getCurrentGenerationOperationSpec","getGenerationByHashOperationSpec","getGenerationByHeightOperationSpec","getAccountByPubkeyOperationSpec","getAccountByPubkeyAndHeightOperationSpec","getAccountByPubkeyAndHashOperationSpec","getPendingAccountTransactionsByPubkey","getPendingAccountTransactionsByPubkeyOperationSpec","getAccountNextNonceOperationSpec","protectedDryRunTxsOperationSpec","getTransactionByHashOperationSpec","getTransactionInfoByHashOperationSpec","postTransactionOperationSpec","getContractOperationSpec","getContractCodeOperationSpec","getContractPoI","getContractPoIOperationSpec","getOracleByPubkeyOperationSpec","getOracleQueriesByPubkeyOperationSpec","getOracleQueryByPubkeyAndQueryIdOperationSpec","getNameEntryByNameOperationSpec","getChannelByPubkey","getChannelByPubkeyOperationSpec","getPeerPubkey","getPeerPubkeyOperationSpec","getStatusOperationSpec","getChainEnds","getChainEndsOperationSpec","serializer","Mappers","httpMethod","responses","bodyMapper","isError","queryParameters","Parameters","urlParameters","headerParameters","requestBody","mediaType","getNetworkId","api","bigIntPropertyNames","numberPropertyNames","NodeTransformed","NodeApi","operationArguments","operationSpec","transform","k","bigInt","ignoreVersion","allowInsecureConnection","additionalPolicies","AccountBase","rlpBinaryTx","returnHex","sig","verifyMessageCrypto","secrets","WeakMap","AccountMemory","keypair","isGa","isBuffer","CompileOpts","backend","srcFile","Aci","interface","pos","ErrorPos","col","file","line","APIVersion","apiVersion","ByteCodeInput","CompilerVersion","SophiaCallResultInput","callResult","callValue","function","BytecodeCallResultInput","DecodedCallresult","DecodeCalldataBytecode","DecodedCalldata","DecodeCalldataSource","SophiaBinaryData","sophiaType","SophiaJsonData","FunctionCallInput","FateAssembler","fateAssembler","ValidateByteCodeInput","ContractMapper","ByteCodeInputMapper","body2","SophiaCallResultInputMapper","body3","BytecodeCallResultInputMapper","body4","DecodeCalldataBytecodeMapper","body5","DecodeCalldataSourceMapper","body6","SophiaBinaryDataMapper","body7","FunctionCallInputMapper","body8","ValidateByteCodeInputMapper","Compiler","generateACIOperationSpec","apiOperationSpec","aPIVersion","aPIVersionOperationSpec","compileContractOperationSpec","getCompilerVersion","getCompilerVersionOperationSpec","decodeCallResult","decodeCallResultOperationSpec","decodeCallResultBytecode","decodeCallResultBytecodeOperationSpec","decodeCalldataBytecode","decodeCalldataBytecodeOperationSpec","decodeCalldataSource","decodeCalldataSourceOperationSpec","decodeData","decodeDataOperationSpec","encodeCalldata","encodeCalldataOperationSpec","getFateAssemblerCode","getFateAssemblerCodeOperationSpec","validateByteCodeOperationSpec","versionOperationSpec","CompilerApi","compilerUrl","parameter","trim","getValueOrErrorProxy","valueCb","Proxy","AeSdkBase","addNode","compilerApi","setCompilerUrl","ensureNodeConnected","pool","selectedNodeName","select","selectNode","isNodeConnected","addresses","_resolveAccount","MemoryAccount","_getOptions","txMethodsOther","txMethods","_2","chainMethodsOther","chainMethods","aensMethods","spendMethods","oracleMethods","contractMethods","contractGaMethods","deprecatedMethods","instanceOptions","AeSdk","selectedAddress","selectAccount","removeAccount","warn","MESSAGE_DIRECTION","WALLET_TYPE","SUBSCRIPTION_TYPES","METHODS","RPC_STATUS","rpcErrors","RpcError","toJSON","json","RpcErr","cl","RpcInvalidTransactionError","RpcBroadcastError","RpcRejectedByUserError","RpcUnsupportedProtocolError","RpcConnectionDenyError","RpcNotAuthorizeError","RpcPermissionDenyError","RpcInternalError","RpcMethodNotFoundError","AccountRpc","rpcClient","_rpcClient","_address","returnSigned","signedTransaction","_classExtractFieldDescriptor","receiver","privateMap","action","_classPrivateFieldGet","_classPrivateFieldSet","RpcClient","connection","onDisconnect","connect","notify","origin","jsonrpc","methodName","sendMessage","callbacks","AeSdkAepp","onAddressChange","onNetworkChange","other","_ensureAccountAccess","_accounts","disconnectParams","connectNode","client","updateAddress","updateNetwork","closeConnection","disconnect","readyToConnect","walletInfo","disconnectWallet","_ensureConnected","subscribeAddress","jsonBig","JsonBig","storeAsString","convertValuesToBigNumbers","bn","AeSdkWallet","onConnection","onSubscription","onSign","onAskAccounts","onMessageSign","_clients","_type","_pushAccountsToApps","clientId","_isRpcClientSubscribed","_getClient","rpc","getAccounts","addAccount","_getNode","_isRpcClientConnected","addressSubscription","CONNECTED","isConnected","_disconnectRpcClient","DISCONNECTED","removeRpcClient","addRpcClient","clientConnection","WAITING_FOR_CONNECTION_REQUEST","icons","getWalletInfo","subscribe","unsubscribe","subscription","overrides","transactionHash","location","state","fsm","websockets","eventEmitters","messageQueue","messageQueueLocked","actionQueue","actionQueueLocked","sequence","rpcCallbacks","pingTimeoutId","pongTimeoutId","fsmId","emit","rest","enterState","nextState","enter","dequeueAction","changeStatus","newStatus","changeState","newState","debug","queue","singleFsm","guard","enqueueAction","handleMessage","fsmState","st","close","pingTimeoutIdValue","pongTimeoutIdValue","clearTimeout","ping","currentSequence","details","initialize","connectionHandler","openHandler","channelOptions","EventEmitter","wsUrl","searchParams","ws","W3CWebSocket","onerror","onopen","reconnectTx","signedTx","signed_tx","onclose","onmessage","messages","shift","dequeueMessage","channel_id","callback","onMessage","appendSignature","signFn","handleUnexpectedMessage","_channel","wsMessage","channelOpen","awaitingConnection","channelInfoStatus","channel_accept","funding_created","awaitingChannelCreateTx","awaitingOpenConfirmation","fsm_id","channelClosed","awaitingReconnection","role","awaitingOnChainTx","awaitingBlockInclusion","own_funding_locked","funding_locked","awaitingInitialState","awaitingTxSignRequest","awaitingOffChainTx","updates","awaitingOffChainUpdate","accepted","errorCode","error_code","errorMessage","error_msg","awaitingUpdateConflict","awaitingShutdownTx","awaitingShutdownOnChainTx","awaitingLeave","awaitingWithdrawTx","awaitingWithdrawCompletion","onOnChainTx","own_withdraw_locked","onOwnWithdrawLocked","withdraw_locked","onWithdrawLocked","awaitingDepositTx","awaitingDepositCompletion","own_deposit_locked","onOwnDepositLocked","deposit_locked","onDepositLocked","awaitingNewContractTx","awaitingNewContractCompletion","awaitingCallContractUpdateTx","awaitingCallContractCompletion","awaitingCallContractForceProgressUpdate","awaitingForceProgressCompletion","awaitingCallsPruned","_channels","closeTx","snakeToPascalObjKeys","existingFsmId","handlers","on","eventEmitter","off","removeListener","channelDisconnect","channelStatus","channelState","channelFsmId","metadata","meta","call_data","vm_version","abi_version","contract_id","gas_price","caller_id","recipient","onStatusChanged","txParams","con1","con2","BrowserConnection","receiveMessage","BrowserWindowMessageConnection","sendDirection","receiveDirection","to_aepp","listener","addEventListener","removeEventListener","postMessage","onDetected","wallets","wallet","getConnection","isExtension","to_waellet","newWallet","BrowserRuntimeConnection","addListener","hasListeners"],"sourceRoot":""}
1
+ {"version":3,"file":"aepp-sdk.browser.js","mappings":";CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,UAAWA,QAAQ,gBAAiBA,QAAQ,OAAQA,QAAQ,QAASA,QAAQ,aAAcA,QAAQ,mBAAoBA,QAAQ,mBAAoBA,QAAQ,wDAAyDA,QAAQ,kBAAmBA,QAAQ,cAAeA,QAAQ,UAAWA,QAAQ,4BAA6BA,QAAQ,sBAAuBA,QAAQ,6BAA8BA,QAAQ,eAAgBA,QAAQ,aAAcA,QAAQ,WACjc,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,CAAC,SAAU,eAAgB,MAAO,OAAQ,YAAa,kBAAmB,kBAAmB,uDAAwD,iBAAkB,aAAc,SAAU,2BAA4B,qBAAsB,4BAA6B,cAAe,YAAa,UAAWJ,GAClS,iBAAZC,QACdA,QAAY,GAAID,EAAQG,QAAQ,UAAWA,QAAQ,gBAAiBA,QAAQ,OAAQA,QAAQ,QAASA,QAAQ,aAAcA,QAAQ,mBAAoBA,QAAQ,mBAAoBA,QAAQ,wDAAyDA,QAAQ,kBAAmBA,QAAQ,cAAeA,QAAQ,UAAWA,QAAQ,4BAA6BA,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Y,GAA8D,IAA9D,KAAE6kC,KAAS3sC,GAAmD,EACxEmN,MAAMnN,GACND,KAAK4sC,KAAOA,CACb,CAEDsT,aACE9yC,MAAM8yC,aACNlgD,KAAK4sC,KAAKsT,YACX,CAEDnB,QACE2H,EACA5H,GAEA1xC,MAAM2xC,QAAQ2H,EAAW5H,GACzB9+C,KAAK4sC,KAAK8Z,UAAUmG,aAAY,CAAC1/C,EAASy/B,KACxC5sC,KAAK4rD,eAAez+C,GACpBu5C,EAAUv5C,EAASy/B,EAAK1lC,KAAM0lC,EAA9B,IAEF5sC,KAAK4sC,KAAKkS,aAAa+N,YAAY/N,EACpC,CAEDM,YAAYjyC,GACVC,MAAMgyC,YAAYjyC,GAClBnN,KAAK4sC,KAAKwf,YAAYj/C,EACvB,CAED60C,cACE,OAAOhiD,KAAK4sC,KAAK8Z,UAAUoG,cAC5B","sources":["webpack://Ae/webpack/universalModuleDefinition","webpack://Ae/./node_modules/blakejs/blake2b.js","webpack://Ae/./node_modules/blakejs/util.js","webpack://Ae/./node_modules/core-js-pure/actual/object/define-property.js","webpack://Ae/./node_modules/core-js-pure/es/array/virtual/includes.js","webpack://Ae/./node_modules/core-js-pure/es/instance/includes.js","webpack://Ae/./node_modules/core-js-pure/es/object/define-property.js","webpack://Ae/./node_modules/core-js-pure/es/string/virtual/includes.js","webpack://Ae/./node_modules/core-js-pure/features/object/define-property.js","webpack://Ae/./node_modules/core-js-pure/full/object/define-property.js","webpack://Ae/./node_modules/core-js-pure/internals/a-callable.js","webpack://Ae/./node_modules/core-js-pure/internals/add-to-unscopables.js","webpack://Ae/./node_modules/core-js-pure/internals/an-object.js","webpack://Ae/./node_modules/core-js-pure/internals/array-includes.js","webpack://Ae/./node_modules/core-js-pure/internals/classof-raw.js","webpack://Ae/./node_modules/core-js-pure/internals/classof.js","webpack://Ae/./node_modules/core-js-pure/internals/correct-is-regexp-logic.js","webpack://Ae/./node_modules/core-js-pure/internals/create-non-enumerable-property.js","webpack://Ae/./node_modules/core-js-pure/internals/create-property-descriptor.js","webpack://Ae/./node_modules/core-js-pure/internals/define-global-property.js","webpack://Ae/./node_modules/core-js-pure/internals/descriptors.js","webpack://Ae/./node_modules/core-js-pure/internals/document-create-element.js","webpack://Ae/./node_modules/core-js-pure/internals/engine-user-agent.js","webpack://Ae/./node_modules/core-js-pure/internals/engine-v8-version.js","webpack://Ae/./node_modules/core-js-pure/internals/entry-virtual.js","webpack://Ae/./node_modules/core-js-pure/internals/export.js","webpack://Ae/./node_modules/core-js-pure/internals/fails.js","webpack://Ae/./node_modules/core-js-pure/internals/function-apply.js","webpack://Ae/./node_modules/core-js-pure/internals/function-bind-context.js","webpack://Ae/./node_modules/core-js-pure/internals/function-bind-native.js","webpack://Ae/./node_modules/core-js-pure/internals/function-call.js","webpack://Ae/./node_modules/core-js-pure/internals/function-uncurry-this.js","webpack://Ae/./node_modules/core-js-pure/internals/get-built-in.js","webpack://Ae/./node_modules/core-js-pure/internals/get-method.js","webpack://Ae/./node_modules/core-js-pure/internals/global.js","webpack://Ae/./node_modules/core-js-pure/internals/has-own-property.js","webpack://Ae/./node_modules/core-js-pure/internals/ie8-dom-define.js","webpack://Ae/./node_modules/core-js-pure/internals/indexed-object.js","webpack://Ae/./node_modules/core-js-pure/internals/is-callable.js","webpack://Ae/./node_modules/core-js-pure/internals/is-forced.js","webpack://Ae/./node_modules/core-js-pure/internals/is-object.js","webpack://Ae/./node_modules/core-js-pure/internals/is-pure.js","webpack://Ae/./node_modules/core-js-pure/internals/is-regexp.js","webpack://Ae/./node_modules/core-js-pure/internals/is-symbol.js","webpack://Ae/./node_modules/core-js-pure/internals/length-of-array-like.js","webpack://Ae/./node_modules/core-js-pure/internals/math-trunc.js","webpack://Ae/./node_modules/core-js-pure/internals/native-symbol.js","webpack://Ae/./node_modules/core-js-pure/internals/not-a-regexp.js","webpack://Ae/./node_modules/core-js-pure/internals/object-define-property.js","webpack://Ae/./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js","webpack://Ae/./node_modules/core-js-pure/internals/object-is-prototype-of.js","webpack://Ae/./node_modules/core-js-pure/internals/object-property-is-enumerable.js","webpack://Ae/./node_modules/core-js-pure/internals/ordinary-to-primitive.js","webpack://Ae/./node_modules/core-js-pure/internals/path.js","webpack://Ae/./node_modules/core-js-pure/internals/require-object-coercible.js","webpack://Ae/./node_modules/core-js-pure/internals/shared-store.js","webpack://Ae/./node_modules/core-js-pure/internals/shared.js","webpack://Ae/./node_modules/core-js-pure/internals/to-absolute-index.js","webpack://Ae/./node_modules/core-js-pure/internals/to-indexed-object.js","webpack://Ae/./node_modules/core-js-pure/internals/to-integer-or-infinity.js","webpack://Ae/./node_modules/core-js-pure/internals/to-length.js","webpack://Ae/./node_modules/core-js-pure/internals/to-object.js","webpack://Ae/./node_modules/core-js-pure/internals/to-primitive.js","webpack://Ae/./node_modules/core-js-pure/internals/to-property-key.js","webpack://Ae/./node_modules/core-js-pure/internals/to-string-tag-support.js","webpack://Ae/./node_modules/core-js-pure/internals/to-string.js","webpack://Ae/./node_modules/core-js-pure/internals/try-to-string.js","webpack://Ae/./node_modules/core-js-pure/internals/uid.js","webpack://Ae/./node_modules/core-js-pure/internals/use-symbol-as-uid.js","webpack://Ae/./node_modules/core-js-pure/internals/v8-prototype-define-bug.js","webpack://Ae/./node_modules/core-js-pure/internals/well-known-symbol.js","webpack://Ae/./node_modules/core-js-pure/modules/es.array.includes.js","webpack://Ae/./node_modules/core-js-pure/modules/es.object.define-property.js","webpack://Ae/./node_modules/core-js-pure/modules/es.string.includes.js","webpack://Ae/./node_modules/core-js-pure/stable/instance/includes.js","webpack://Ae/./node_modules/core-js-pure/stable/object/define-property.js","webpack://Ae/./node_modules/inherits/inherits_browser.js","webpack://Ae/./node_modules/safe-buffer/index.js","webpack://Ae/./node_modules/sha.js/hash.js","webpack://Ae/./node_modules/sha.js/sha256.js","webpack://Ae/external umd \"@aeternity/aepp-calldata\"","webpack://Ae/external umd \"@aeternity/argon2-browser/dist/argon2-bundled.min.js\"","webpack://Ae/external umd \"@aeternity/uuid\"","webpack://Ae/external umd \"@azure/core-client\"","webpack://Ae/external umd \"@azure/core-rest-pipeline\"","webpack://Ae/external umd \"aes-js\"","webpack://Ae/external umd \"bignumber.js\"","webpack://Ae/external umd \"bip32-path\"","webpack://Ae/external umd \"bs58\"","webpack://Ae/external umd \"buffer\"","webpack://Ae/external umd \"events\"","webpack://Ae/external umd \"json-bigint\"","webpack://Ae/external umd \"rlp\"","webpack://Ae/external umd \"tweetnacl\"","webpack://Ae/external umd \"tweetnacl-auth\"","webpack://Ae/external umd \"varuint-bitcoin\"","webpack://Ae/external umd \"websocket\"","webpack://Ae/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/includes.js","webpack://Ae/./node_modules/@babel/runtime-corejs3/core-js/object/define-property.js","webpack://Ae/webpack/bootstrap","webpack://Ae/webpack/runtime/compat get default export","webpack://Ae/webpack/runtime/define property getters","webpack://Ae/webpack/runtime/global","webpack://Ae/webpack/runtime/hasOwnProperty shorthand","webpack://Ae/webpack/runtime/make namespace object","webpack://Ae/./src/utils/bignumber.ts","webpack://Ae/./src/utils/errors.ts","webpack://Ae/./src/utils/amount-formatter.ts","webpack://Ae/./src/utils/string.ts","webpack://Ae/./src/utils/bytes.ts","webpack://Ae/./src/utils/other.ts","webpack://Ae/./src/utils/encoder-types.ts","webpack://Ae/./src/utils/encoder.ts","webpack://Ae/./src/utils/crypto.ts","webpack://Ae/./src/tx/builder/constants.ts","webpack://Ae/./src/tx/builder/address.ts","webpack://Ae/./src/tx/builder/helpers.ts","webpack://Ae/./src/tx/builder/field-types/u-int.ts","webpack://Ae/./src/tx/builder/field-types/short-u-int.ts","webpack://Ae/./src/tx/builder/field-types/coin-amount.ts","webpack://Ae/./src/tx/builder/field-types/deposit.ts","webpack://Ae/./src/tx/builder/field-types/fee.ts","webpack://Ae/./src/tx/builder/field-types/gas-limit.ts","webpack://Ae/./src/tx/builder/field-types/gas-price.ts","webpack://Ae/./src/tx/builder/field-types/field.ts","webpack://Ae/./src/tx/builder/field-types/name.ts","webpack://Ae/./src/tx/builder/field-types/name-fee.ts","webpack://Ae/./src/tx/builder/field-types/index.ts","webpack://Ae/./src/tx/builder/field-types/name-id.ts","webpack://Ae/./src/tx/builder/schema.ts","webpack://Ae/./src/utils/mptree.ts","webpack://Ae/./src/tx/builder/index.ts","webpack://Ae/./src/tx/validator.ts","webpack://Ae/./src/chain.ts","webpack://Ae/./src/utils/keystore.ts","webpack://Ae/./src/tx/index.ts","webpack://Ae/./src/utils/hd-wallet.ts","webpack://Ae/./src/spend.ts","webpack://Ae/./src/aens.ts","webpack://Ae/./src/contract/aci.ts","webpack://Ae/./src/contract/methods.ts","webpack://Ae/./src/oracle.ts","webpack://Ae/./src/contract/ga.ts","webpack://Ae/./src/deprecated/methods.ts","webpack://Ae/./src/deprecated/index.ts","webpack://Ae/./node_modules/@babel/runtime-corejs3/helpers/esm/defineProperty.js","webpack://Ae/./src/utils/autorest.ts","webpack://Ae/./src/utils/semver-satisfies.ts","webpack://Ae/./src/apis/node/models/mappers.ts","webpack://Ae/./src/apis/node/models/parameters.ts","webpack://Ae/./src/apis/node/node.ts","webpack://Ae/./src/Node.ts","webpack://Ae/./src/account/Base.ts","webpack://Ae/./src/account/Memory.ts","webpack://Ae/./src/apis/compiler/models/mappers.ts","webpack://Ae/./src/apis/compiler/models/parameters.ts","webpack://Ae/./src/apis/compiler/compiler.ts","webpack://Ae/./src/contract/Compiler.ts","webpack://Ae/./src/AeSdkBase.ts","webpack://Ae/./src/AeSdk.ts","webpack://Ae/./src/aepp-wallet-communication/schema.ts","webpack://Ae/./src/account/Rpc.ts","webpack://Ae/./node_modules/@babel/runtime-corejs3/helpers/esm/classExtractFieldDescriptor.js","webpack://Ae/./node_modules/@babel/runtime-corejs3/helpers/esm/classPrivateFieldGet.js","webpack://Ae/./node_modules/@babel/runtime-corejs3/helpers/esm/classApplyDescriptorGet.js","webpack://Ae/./node_modules/@babel/runtime-corejs3/helpers/esm/classPrivateFieldSet.js","webpack://Ae/./node_modules/@babel/runtime-corejs3/helpers/esm/classApplyDescriptorSet.js","webpack://Ae/./src/aepp-wallet-communication/rpc/RpcClient.ts","webpack://Ae/./src/AeSdkAepp.ts","webpack://Ae/./src/aepp-wallet-communication/rpc/types.ts","webpack://Ae/./src/utils/json-big.ts","webpack://Ae/./src/AeSdkWallet.ts","webpack://Ae/./src/channel/internal.ts","webpack://Ae/./src/channel/handlers.ts","webpack://Ae/./src/channel/index.ts","webpack://Ae/./src/aepp-wallet-communication/connection-proxy.ts","webpack://Ae/./src/aepp-wallet-communication/connection/Browser.ts","webpack://Ae/./src/aepp-wallet-communication/connection/BrowserWindowMessage.ts","webpack://Ae/./src/aepp-wallet-communication/wallet-detector.ts","webpack://Ae/./src/aepp-wallet-communication/connection/BrowserRuntime.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"buffer\"), require(\"bignumber.js\"), require(\"rlp\"), require(\"bs58\"), require(\"tweetnacl\"), require(\"varuint-bitcoin\"), require(\"@aeternity/uuid\"), require(\"@aeternity/argon2-browser/dist/argon2-bundled.min.js\"), require(\"tweetnacl-auth\"), require(\"bip32-path\"), require(\"aes-js\"), require(\"@aeternity/aepp-calldata\"), require(\"@azure/core-client\"), require(\"@azure/core-rest-pipeline\"), require(\"json-bigint\"), require(\"websocket\"), require(\"events\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"buffer\", \"bignumber.js\", \"rlp\", \"bs58\", \"tweetnacl\", \"varuint-bitcoin\", \"@aeternity/uuid\", \"@aeternity/argon2-browser/dist/argon2-bundled.min.js\", \"tweetnacl-auth\", \"bip32-path\", \"aes-js\", \"@aeternity/aepp-calldata\", \"@azure/core-client\", \"@azure/core-rest-pipeline\", \"json-bigint\", \"websocket\", \"events\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Ae\"] = factory(require(\"buffer\"), require(\"bignumber.js\"), require(\"rlp\"), require(\"bs58\"), require(\"tweetnacl\"), require(\"varuint-bitcoin\"), require(\"@aeternity/uuid\"), require(\"@aeternity/argon2-browser/dist/argon2-bundled.min.js\"), require(\"tweetnacl-auth\"), require(\"bip32-path\"), require(\"aes-js\"), require(\"@aeternity/aepp-calldata\"), require(\"@azure/core-client\"), require(\"@azure/core-rest-pipeline\"), require(\"json-bigint\"), require(\"websocket\"), require(\"events\"));\n\telse\n\t\troot[\"Ae\"] = factory(root[\"buffer\"], root[\"bignumber.js\"], root[\"rlp\"], root[\"bs58\"], root[\"tweetnacl\"], root[\"varuint-bitcoin\"], root[\"@aeternity/uuid\"], root[\"@aeternity/argon2-browser/dist/argon2-bundled.min.js\"], root[\"tweetnacl-auth\"], root[\"bip32-path\"], root[\"aes-js\"], root[\"@aeternity/aepp-calldata\"], root[\"@azure/core-client\"], root[\"@azure/core-rest-pipeline\"], root[\"json-bigint\"], root[\"websocket\"], root[\"events\"]);\n})(self, function(__WEBPACK_EXTERNAL_MODULE__9408__, __WEBPACK_EXTERNAL_MODULE__5192__, __WEBPACK_EXTERNAL_MODULE__3485__, __WEBPACK_EXTERNAL_MODULE__3783__, __WEBPACK_EXTERNAL_MODULE__79__, __WEBPACK_EXTERNAL_MODULE__7480__, __WEBPACK_EXTERNAL_MODULE__3983__, __WEBPACK_EXTERNAL_MODULE__7289__, __WEBPACK_EXTERNAL_MODULE__9882__, __WEBPACK_EXTERNAL_MODULE__1986__, __WEBPACK_EXTERNAL_MODULE__8236__, __WEBPACK_EXTERNAL_MODULE__7946__, __WEBPACK_EXTERNAL_MODULE__4711__, __WEBPACK_EXTERNAL_MODULE__5039__, __WEBPACK_EXTERNAL_MODULE__2716__, __WEBPACK_EXTERNAL_MODULE__8079__, __WEBPACK_EXTERNAL_MODULE__3735__) {\nreturn ","// Blake2B in pure Javascript\n// Adapted from the reference implementation in RFC7693\n// Ported to Javascript by DC - https://github.com/dcposch\n\nconst util = require('./util')\n\n// 64-bit unsigned addition\n// Sets v[a,a+1] += v[b,b+1]\n// v should be a Uint32Array\nfunction ADD64AA (v, a, b) {\n const o0 = v[a] + v[b]\n let o1 = v[a + 1] + v[b + 1]\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}\n\n// 64-bit unsigned addition\n// Sets v[a,a+1] += b\n// b0 is the low 32 bits of b, b1 represents the high 32 bits\nfunction ADD64AC (v, a, b0, b1) {\n let o0 = v[a] + b0\n if (b0 < 0) {\n o0 += 0x100000000\n }\n let o1 = v[a + 1] + b1\n if (o0 >= 0x100000000) {\n o1++\n }\n v[a] = o0\n v[a + 1] = o1\n}\n\n// Little-endian byte access\nfunction B2B_GET32 (arr, i) {\n return arr[i] ^ (arr[i + 1] << 8) ^ (arr[i + 2] << 16) ^ (arr[i + 3] << 24)\n}\n\n// G Mixing function\n// The ROTRs are inlined for speed\nfunction B2B_G (a, b, c, d, ix, iy) {\n const x0 = m[ix]\n const x1 = m[ix + 1]\n const y0 = m[iy]\n const y1 = m[iy + 1]\n\n ADD64AA(v, a, b) // v[a,a+1] += v[b,b+1] ... in JS we must store a uint64 as two uint32s\n ADD64AC(v, a, x0, x1) // v[a, a+1] += x ... x0 is the low 32 bits of x, x1 is the high 32 bits\n\n // v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated to the right by 32 bits\n let xor0 = v[d] ^ v[a]\n let xor1 = v[d + 1] ^ v[a + 1]\n v[d] = xor1\n v[d + 1] = xor0\n\n ADD64AA(v, c, d)\n\n // v[b,b+1] = (v[b,b+1] xor v[c,c+1]) rotated right by 24 bits\n xor0 = v[b] ^ v[c]\n xor1 = v[b + 1] ^ v[c + 1]\n v[b] = (xor0 >>> 24) ^ (xor1 << 8)\n v[b + 1] = (xor1 >>> 24) ^ (xor0 << 8)\n\n ADD64AA(v, a, b)\n ADD64AC(v, a, y0, y1)\n\n // v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated right by 16 bits\n xor0 = v[d] ^ v[a]\n xor1 = v[d + 1] ^ v[a + 1]\n v[d] = (xor0 >>> 16) ^ (xor1 << 16)\n v[d + 1] = (xor1 >>> 16) ^ (xor0 << 16)\n\n ADD64AA(v, c, d)\n\n // v[b,b+1] = (v[b,b+1] xor v[c,c+1]) rotated right by 63 bits\n xor0 = v[b] ^ v[c]\n xor1 = v[b + 1] ^ v[c + 1]\n v[b] = (xor1 >>> 31) ^ (xor0 << 1)\n v[b + 1] = (xor0 >>> 31) ^ (xor1 << 1)\n}\n\n// Initialization Vector\nconst BLAKE2B_IV32 = new Uint32Array([\n 0xf3bcc908, 0x6a09e667, 0x84caa73b, 0xbb67ae85, 0xfe94f82b, 0x3c6ef372,\n 0x5f1d36f1, 0xa54ff53a, 0xade682d1, 0x510e527f, 0x2b3e6c1f, 0x9b05688c,\n 0xfb41bd6b, 0x1f83d9ab, 0x137e2179, 0x5be0cd19\n])\n\nconst SIGMA8 = [\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 14, 10, 4, 8, 9, 15, 13,\n 6, 1, 12, 0, 2, 11, 7, 5, 3, 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1,\n 9, 4, 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8, 9, 0, 5, 7, 2, 4,\n 10, 15, 14, 1, 11, 12, 6, 8, 3, 13, 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5,\n 15, 14, 1, 9, 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11, 13, 11, 7,\n 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10, 6, 15, 14, 9, 11, 3, 0, 8, 12, 2,\n 13, 7, 1, 4, 10, 5, 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0, 0,\n 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 14, 10, 4, 8, 9, 15, 13, 6,\n 1, 12, 0, 2, 11, 7, 5, 3\n]\n\n// These are offsets into a uint64 buffer.\n// Multiply them all by 2 to make them offsets into a uint32 buffer,\n// because this is Javascript and we don't have uint64s\nconst SIGMA82 = new Uint8Array(\n SIGMA8.map(function (x) {\n return x * 2\n })\n)\n\n// Compression function. 'last' flag indicates last block.\n// Note we're representing 16 uint64s as 32 uint32s\nconst v = new Uint32Array(32)\nconst m = new Uint32Array(32)\nfunction blake2bCompress (ctx, last) {\n let i = 0\n\n // init work variables\n for (i = 0; i < 16; i++) {\n v[i] = ctx.h[i]\n v[i + 16] = BLAKE2B_IV32[i]\n }\n\n // low 64 bits of offset\n v[24] = v[24] ^ ctx.t\n v[25] = v[25] ^ (ctx.t / 0x100000000)\n // high 64 bits not supported, offset may not be higher than 2**53-1\n\n // last block flag set ?\n if (last) {\n v[28] = ~v[28]\n v[29] = ~v[29]\n }\n\n // get little-endian words\n for (i = 0; i < 32; i++) {\n m[i] = B2B_GET32(ctx.b, 4 * i)\n }\n\n // twelve rounds of mixing\n // uncomment the DebugPrint calls to log the computation\n // and match the RFC sample documentation\n // util.debugPrint(' m[16]', m, 64)\n for (i = 0; i < 12; i++) {\n // util.debugPrint(' (i=' + (i < 10 ? ' ' : '') + i + ') v[16]', v, 64)\n B2B_G(0, 8, 16, 24, SIGMA82[i * 16 + 0], SIGMA82[i * 16 + 1])\n B2B_G(2, 10, 18, 26, SIGMA82[i * 16 + 2], SIGMA82[i * 16 + 3])\n B2B_G(4, 12, 20, 28, SIGMA82[i * 16 + 4], SIGMA82[i * 16 + 5])\n B2B_G(6, 14, 22, 30, SIGMA82[i * 16 + 6], SIGMA82[i * 16 + 7])\n B2B_G(0, 10, 20, 30, SIGMA82[i * 16 + 8], SIGMA82[i * 16 + 9])\n B2B_G(2, 12, 22, 24, SIGMA82[i * 16 + 10], SIGMA82[i * 16 + 11])\n B2B_G(4, 14, 16, 26, SIGMA82[i * 16 + 12], SIGMA82[i * 16 + 13])\n B2B_G(6, 8, 18, 28, SIGMA82[i * 16 + 14], SIGMA82[i * 16 + 15])\n }\n // util.debugPrint(' (i=12) v[16]', v, 64)\n\n for (i = 0; i < 16; i++) {\n ctx.h[i] = ctx.h[i] ^ v[i] ^ v[i + 16]\n }\n // util.debugPrint('h[8]', ctx.h, 64)\n}\n\n// reusable parameterBlock\nconst parameterBlock = new Uint8Array([\n 0,\n 0,\n 0,\n 0, // 0: outlen, keylen, fanout, depth\n 0,\n 0,\n 0,\n 0, // 4: leaf length, sequential mode\n 0,\n 0,\n 0,\n 0, // 8: node offset\n 0,\n 0,\n 0,\n 0, // 12: node offset\n 0,\n 0,\n 0,\n 0, // 16: node depth, inner length, rfu\n 0,\n 0,\n 0,\n 0, // 20: rfu\n 0,\n 0,\n 0,\n 0, // 24: rfu\n 0,\n 0,\n 0,\n 0, // 28: rfu\n 0,\n 0,\n 0,\n 0, // 32: salt\n 0,\n 0,\n 0,\n 0, // 36: salt\n 0,\n 0,\n 0,\n 0, // 40: salt\n 0,\n 0,\n 0,\n 0, // 44: salt\n 0,\n 0,\n 0,\n 0, // 48: personal\n 0,\n 0,\n 0,\n 0, // 52: personal\n 0,\n 0,\n 0,\n 0, // 56: personal\n 0,\n 0,\n 0,\n 0 // 60: personal\n])\n\n// Creates a BLAKE2b hashing context\n// Requires an output length between 1 and 64 bytes\n// Takes an optional Uint8Array key\n// Takes an optinal Uint8Array salt\n// Takes an optinal Uint8Array personal\nfunction blake2bInit (outlen, key, salt, personal) {\n if (outlen === 0 || outlen > 64) {\n throw new Error('Illegal output length, expected 0 < length <= 64')\n }\n if (key && key.length > 64) {\n throw new Error('Illegal key, expected Uint8Array with 0 < length <= 64')\n }\n if (salt && salt.length !== 16) {\n throw new Error('Illegal salt, expected Uint8Array with length is 16')\n }\n if (personal && personal.length !== 16) {\n throw new Error('Illegal personal, expected Uint8Array with length is 16')\n }\n\n // state, 'param block'\n const ctx = {\n b: new Uint8Array(128),\n h: new Uint32Array(16),\n t: 0, // input count\n c: 0, // pointer within buffer\n outlen: outlen // output length in bytes\n }\n\n // initialize parameterBlock before usage\n parameterBlock.fill(0)\n parameterBlock[0] = outlen\n if (key) parameterBlock[1] = key.length\n parameterBlock[2] = 1 // fanout\n parameterBlock[3] = 1 // depth\n if (salt) parameterBlock.set(salt, 32)\n if (personal) parameterBlock.set(personal, 48)\n\n // initialize hash state\n for (let i = 0; i < 16; i++) {\n ctx.h[i] = BLAKE2B_IV32[i] ^ B2B_GET32(parameterBlock, i * 4)\n }\n\n // key the hash, if applicable\n if (key) {\n blake2bUpdate(ctx, key)\n // at the end\n ctx.c = 128\n }\n\n return ctx\n}\n\n// Updates a BLAKE2b streaming hash\n// Requires hash context and Uint8Array (byte array)\nfunction blake2bUpdate (ctx, input) {\n for (let i = 0; i < input.length; i++) {\n if (ctx.c === 128) {\n // buffer full ?\n ctx.t += ctx.c // add counters\n blake2bCompress(ctx, false) // compress (not last)\n ctx.c = 0 // counter to zero\n }\n ctx.b[ctx.c++] = input[i]\n }\n}\n\n// Completes a BLAKE2b streaming hash\n// Returns a Uint8Array containing the message digest\nfunction blake2bFinal (ctx) {\n ctx.t += ctx.c // mark last block offset\n\n while (ctx.c < 128) {\n // fill up with zeros\n ctx.b[ctx.c++] = 0\n }\n blake2bCompress(ctx, true) // final block flag = 1\n\n // little endian convert and store\n const out = new Uint8Array(ctx.outlen)\n for (let i = 0; i < ctx.outlen; i++) {\n out[i] = ctx.h[i >> 2] >> (8 * (i & 3))\n }\n return out\n}\n\n// Computes the BLAKE2B hash of a string or byte array, and returns a Uint8Array\n//\n// Returns a n-byte Uint8Array\n//\n// Parameters:\n// - input - the input bytes, as a string, Buffer or Uint8Array\n// - key - optional key Uint8Array, up to 64 bytes\n// - outlen - optional output length in bytes, default 64\n// - salt - optional salt bytes, string, Buffer or Uint8Array\n// - personal - optional personal bytes, string, Buffer or Uint8Array\nfunction blake2b (input, key, outlen, salt, personal) {\n // preprocess inputs\n outlen = outlen || 64\n input = util.normalizeInput(input)\n if (salt) {\n salt = util.normalizeInput(salt)\n }\n if (personal) {\n personal = util.normalizeInput(personal)\n }\n\n // do the math\n const ctx = blake2bInit(outlen, key, salt, personal)\n blake2bUpdate(ctx, input)\n return blake2bFinal(ctx)\n}\n\n// Computes the BLAKE2B hash of a string or byte array\n//\n// Returns an n-byte hash in hex, all lowercase\n//\n// Parameters:\n// - input - the input bytes, as a string, Buffer, or Uint8Array\n// - key - optional key Uint8Array, up to 64 bytes\n// - outlen - optional output length in bytes, default 64\n// - salt - optional salt bytes, string, Buffer or Uint8Array\n// - personal - optional personal bytes, string, Buffer or Uint8Array\nfunction blake2bHex (input, key, outlen, salt, personal) {\n const output = blake2b(input, key, outlen, salt, personal)\n return util.toHex(output)\n}\n\nmodule.exports = {\n blake2b: blake2b,\n blake2bHex: blake2bHex,\n blake2bInit: blake2bInit,\n blake2bUpdate: blake2bUpdate,\n blake2bFinal: blake2bFinal\n}\n","const ERROR_MSG_INPUT = 'Input must be an string, Buffer or Uint8Array'\n\n// For convenience, let people hash a string, not just a Uint8Array\nfunction normalizeInput (input) {\n let ret\n if (input instanceof Uint8Array) {\n ret = input\n } else if (typeof input === 'string') {\n const encoder = new TextEncoder()\n ret = encoder.encode(input)\n } else {\n throw new Error(ERROR_MSG_INPUT)\n }\n return ret\n}\n\n// Converts a Uint8Array to a hexadecimal string\n// For example, toHex([255, 0, 255]) returns \"ff00ff\"\nfunction toHex (bytes) {\n return Array.prototype.map\n .call(bytes, function (n) {\n return (n < 16 ? '0' : '') + n.toString(16)\n })\n .join('')\n}\n\n// Converts any value in [0...2^32-1] to an 8-character hex string\nfunction uint32ToHex (val) {\n return (0x100000000 + val).toString(16).substring(1)\n}\n\n// For debugging: prints out hash state in the same format as the RFC\n// sample computation exactly, so that you can diff\nfunction debugPrint (label, arr, size) {\n let msg = '\\n' + label + ' = '\n for (let i = 0; i < arr.length; i += 2) {\n if (size === 32) {\n msg += uint32ToHex(arr[i]).toUpperCase()\n msg += ' '\n msg += uint32ToHex(arr[i + 1]).toUpperCase()\n } else if (size === 64) {\n msg += uint32ToHex(arr[i + 1]).toUpperCase()\n msg += uint32ToHex(arr[i]).toUpperCase()\n } else throw new Error('Invalid size ' + size)\n if (i % 6 === 4) {\n msg += '\\n' + new Array(label.length + 4).join(' ')\n } else if (i < arr.length - 2) {\n msg += ' '\n }\n }\n console.log(msg)\n}\n\n// For performance testing: generates N bytes of input, hashes M times\n// Measures and prints MB/second hash performance each time\nfunction testSpeed (hashFn, N, M) {\n let startMs = new Date().getTime()\n\n const input = new Uint8Array(N)\n for (let i = 0; i < N; i++) {\n input[i] = i % 256\n }\n const genMs = new Date().getTime()\n console.log('Generated random input in ' + (genMs - startMs) + 'ms')\n startMs = genMs\n\n for (let i = 0; i < M; i++) {\n const hashHex = hashFn(input)\n const hashMs = new Date().getTime()\n const ms = hashMs - startMs\n startMs = hashMs\n console.log('Hashed in ' + ms + 'ms: ' + hashHex.substring(0, 20) + '...')\n console.log(\n Math.round((N / (1 << 20) / (ms / 1000)) * 100) / 100 + ' MB PER SECOND'\n )\n }\n}\n\nmodule.exports = {\n normalizeInput: normalizeInput,\n toHex: toHex,\n debugPrint: debugPrint,\n testSpeed: testSpeed\n}\n","var parent = require('../../stable/object/define-property');\n\nmodule.exports = parent;\n","require('../../../modules/es.array.includes');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').includes;\n","var isPrototypeOf = require('../../internals/object-is-prototype-of');\nvar arrayMethod = require('../array/virtual/includes');\nvar stringMethod = require('../string/virtual/includes');\n\nvar ArrayPrototype = Array.prototype;\nvar StringPrototype = String.prototype;\n\nmodule.exports = function (it) {\n var own = it.includes;\n if (it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.includes)) return arrayMethod;\n if (typeof it == 'string' || it === StringPrototype || (isPrototypeOf(StringPrototype, it) && own === StringPrototype.includes)) {\n return stringMethod;\n } return own;\n};\n","require('../../modules/es.object.define-property');\nvar path = require('../../internals/path');\n\nvar Object = path.Object;\n\nvar defineProperty = module.exports = function defineProperty(it, key, desc) {\n return Object.defineProperty(it, key, desc);\n};\n\nif (Object.defineProperty.sham) defineProperty.sham = true;\n","require('../../../modules/es.string.includes');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('String').includes;\n","module.exports = require('../../full/object/define-property');\n","var parent = require('../../actual/object/define-property');\n\nmodule.exports = parent;\n","var isCallable = require('../internals/is-callable');\nvar tryToString = require('../internals/try-to-string');\n\nvar $TypeError = TypeError;\n\n// `Assert: IsCallable(argument) is true`\nmodule.exports = function (argument) {\n if (isCallable(argument)) return argument;\n throw $TypeError(tryToString(argument) + ' is not a function');\n};\n","module.exports = function () { /* empty */ };\n","var isObject = require('../internals/is-object');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\n// `Assert: Type(argument) is Object`\nmodule.exports = function (argument) {\n if (isObject(argument)) return argument;\n throw $TypeError($String(argument) + ' is not an object');\n};\n","var toIndexedObject = require('../internals/to-indexed-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = lengthOfArrayLike(O);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare -- NaN check\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare -- NaN check\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.es/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.es/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nvar toString = uncurryThis({}.toString);\nvar stringSlice = uncurryThis(''.slice);\n\nmodule.exports = function (it) {\n return stringSlice(toString(it), 8, -1);\n};\n","var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar isCallable = require('../internals/is-callable');\nvar classofRaw = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar $Object = Object;\n\n// ES3 wrong here\nvar CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (error) { /* empty */ }\n};\n\n// getting tag from ES6+ `Object.prototype.toString`\nmodule.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {\n var O, tag, result;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag\n // builtinTag case\n : CORRECT_ARGUMENTS ? classofRaw(O)\n // ES3 arguments fallback\n : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar MATCH = wellKnownSymbol('match');\n\nmodule.exports = function (METHOD_NAME) {\n var regexp = /./;\n try {\n '/./'[METHOD_NAME](regexp);\n } catch (error1) {\n try {\n regexp[MATCH] = false;\n return '/./'[METHOD_NAME](regexp);\n } catch (error2) { /* empty */ }\n } return false;\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var global = require('../internals/global');\n\n// eslint-disable-next-line es-x/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\n\nmodule.exports = function (key, value) {\n try {\n defineProperty(global, key, { value: value, configurable: true, writable: true });\n } catch (error) {\n global[key] = value;\n } return value;\n};\n","var fails = require('../internals/fails');\n\n// Detect IE8's incomplete defineProperty implementation\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;\n});\n","var global = require('../internals/global');\nvar isObject = require('../internals/is-object');\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('navigator', 'userAgent') || '';\n","var global = require('../internals/global');\nvar userAgent = require('../internals/engine-user-agent');\n\nvar process = global.process;\nvar Deno = global.Deno;\nvar versions = process && process.versions || Deno && Deno.version;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n // in old Chrome, versions of V8 isn't V8 = Chrome / 10\n // but their correct versions are not interesting for us\n version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);\n}\n\n// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`\n// so check `userAgent` even if `.v8` exists, but 0\nif (!version && userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = +match[1];\n }\n}\n\nmodule.exports = version;\n","var path = require('../internals/path');\n\nmodule.exports = function (CONSTRUCTOR) {\n return path[CONSTRUCTOR + 'Prototype'];\n};\n","'use strict';\nvar global = require('../internals/global');\nvar apply = require('../internals/function-apply');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar isCallable = require('../internals/is-callable');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar isForced = require('../internals/is-forced');\nvar path = require('../internals/path');\nvar bind = require('../internals/function-bind-context');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar hasOwn = require('../internals/has-own-property');\n\nvar wrapConstructor = function (NativeConstructor) {\n var Wrapper = function (a, b, c) {\n if (this instanceof Wrapper) {\n switch (arguments.length) {\n case 0: return new NativeConstructor();\n case 1: return new NativeConstructor(a);\n case 2: return new NativeConstructor(a, b);\n } return new NativeConstructor(a, b, c);\n } return apply(NativeConstructor, this, arguments);\n };\n Wrapper.prototype = NativeConstructor.prototype;\n return Wrapper;\n};\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.dontCallGetSet - prevent calling a getter on target\n options.name - the .name of the function if it does not match the key\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var PROTO = options.proto;\n\n var nativeSource = GLOBAL ? global : STATIC ? global[TARGET] : (global[TARGET] || {}).prototype;\n\n var target = GLOBAL ? path : path[TARGET] || createNonEnumerableProperty(path, TARGET, {})[TARGET];\n var targetPrototype = target.prototype;\n\n var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;\n var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;\n\n for (key in source) {\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contains in native\n USE_NATIVE = !FORCED && nativeSource && hasOwn(nativeSource, key);\n\n targetProperty = target[key];\n\n if (USE_NATIVE) if (options.dontCallGetSet) {\n descriptor = getOwnPropertyDescriptor(nativeSource, key);\n nativeProperty = descriptor && descriptor.value;\n } else nativeProperty = nativeSource[key];\n\n // export native or implementation\n sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key];\n\n if (USE_NATIVE && typeof targetProperty == typeof sourceProperty) continue;\n\n // bind timers to global for call from export context\n if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, global);\n // wrap global constructors for prevent changs in this version\n else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);\n // make static versions for prototype methods\n else if (PROTO && isCallable(sourceProperty)) resultProperty = uncurryThis(sourceProperty);\n // default case\n else resultProperty = sourceProperty;\n\n // add a flag to not completely full polyfills\n if (options.sham || (sourceProperty && sourceProperty.sham) || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(resultProperty, 'sham', true);\n }\n\n createNonEnumerableProperty(target, key, resultProperty);\n\n if (PROTO) {\n VIRTUAL_PROTOTYPE = TARGET + 'Prototype';\n if (!hasOwn(path, VIRTUAL_PROTOTYPE)) {\n createNonEnumerableProperty(path, VIRTUAL_PROTOTYPE, {});\n }\n // export virtual prototype methods\n createNonEnumerableProperty(path[VIRTUAL_PROTOTYPE], key, sourceProperty);\n // export real prototype methods\n if (options.real && targetPrototype && !targetPrototype[key]) {\n createNonEnumerableProperty(targetPrototype, key, sourceProperty);\n }\n }\n }\n};\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n","var NATIVE_BIND = require('../internals/function-bind-native');\n\nvar FunctionPrototype = Function.prototype;\nvar apply = FunctionPrototype.apply;\nvar call = FunctionPrototype.call;\n\n// eslint-disable-next-line es-x/no-reflect -- safe\nmodule.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {\n return call.apply(apply, arguments);\n});\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar aCallable = require('../internals/a-callable');\nvar NATIVE_BIND = require('../internals/function-bind-native');\n\nvar bind = uncurryThis(uncurryThis.bind);\n\n// optional / simple context binding\nmodule.exports = function (fn, that) {\n aCallable(fn);\n return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","var fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es-x/no-function-prototype-bind -- safe\n var test = (function () { /* empty */ }).bind();\n // eslint-disable-next-line no-prototype-builtins -- safe\n return typeof test != 'function' || test.hasOwnProperty('prototype');\n});\n","var NATIVE_BIND = require('../internals/function-bind-native');\n\nvar call = Function.prototype.call;\n\nmodule.exports = NATIVE_BIND ? call.bind(call) : function () {\n return call.apply(call, arguments);\n};\n","var NATIVE_BIND = require('../internals/function-bind-native');\n\nvar FunctionPrototype = Function.prototype;\nvar bind = FunctionPrototype.bind;\nvar call = FunctionPrototype.call;\nvar uncurryThis = NATIVE_BIND && bind.bind(call, call);\n\nmodule.exports = NATIVE_BIND ? function (fn) {\n return fn && uncurryThis(fn);\n} : function (fn) {\n return fn && function () {\n return call.apply(fn, arguments);\n };\n};\n","var path = require('../internals/path');\nvar global = require('../internals/global');\nvar isCallable = require('../internals/is-callable');\n\nvar aFunction = function (variable) {\n return isCallable(variable) ? variable : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])\n : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];\n};\n","var aCallable = require('../internals/a-callable');\n\n// `GetMethod` abstract operation\n// https://tc39.es/ecma262/#sec-getmethod\nmodule.exports = function (V, P) {\n var func = V[P];\n return func == null ? undefined : aCallable(func);\n};\n","var check = function (it) {\n return it && it.Math == Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line es-x/no-global-this -- safe\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n // eslint-disable-next-line no-restricted-globals -- safe\n check(typeof self == 'object' && self) ||\n check(typeof global == 'object' && global) ||\n // eslint-disable-next-line no-new-func -- fallback\n (function () { return this; })() || Function('return this')();\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar toObject = require('../internals/to-object');\n\nvar hasOwnProperty = uncurryThis({}.hasOwnProperty);\n\n// `HasOwnProperty` abstract operation\n// https://tc39.es/ecma262/#sec-hasownproperty\n// eslint-disable-next-line es-x/no-object-hasown -- safe\nmodule.exports = Object.hasOwn || function hasOwn(it, key) {\n return hasOwnProperty(toObject(it), key);\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar createElement = require('../internals/document-create-element');\n\n// Thanks to IE8 for its funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a != 7;\n});\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\n\nvar $Object = Object;\nvar split = uncurryThis(''.split);\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins -- safe\n return !$Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) == 'String' ? split(it, '') : $Object(it);\n} : $Object;\n","// `IsCallable` abstract operation\n// https://tc39.es/ecma262/#sec-iscallable\nmodule.exports = function (argument) {\n return typeof argument == 'function';\n};\n","var fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value == POLYFILL ? true\n : value == NATIVE ? false\n : isCallable(detection) ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n","var isCallable = require('../internals/is-callable');\n\nmodule.exports = function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it);\n};\n","module.exports = true;\n","var isObject = require('../internals/is-object');\nvar classof = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar MATCH = wellKnownSymbol('match');\n\n// `IsRegExp` abstract operation\n// https://tc39.es/ecma262/#sec-isregexp\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');\n};\n","var getBuiltIn = require('../internals/get-built-in');\nvar isCallable = require('../internals/is-callable');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar $Object = Object;\n\nmodule.exports = USE_SYMBOL_AS_UID ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n var $Symbol = getBuiltIn('Symbol');\n return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));\n};\n","var toLength = require('../internals/to-length');\n\n// `LengthOfArrayLike` abstract operation\n// https://tc39.es/ecma262/#sec-lengthofarraylike\nmodule.exports = function (obj) {\n return toLength(obj.length);\n};\n","var ceil = Math.ceil;\nvar floor = Math.floor;\n\n// `Math.trunc` method\n// https://tc39.es/ecma262/#sec-math.trunc\n// eslint-disable-next-line es-x/no-math-trunc -- safe\nmodule.exports = Math.trunc || function trunc(x) {\n var n = +x;\n return (n > 0 ? floor : ceil)(n);\n};\n","/* eslint-disable es-x/no-symbol -- required for testing */\nvar V8_VERSION = require('../internals/engine-v8-version');\nvar fails = require('../internals/fails');\n\n// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n var symbol = Symbol();\n // Chrome 38 Symbol has incorrect toString conversion\n // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances\n return !String(symbol) || !(Object(symbol) instanceof Symbol) ||\n // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances\n !Symbol.sham && V8_VERSION && V8_VERSION < 41;\n});\n","var isRegExp = require('../internals/is-regexp');\n\nvar $TypeError = TypeError;\n\nmodule.exports = function (it) {\n if (isRegExp(it)) {\n throw $TypeError(\"The method doesn't accept regular expressions\");\n } return it;\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\nvar V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug');\nvar anObject = require('../internals/an-object');\nvar toPropertyKey = require('../internals/to-property-key');\n\nvar $TypeError = TypeError;\n// eslint-disable-next-line es-x/no-object-defineproperty -- safe\nvar $defineProperty = Object.defineProperty;\n// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar ENUMERABLE = 'enumerable';\nvar CONFIGURABLE = 'configurable';\nvar WRITABLE = 'writable';\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {\n var current = $getOwnPropertyDescriptor(O, P);\n if (current && current[WRITABLE]) {\n O[P] = Attributes.value;\n Attributes = {\n configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],\n enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],\n writable: false\n };\n }\n } return $defineProperty(O, P, Attributes);\n} : $defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return $defineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar call = require('../internals/function-call');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPropertyKey = require('../internals/to-property-key');\nvar hasOwn = require('../internals/has-own-property');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\n\n// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPropertyKey(P);\n if (IE8_DOM_DEFINE) try {\n return $getOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = uncurryThis({}.isPrototypeOf);\n","'use strict';\nvar $propertyIsEnumerable = {}.propertyIsEnumerable;\n// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : $propertyIsEnumerable;\n","var call = require('../internals/function-call');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\n\nvar $TypeError = TypeError;\n\n// `OrdinaryToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-ordinarytoprimitive\nmodule.exports = function (input, pref) {\n var fn, val;\n if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;\n if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n throw $TypeError(\"Can't convert object to primitive value\");\n};\n","module.exports = {};\n","var $TypeError = TypeError;\n\n// `RequireObjectCoercible` abstract operation\n// https://tc39.es/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n if (it == undefined) throw $TypeError(\"Can't call method on \" + it);\n return it;\n};\n","var global = require('../internals/global');\nvar defineGlobalProperty = require('../internals/define-global-property');\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || defineGlobalProperty(SHARED, {});\n\nmodule.exports = store;\n","var IS_PURE = require('../internals/is-pure');\nvar store = require('../internals/shared-store');\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.24.0',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',\n license: 'https://github.com/zloirock/core-js/blob/v3.24.0/LICENSE',\n source: 'https://github.com/zloirock/core-js'\n});\n","var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar max = Math.max;\nvar min = Math.min;\n\n// Helper for a popular repeating case of the spec:\n// Let integer be ? ToInteger(index).\n// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).\nmodule.exports = function (index, length) {\n var integer = toIntegerOrInfinity(index);\n return integer < 0 ? max(integer + length, 0) : min(integer, length);\n};\n","// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = require('../internals/indexed-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n","var trunc = require('../internals/math-trunc');\n\n// `ToIntegerOrInfinity` abstract operation\n// https://tc39.es/ecma262/#sec-tointegerorinfinity\nmodule.exports = function (argument) {\n var number = +argument;\n // eslint-disable-next-line no-self-compare -- NaN check\n return number !== number || number === 0 ? 0 : trunc(number);\n};\n","var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.es/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","var requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar $Object = Object;\n\n// `ToObject` abstract operation\n// https://tc39.es/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return $Object(requireObjectCoercible(argument));\n};\n","var call = require('../internals/function-call');\nvar isObject = require('../internals/is-object');\nvar isSymbol = require('../internals/is-symbol');\nvar getMethod = require('../internals/get-method');\nvar ordinaryToPrimitive = require('../internals/ordinary-to-primitive');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar $TypeError = TypeError;\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n// `ToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-toprimitive\nmodule.exports = function (input, pref) {\n if (!isObject(input) || isSymbol(input)) return input;\n var exoticToPrim = getMethod(input, TO_PRIMITIVE);\n var result;\n if (exoticToPrim) {\n if (pref === undefined) pref = 'default';\n result = call(exoticToPrim, input, pref);\n if (!isObject(result) || isSymbol(result)) return result;\n throw $TypeError(\"Can't convert object to primitive value\");\n }\n if (pref === undefined) pref = 'number';\n return ordinaryToPrimitive(input, pref);\n};\n","var toPrimitive = require('../internals/to-primitive');\nvar isSymbol = require('../internals/is-symbol');\n\n// `ToPropertyKey` abstract operation\n// https://tc39.es/ecma262/#sec-topropertykey\nmodule.exports = function (argument) {\n var key = toPrimitive(argument, 'string');\n return isSymbol(key) ? key : key + '';\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar test = {};\n\ntest[TO_STRING_TAG] = 'z';\n\nmodule.exports = String(test) === '[object z]';\n","var classof = require('../internals/classof');\n\nvar $String = String;\n\nmodule.exports = function (argument) {\n if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');\n return $String(argument);\n};\n","var $String = String;\n\nmodule.exports = function (argument) {\n try {\n return $String(argument);\n } catch (error) {\n return 'Object';\n }\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nvar id = 0;\nvar postfix = Math.random();\nvar toString = uncurryThis(1.0.toString);\n\nmodule.exports = function (key) {\n return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);\n};\n","/* eslint-disable es-x/no-symbol -- required for testing */\nvar NATIVE_SYMBOL = require('../internals/native-symbol');\n\nmodule.exports = NATIVE_SYMBOL\n && !Symbol.sham\n && typeof Symbol.iterator == 'symbol';\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\n\n// V8 ~ Chrome 36-\n// https://bugs.chromium.org/p/v8/issues/detail?id=3334\nmodule.exports = DESCRIPTORS && fails(function () {\n // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing\n return Object.defineProperty(function () { /* empty */ }, 'prototype', {\n value: 42,\n writable: false\n }).prototype != 42;\n});\n","var global = require('../internals/global');\nvar shared = require('../internals/shared');\nvar hasOwn = require('../internals/has-own-property');\nvar uid = require('../internals/uid');\nvar NATIVE_SYMBOL = require('../internals/native-symbol');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar WellKnownSymbolsStore = shared('wks');\nvar Symbol = global.Symbol;\nvar symbolFor = Symbol && Symbol['for'];\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {\n var description = 'Symbol.' + name;\n if (NATIVE_SYMBOL && hasOwn(Symbol, name)) {\n WellKnownSymbolsStore[name] = Symbol[name];\n } else if (USE_SYMBOL_AS_UID && symbolFor) {\n WellKnownSymbolsStore[name] = symbolFor(description);\n } else {\n WellKnownSymbolsStore[name] = createWellKnownSymbol(description);\n }\n } return WellKnownSymbolsStore[name];\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar $includes = require('../internals/array-includes').includes;\nvar fails = require('../internals/fails');\nvar addToUnscopables = require('../internals/add-to-unscopables');\n\n// FF99+ bug\nvar BROKEN_ON_SPARSE = fails(function () {\n return !Array(1).includes();\n});\n\n// `Array.prototype.includes` method\n// https://tc39.es/ecma262/#sec-array.prototype.includes\n$({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {\n includes: function includes(el /* , fromIndex = 0 */) {\n return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('includes');\n","var $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar defineProperty = require('../internals/object-define-property').f;\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\n// eslint-disable-next-line es-x/no-object-defineproperty -- safe\n$({ target: 'Object', stat: true, forced: Object.defineProperty !== defineProperty, sham: !DESCRIPTORS }, {\n defineProperty: defineProperty\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar notARegExp = require('../internals/not-a-regexp');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar toString = require('../internals/to-string');\nvar correctIsRegExpLogic = require('../internals/correct-is-regexp-logic');\n\nvar stringIndexOf = uncurryThis(''.indexOf);\n\n// `String.prototype.includes` method\n// https://tc39.es/ecma262/#sec-string.prototype.includes\n$({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {\n includes: function includes(searchString /* , position = 0 */) {\n return !!~stringIndexOf(\n toString(requireObjectCoercible(this)),\n toString(notARegExp(searchString)),\n arguments.length > 1 ? arguments[1] : undefined\n );\n }\n});\n","var parent = require('../../es/instance/includes');\n\nmodule.exports = parent;\n","var parent = require('../../es/object/define-property');\n\nmodule.exports = parent;\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */\n/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.prototype = Object.create(Buffer.prototype)\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","var Buffer = require('safe-buffer').Buffer\n\n// prototype class for hash functions\nfunction Hash (blockSize, finalSize) {\n this._block = Buffer.alloc(blockSize)\n this._finalSize = finalSize\n this._blockSize = blockSize\n this._len = 0\n}\n\nHash.prototype.update = function (data, enc) {\n if (typeof data === 'string') {\n enc = enc || 'utf8'\n data = Buffer.from(data, enc)\n }\n\n var block = this._block\n var blockSize = this._blockSize\n var length = data.length\n var accum = this._len\n\n for (var offset = 0; offset < length;) {\n var assigned = accum % blockSize\n var remainder = Math.min(length - offset, blockSize - assigned)\n\n for (var i = 0; i < remainder; i++) {\n block[assigned + i] = data[offset + i]\n }\n\n accum += remainder\n offset += remainder\n\n if ((accum % blockSize) === 0) {\n this._update(block)\n }\n }\n\n this._len += length\n return this\n}\n\nHash.prototype.digest = function (enc) {\n var rem = this._len % this._blockSize\n\n this._block[rem] = 0x80\n\n // zero (rem + 1) trailing bits, where (rem + 1) is the smallest\n // non-negative solution to the equation (length + 1 + (rem + 1)) === finalSize mod blockSize\n this._block.fill(0, rem + 1)\n\n if (rem >= this._finalSize) {\n this._update(this._block)\n this._block.fill(0)\n }\n\n var bits = this._len * 8\n\n // uint32\n if (bits <= 0xffffffff) {\n this._block.writeUInt32BE(bits, this._blockSize - 4)\n\n // uint64\n } else {\n var lowBits = (bits & 0xffffffff) >>> 0\n var highBits = (bits - lowBits) / 0x100000000\n\n this._block.writeUInt32BE(highBits, this._blockSize - 8)\n this._block.writeUInt32BE(lowBits, this._blockSize - 4)\n }\n\n this._update(this._block)\n var hash = this._hash()\n\n return enc ? hash.toString(enc) : hash\n}\n\nHash.prototype._update = function () {\n throw new Error('_update must be implemented by subclass')\n}\n\nmodule.exports = Hash\n","/**\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined\n * in FIPS 180-2\n * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n *\n */\n\nvar inherits = require('inherits')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar K = [\n 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,\n 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,\n 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,\n 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,\n 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,\n 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,\n 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,\n 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,\n 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,\n 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,\n 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,\n 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,\n 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,\n 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,\n 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,\n 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2\n]\n\nvar W = new Array(64)\n\nfunction Sha256 () {\n this.init()\n\n this._w = W // new Array(64)\n\n Hash.call(this, 64, 56)\n}\n\ninherits(Sha256, Hash)\n\nSha256.prototype.init = function () {\n this._a = 0x6a09e667\n this._b = 0xbb67ae85\n this._c = 0x3c6ef372\n this._d = 0xa54ff53a\n this._e = 0x510e527f\n this._f = 0x9b05688c\n this._g = 0x1f83d9ab\n this._h = 0x5be0cd19\n\n return this\n}\n\nfunction ch (x, y, z) {\n return z ^ (x & (y ^ z))\n}\n\nfunction maj (x, y, z) {\n return (x & y) | (z & (x | y))\n}\n\nfunction sigma0 (x) {\n return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10)\n}\n\nfunction sigma1 (x) {\n return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7)\n}\n\nfunction gamma0 (x) {\n return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3)\n}\n\nfunction gamma1 (x) {\n return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10)\n}\n\nSha256.prototype._update = function (M) {\n var W = this._w\n\n var a = this._a | 0\n var b = this._b | 0\n var c = this._c | 0\n var d = this._d | 0\n var e = this._e | 0\n var f = this._f | 0\n var g = this._g | 0\n var h = this._h | 0\n\n for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)\n for (; i < 64; ++i) W[i] = (gamma1(W[i - 2]) + W[i - 7] + gamma0(W[i - 15]) + W[i - 16]) | 0\n\n for (var j = 0; j < 64; ++j) {\n var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + W[j]) | 0\n var T2 = (sigma0(a) + maj(a, b, c)) | 0\n\n h = g\n g = f\n f = e\n e = (d + T1) | 0\n d = c\n c = b\n b = a\n a = (T1 + T2) | 0\n }\n\n this._a = (a + this._a) | 0\n this._b = (b + this._b) | 0\n this._c = (c + this._c) | 0\n this._d = (d + this._d) | 0\n this._e = (e + this._e) | 0\n this._f = (f + this._f) | 0\n this._g = (g + this._g) | 0\n this._h = (h + this._h) | 0\n}\n\nSha256.prototype._hash = function () {\n var H = Buffer.allocUnsafe(32)\n\n H.writeInt32BE(this._a, 0)\n H.writeInt32BE(this._b, 4)\n H.writeInt32BE(this._c, 8)\n H.writeInt32BE(this._d, 12)\n H.writeInt32BE(this._e, 16)\n H.writeInt32BE(this._f, 20)\n H.writeInt32BE(this._g, 24)\n H.writeInt32BE(this._h, 28)\n\n return H\n}\n\nmodule.exports = Sha256\n","module.exports = __WEBPACK_EXTERNAL_MODULE__7946__;","module.exports = __WEBPACK_EXTERNAL_MODULE__7289__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3983__;","module.exports = __WEBPACK_EXTERNAL_MODULE__4711__;","module.exports = __WEBPACK_EXTERNAL_MODULE__5039__;","module.exports = __WEBPACK_EXTERNAL_MODULE__8236__;","module.exports = __WEBPACK_EXTERNAL_MODULE__5192__;","module.exports = __WEBPACK_EXTERNAL_MODULE__1986__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3783__;","module.exports = __WEBPACK_EXTERNAL_MODULE__9408__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3735__;","module.exports = __WEBPACK_EXTERNAL_MODULE__2716__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3485__;","module.exports = __WEBPACK_EXTERNAL_MODULE__79__;","module.exports = __WEBPACK_EXTERNAL_MODULE__9882__;","module.exports = __WEBPACK_EXTERNAL_MODULE__7480__;","module.exports = __WEBPACK_EXTERNAL_MODULE__8079__;","module.exports = require(\"core-js-pure/stable/instance/includes\");","module.exports = require(\"core-js-pure/features/object/define-property\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Big Number Helpers\n */\nimport BigNumber from 'bignumber.js';\n\n/**\n * Check if value is BigNumber, Number, BigInt or number string representation\n * @param number - number to check\n */\nexport const isBigNumber = (number: string | number | bigint | BigNumber): boolean => {\n if (typeof number === 'bigint') return true;\n return ['number', 'object', 'string'].includes(typeof number)\n // eslint-disable-next-line no-restricted-globals\n && (!isNaN(number as number) || Number.isInteger(number) || BigNumber.isBigNumber(number));\n};\n\n/**\n * BigNumber ceil operation\n */\nexport const ceil = (bigNumber: BigNumber): BigNumber => bigNumber\n .integerValue(BigNumber.ROUND_CEIL);\n","// eslint-disable-next-line max-classes-per-file\nimport BigNumber from 'bignumber.js';\n\n/**\n * aepp-sdk originated error\n * @category exception\n */\nexport abstract class BaseError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'BaseError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AccountError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'AccountError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AensError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'AensError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AeppError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'AeppError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ChannelError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'ChannelError';\n }\n}\n\n/**\n * @category exception\n */\nexport class CompilerError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'CompilerError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ContractError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'ContractError';\n }\n}\n\n/**\n * @category exception\n */\nexport class CryptographyError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'CryptographyError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NodeError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'NodeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TransactionError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'TransactionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class WalletError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'WalletError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ArgumentError extends BaseError {\n constructor(argumentName: string, requirement: string, argumentValue: any) {\n super(`${argumentName} should be ${requirement}, got ${String(argumentValue)} instead`);\n this.name = 'ArgumentError';\n }\n}\n\n/**\n * @category exception\n */\nexport class IllegalArgumentError extends CryptographyError {\n constructor(message: string) {\n super(message);\n this.name = 'IllegalArgumentError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ArgumentCountMismatchError extends BaseError {\n constructor(functionName: string, requiredCount: number, providedCount: number) {\n super(`${functionName} expects ${requiredCount} arguments, got ${providedCount} instead`);\n this.name = 'ArgumentCountMismatchError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InsufficientBalanceError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'InsufficientBalanceError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingParamError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'MissingParamError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NoSerializerFoundError extends BaseError {\n constructor() {\n super('Byte serialization not supported');\n this.name = 'NoSerializerFoundError';\n }\n}\n\n/**\n * @category exception\n */\nexport class RequestTimedOutError extends BaseError {\n constructor(height: number) {\n super(`Giving up at height ${height}`);\n this.name = 'RequestTimedOutError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TxTimedOutError extends BaseError {\n constructor(blocks: number, th: string) {\n super([\n `Giving up after ${blocks} blocks mined`,\n `transaction hash: ${th}`,\n ].join(', '));\n this.name = 'TxTimedOutError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TypeError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'TypeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsupportedPlatformError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'UnsupportedPlatformError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsupportedProtocolError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'UnsupportedProtocolError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NotImplementedError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'NotImplementedError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsupportedVersionError extends BaseError {\n constructor(dependency: string, version: string, geVersion: string, ltVersion: string) {\n super(`Unsupported ${dependency} version ${version}. Supported: >= ${geVersion} < ${ltVersion}`);\n this.name = 'UnsupportedVersionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InternalError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'InternalError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnexpectedTsError extends InternalError {\n constructor(message = 'Expected to not happen, required for TS') {\n super(message);\n this.name = 'UnexpectedTsError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidKeypairError extends AccountError {\n constructor(message: string) {\n super(message);\n this.name = 'InvalidKeypairError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnavailableAccountError extends AccountError {\n constructor(address: string) {\n super(`Account for ${address} not available`);\n this.name = 'UnavailableAccountError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AensPointerContextError extends AensError {\n constructor(nameOrId: string, prefix: string) {\n super(`Name ${nameOrId} don't have pointers for ${prefix}`);\n this.name = 'AensPointerContextError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InsufficientNameFeeError extends AensError {\n constructor(nameFee: BigNumber, minNameFee: BigNumber) {\n super(`the provided fee ${nameFee.toString()} is not enough to execute the claim, required: ${minNameFee.toString()}`);\n this.name = 'InsufficientNameFeeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidAensNameError extends AensError {\n constructor(message: string) {\n super(message);\n this.name = 'InvalidAensNameError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidRpcMessageError extends AeppError {\n constructor(message: string) {\n super(`Received invalid message: ${message}`);\n this.name = 'InvalidRpcMessageError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingCallbackError extends AeppError {\n constructor(id: number) {\n super(`Can't find callback for this messageId ${id}`);\n this.name = 'MissingCallbackError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnAuthorizedAccountError extends AeppError {\n constructor(onAccount: string) {\n super(`You do not have access to account ${onAccount}`);\n this.name = 'UnAuthorizedAccountError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnknownRpcClientError extends AeppError {\n constructor(id: string) {\n super(`RpcClient with id ${id} do not exist`);\n this.name = 'UnknownRpcClientError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsubscribedAccountError extends AeppError {\n constructor() {\n super('You are not subscribed for an account.');\n this.name = 'UnsubscribedAccountError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ChannelCallError extends ChannelError {\n constructor(message: string) {\n super(message);\n this.name = 'ChannelCallError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ChannelConnectionError extends ChannelError {\n constructor(message: string) {\n super(message);\n this.name = 'ChannelConnectionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ChannelPingTimedOutError extends ChannelError {\n constructor() {\n super('Server pong timed out');\n this.name = 'ChannelPingTimedOutError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnexpectedChannelMessageError extends ChannelError {\n constructor(message: string) {\n super(message);\n this.name = 'UnexpectedChannelMessageError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnknownChannelStateError extends ChannelError {\n constructor() {\n super('State Channels FSM entered unknown state');\n this.name = 'UnknownChannelStateError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidAuthDataError extends CompilerError {\n constructor(message: string) {\n super(message);\n this.name = 'InvalidAuthDataError';\n }\n}\n\n/**\n * @category exception\n */\nexport class BytecodeMismatchError extends ContractError {\n constructor(source: string) {\n super(`Contract ${source} do not correspond to the bytecode deployed on the chain`);\n this.name = 'BytecodeMismatchError';\n }\n}\n\n/**\n * @category exception\n */\nexport class DuplicateContractError extends ContractError {\n constructor() {\n super('Contract already deployed');\n this.name = 'DuplicateContractError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InactiveContractError extends ContractError {\n constructor(contractAddress: string) {\n super(`Contract with address ${contractAddress} not active`);\n this.name = 'InactiveContractError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidMethodInvocationError extends ContractError {\n constructor(message: string) {\n super(message);\n this.name = 'InvalidMethodInvocationError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingContractAddressError extends ContractError {\n constructor(message: string) {\n super(message);\n this.name = 'MissingContractAddressError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingContractDefError extends ContractError {\n constructor() {\n super('Either ACI or source code is required');\n this.name = 'MissingContractDefError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingFunctionNameError extends ContractError {\n constructor() {\n super('Function name is required');\n this.name = 'MissingFunctionNameError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NodeInvocationError extends ContractError {\n transaction: string;\n\n constructor(message: string, transaction: string) {\n super(`Invocation failed${message == null ? '' : `: \"${message}\"`}`);\n this.name = 'NodeInvocationError';\n this.transaction = transaction;\n }\n}\n\n/**\n * @category exception\n */\nexport class NoSuchContractFunctionError extends ContractError {\n constructor(name: string) {\n super(`Function ${name} doesn't exist in contract`);\n this.name = 'NoSuchContractFunctionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NotPayableFunctionError extends ContractError {\n constructor(amount: string, fn: string) {\n super(\n `You try to pay \"${amount}\" to function \"${fn}\" which is not payable. `\n + 'Only payable function can accept coins',\n );\n this.name = 'NotPayableFunctionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingEventDefinitionError extends ContractError {\n constructor(eventNameHash: string, eventAddress: string) {\n super(\n `Can't find definition of ${eventNameHash} event emitted by ${eventAddress}`\n + ' (use omitUnknown option to ignore events like this)',\n );\n this.name = 'MissingEventDefinitionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AmbiguousEventDefinitionError extends ContractError {\n constructor(eventAddress: string, matchedEvents: Array<[string, string]>) {\n super(\n `Found multiple definitions of \"${matchedEvents[0][1]}\" event emitted by ${eventAddress}`\n + ` in ${matchedEvents.map(([name]) => `\"${name}\"`).join(', ')} contracts`\n + ' (use contractAddressToName option to specify contract name corresponding to address)',\n );\n this.name = 'AmbiguousEventDefinitionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidChecksumError extends CryptographyError {\n constructor() {\n super('Invalid checksum');\n this.name = 'InvalidChecksumError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidPasswordError extends CryptographyError {\n constructor() {\n super('Invalid password or nonce');\n this.name = 'InvalidPasswordError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MerkleTreeHashMismatchError extends CryptographyError {\n constructor() {\n super('Node hash is not equal to provided one');\n this.name = 'MerkleTreeHashMismatchError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingNodeInTreeError extends CryptographyError {\n constructor(message: string) {\n super(message);\n this.name = 'MissingNodeInTreeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnknownNodeLengthError extends CryptographyError {\n constructor(nodeLength: number) {\n super(`Unknown node length: ${nodeLength}`);\n this.name = 'UnknownNodeLengthError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnknownPathNibbleError extends CryptographyError {\n constructor(nibble: number) {\n super(`Unknown path nibble: ${nibble}`);\n this.name = 'UnknownPathNibbleError';\n }\n}\n\n/**\n * @category exception\n */\nexport class DuplicateNodeError extends NodeError {\n constructor(name: string) {\n super(`Node with name ${name} already exist`);\n this.name = 'DuplicateNodeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NodeNotFoundError extends NodeError {\n constructor(message: string) {\n super(message);\n this.name = 'NodeNotFoundError';\n }\n}\n\n/**\n * @category exception\n */\nexport class DecodeError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'DecodeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class PayloadLengthError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'PayloadLengthError';\n }\n}\n\n/**\n * @category exception\n */\nexport class DryRunError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'DryRunError';\n }\n}\n\n/**\n * @category exception\n */\nexport class IllegalBidFeeError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'IllegalBidFeeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidSignatureError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'InvalidSignatureError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidTxParamsError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'InvalidTxParamsError';\n }\n}\n\n/**\n * @category exception\n */\nexport class PrefixNotFoundError extends TransactionError {\n constructor(tag: number) {\n super(`Prefix for id-tag ${tag} not found.`);\n this.name = 'PrefixNotFoundError';\n }\n}\n\n/**\n * @category exception\n */\nexport class SchemaNotFoundError extends TransactionError {\n constructor(schemaName: string, key: string, version: number) {\n super(`Transaction ${schemaName} not implemented for ${key} version ${version}`);\n this.name = 'SchemaNotFoundError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TagNotFoundError extends TransactionError {\n constructor(prefix: string) {\n super(`Id tag for prefix ${prefix} not found.`);\n this.name = 'DecodeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TxNotInChainError extends TransactionError {\n constructor(txHash: string) {\n super(`Transaction ${txHash} is removed from chain`);\n this.name = 'TxNotInChainError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnknownTxError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'UnknownTxError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsupportedABIversionError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'UnsupportedABIversionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsupportedVMversionError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'UnsupportedVMversionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AlreadyConnectedError extends WalletError {\n constructor(message: string) {\n super(message);\n this.name = 'AlreadyConnectedError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NoWalletConnectedError extends WalletError {\n constructor(message: string) {\n super(message);\n this.name = 'NoWalletConnectedError';\n }\n}\n\n/**\n * @category exception\n */\nexport class RpcConnectionError extends WalletError {\n constructor(message: string) {\n super(message);\n this.name = 'RpcConnectionError';\n }\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2018 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport BigNumber from 'bignumber.js';\nimport { isBigNumber } from './bignumber';\nimport { ArgumentError } from './errors';\n\nexport enum AE_AMOUNT_FORMATS {\n AE = 'ae',\n MILI_AE = 'miliAE',\n MICRO_AE = 'microAE',\n NANO_AE = 'nanoAE',\n PICO_AE = 'picoAE',\n FEMTO_AE = 'femtoAE',\n AETTOS = 'aettos',\n}\n\n/**\n * DENOMINATION_MAGNITUDE\n */\nconst DENOMINATION_MAGNITUDE = {\n [AE_AMOUNT_FORMATS.AE]: 0,\n [AE_AMOUNT_FORMATS.MILI_AE]: -3,\n [AE_AMOUNT_FORMATS.MICRO_AE]: -6,\n [AE_AMOUNT_FORMATS.NANO_AE]: -9,\n [AE_AMOUNT_FORMATS.PICO_AE]: -12,\n [AE_AMOUNT_FORMATS.FEMTO_AE]: -15,\n [AE_AMOUNT_FORMATS.AETTOS]: -18,\n} as const;\n\n/**\n * Convert amount from one to other denomination\n * @param value - amount to convert\n * @param options - options\n * @param options.denomination - denomination of amount, can be ['ae', 'aettos']\n * @param options.targetDenomination - target denomination,\n * can be ['ae', 'aettos']\n */\nexport const formatAmount = (\n value: string | number | bigint | BigNumber,\n { denomination = AE_AMOUNT_FORMATS.AETTOS, targetDenomination = AE_AMOUNT_FORMATS.AETTOS }:\n { denomination?: AE_AMOUNT_FORMATS; targetDenomination?: AE_AMOUNT_FORMATS },\n): string => {\n if (!isBigNumber(value)) throw new ArgumentError('value', 'a number', value);\n\n return new BigNumber(typeof value === 'bigint' ? value.toString() : value)\n .shiftedBy(DENOMINATION_MAGNITUDE[denomination] - DENOMINATION_MAGNITUDE[targetDenomination])\n .toFixed();\n};\n\n/**\n * Convert amount to AE\n * @param value - amount to convert\n * @param options - options\n * @param options.denomination - denomination of amount, can be ['ae', 'aettos']\n */\nexport const toAe = (\n value: string | number | BigNumber,\n { denomination = AE_AMOUNT_FORMATS.AETTOS }: { denomination?: AE_AMOUNT_FORMATS } = {},\n): string => formatAmount(value, { denomination, targetDenomination: AE_AMOUNT_FORMATS.AE });\n\n/**\n * Convert amount to aettos\n * @param value - amount to convert\n * @param options - options\n * @param options.denomination - denomination of amount, can be ['ae', 'aettos']\n */\nexport const toAettos = (\n value: string | number | BigNumber,\n { denomination = AE_AMOUNT_FORMATS.AE }: { denomination?: AE_AMOUNT_FORMATS } = {},\n): string => formatAmount(value, { denomination });\n\ninterface Prefix {\n name: string;\n magnitude: number;\n}\n\nconst prefixes: Prefix[] = [\n { name: 'exa', magnitude: 18 },\n { name: 'giga', magnitude: 9 },\n { name: '', magnitude: 0 },\n { name: 'pico', magnitude: -12 },\n];\n\nconst getNearestPrefix = (exponent: number): Prefix => prefixes.reduce((p, n) => (\n Math.abs(n.magnitude - exponent) < Math.abs(p.magnitude - exponent) ? n : p));\n\nconst getLowerBoundPrefix = (exponent: number): Prefix => prefixes\n .find((p) => p.magnitude <= exponent) ?? prefixes[prefixes.length - 1];\n\nexport default (rawValue: string | number | BigNumber): string => {\n const value: BigNumber = new BigNumber(rawValue);\n\n const exp = value.e ?? 0;\n const { name, magnitude } = (exp < 0 ? getNearestPrefix : getLowerBoundPrefix)(exp);\n const v = value\n .shiftedBy(-magnitude)\n .precision(9 + Math.min(exp - magnitude, 0))\n .toFixed();\n return `${v}${name !== '' ? ' ' : ''}${name}`;\n};\n","/*\n * ISC License (ISC)\n * Copyright 2018 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\n/**\n * Convert string from snake_case to PascalCase\n * @param s - String to convert\n * @returns Converted string\n */\nexport function snakeToPascal(s: string): string {\n return s.replace(/_./g, (match) => match[1].toUpperCase());\n}\n\n/**\n * Convert string from PascalCase to snake_case\n * @param s - String to convert\n * @returns Converted string\n */\nexport function pascalToSnake(s: string): string {\n return s.replace(/[A-Z]/g, (match) => `_${match.toLowerCase()}`);\n}\n\n/**\n * Check whether a string is valid hex.\n * @param str - String to validate.\n * @returns True if the string is valid hex, false otherwise.\n */\nexport function isHex(str: string): boolean {\n return str.length % 2 === 0 && /^[0-9a-f]+$/i.test(str);\n}\n\n/**\n * Check whether a string is valid base-64.\n * @param str - String to validate.\n * @returns True if the string is valid base-64, false otherwise.\n */\nexport function isBase64(str: string): boolean {\n if (str.length % 4 > 0 || /[^0-9a-z+/=]/i.test(str)) return false;\n const index = str.indexOf('=');\n return index === -1 || /={1,2}/.test(str.slice(index));\n}\n","/*\n * ISC License (ISC)\n * Copyright 2018 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport BigNumber from 'bignumber.js';\nimport { NoSerializerFoundError, TypeError } from './errors';\nimport { isBase64, isHex } from './string';\n\n/**\n * Convert bignumber to byte array\n * @param x - bignumber instance\n * @returns Buffer\n */\nexport function bigNumberToByteArray(x: BigNumber): Buffer {\n if (!x.isInteger()) throw new TypeError(`Unexpected not integer value: ${x.toFixed()}`);\n let hexString = x.toString(16);\n if (hexString.length % 2 === 1) hexString = `0${hexString}`;\n return Buffer.from(hexString, 'hex');\n}\n\n/**\n * Convert string, number, or BigNumber to byte array\n * @param val - value to convert\n * @param big - enables force conversion to BigNumber\n * @returns Buffer\n */\nexport function toBytes(val?: null | string | number | BigNumber, big = false): Buffer {\n // Encode a value to bytes.\n // If the value is an int it will be encoded as bytes big endian\n // Raises ValueError if the input is not an int or string\n\n if (val === undefined || val === null) return Buffer.from([]);\n if (Number.isInteger(val) || BigNumber.isBigNumber(val) || big) {\n if (!BigNumber.isBigNumber(val)) val = new BigNumber(val);\n return bigNumberToByteArray(val);\n }\n if (typeof val === 'string') {\n return Buffer.from(val);\n }\n throw new NoSerializerFoundError();\n}\n\n/**\n * Convert a string to a Buffer. If encoding is not specified, hex-encoding\n * will be used if the input is valid hex. If the input is valid base64 but\n * not valid hex, base64 will be used. Otherwise, utf8 will be used.\n * @param str - String to be converted.\n * @param enc - Encoding of the input string.\n * @returns Buffer containing the input data.\n */\nexport function str2buf(str: string, enc?: BufferEncoding): Buffer {\n return Buffer.from(\n str,\n enc ?? (isHex(str) ? 'hex' : undefined) ?? (isBase64(str) ? 'base64' : undefined),\n );\n}\n\nexport const bytesToHex = (b: Uint8Array): string => Buffer.from(b).toString('hex');\n\nexport const hexToBytes = (s: string): Uint8Array => Buffer.from(s, 'hex');\n","export const pause = async (duration: number): Promise<void> => new Promise((resolve) => {\n setTimeout(resolve, duration);\n});\n\nexport const mapObject = <InputV, OutputV>(\n object: { [k: string]: InputV },\n fn: (\n value: [string, InputV], index: number, array: Array<[string, InputV]>\n ) => [number | string, OutputV],\n): { [k: string]: OutputV } => Object.fromEntries(Object.entries(object).map(fn));\n\n// remove after dropping webpack4 support\nconst isWebpack4Buffer = (() => {\n try {\n Buffer.concat([Uint8Array.from([])]);\n return false;\n } catch (error) {\n return true;\n }\n})();\n\nexport const concatBuffers = isWebpack4Buffer\n ? (list: readonly Uint8Array[], totalLength?: number): Buffer => (\n Buffer.concat(list.map((el) => Buffer.from(el)), totalLength)\n )\n : Buffer.concat;\n\n/**\n * Object key type guard\n * @param key - Maybe object key\n * @param object - Object\n */\nexport function isKeyOfObject<T>(key: string | number | symbol, object: T): key is keyof T {\n return key in object;\n}\n\n/**\n * Array item type guard\n * @param item - Maybe array item\n * @param array - Array\n */\nexport function isItemOfArray<T>(item: any, array: readonly T[]): item is T {\n return array.includes(item);\n}\n","/**\n * @category transaction builder\n * @see {@link https://github.com/aeternity/protocol/blob/master/node/api/api_encoding.md}\n * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_api_encoder.erl#L205-L230}\n */\nexport enum Encoding {\n KeyBlockHash = 'kh',\n MicroBlockHash = 'mh',\n BlockPofHash = 'bf',\n BlockTxHash = 'bx',\n BlockStateHash = 'bs',\n Channel = 'ch',\n ContractAddress = 'ct',\n ContractBytearray = 'cb',\n ContractStoreKey = 'ck',\n ContractStoreValue = 'cv',\n Transaction = 'tx',\n TxHash = 'th',\n OracleAddress = 'ok',\n OracleQuery = 'ov',\n OracleQueryId = 'oq',\n OracleResponse = 'or',\n AccountAddress = 'ak',\n Signature = 'sg',\n Commitment = 'cm',\n PeerPubkey = 'pp',\n Name = 'nm',\n State = 'st',\n Poi = 'pi',\n StateTrees = 'ss',\n CallStateTree = 'cs',\n Bytearray = 'ba',\n}\n\nexport type KeyBlockHash = `${Encoding.KeyBlockHash}_${string}`;\nexport type MicroBlockHash = `${Encoding.MicroBlockHash}_${string}`;\nexport type BlockPofHash = `${Encoding.BlockPofHash}_${string}`;\nexport type BlockTxHash = `${Encoding.BlockTxHash}_${string}`;\nexport type BlockStateHash = `${Encoding.BlockStateHash}_${string}`;\nexport type Channel = `${Encoding.Channel}_${string}`;\nexport type ContractAddress = `${Encoding.ContractAddress}_${string}`;\nexport type ContractBytearray = `${Encoding.ContractBytearray}_${string}`;\nexport type ContractStoreKey = `${Encoding.ContractStoreKey}_${string}`;\nexport type ContractStoreValue = `${Encoding.ContractStoreValue}_${string}`;\nexport type Transaction = `${Encoding.Transaction}_${string}`;\nexport type TxHash = `${Encoding.TxHash}_${string}`;\nexport type OracleAddress = `${Encoding.OracleAddress}_${string}`;\nexport type OracleQuery = `${Encoding.OracleQuery}_${string}`;\nexport type OracleQueryId = `${Encoding.OracleQueryId}_${string}`;\nexport type OracleResponse = `${Encoding.OracleResponse}_${string}`;\nexport type AccountAddress = `${Encoding.AccountAddress}_${string}`;\nexport type Signature = `${Encoding.Signature}_${string}`;\nexport type Commitment = `${Encoding.Commitment}_${string}`;\nexport type PeerPubkey = `${Encoding.PeerPubkey}_${string}`;\nexport type Name = `${Encoding.Name}_${string}`;\nexport type State = `${Encoding.State}_${string}`;\nexport type Poi = `${Encoding.Poi}_${string}`;\nexport type StateTrees = `${Encoding.StateTrees}_${string}`;\nexport type CallStateTree = `${Encoding.CallStateTree}_${string}`;\nexport type Bytearray = `${Encoding.Bytearray}_${string}`;\n\nexport type Generic<Type extends Encoding> = `${Type}_${string}`;\nexport type Any = `${Encoding}_${string}`;\n","import { encode as bs58Encode, decode as bs58Decode } from 'bs58';\n// js extension is required for mjs build, not importing the whole package to reduce bundle size\n// eslint-disable-next-line import/extensions\nimport Sha256 from 'sha.js/sha256.js';\nimport {\n DecodeError,\n ArgumentError,\n InvalidChecksumError,\n PayloadLengthError,\n} from './errors';\nimport { concatBuffers, isKeyOfObject } from './other';\nimport * as Encoded from './encoder-types';\nimport { Encoding } from './encoder-types';\n\nexport { Encoded, Encoding };\n\n/**\n * Calculate SHA256 hash of `input`\n * @param input - Data to hash\n * @returns Hash\n * @deprecated use `SubtleCrypto.digest` or `sha.js` package instead\n */\nexport function sha256hash(input: Uint8Array | string): Buffer {\n return new Sha256().update(input).digest();\n}\n\n/**\n * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_api_encoder.erl#L177-L202}\n */\nconst base64Types = [\n Encoding.ContractBytearray,\n Encoding.ContractStoreKey,\n Encoding.ContractStoreValue,\n Encoding.Transaction,\n Encoding.OracleQuery,\n Encoding.OracleResponse,\n Encoding.State,\n Encoding.Poi,\n Encoding.StateTrees,\n Encoding.CallStateTree,\n Encoding.Bytearray,\n] as const;\nconst base58Types = [\n Encoding.KeyBlockHash,\n Encoding.MicroBlockHash,\n Encoding.BlockPofHash,\n Encoding.BlockTxHash,\n Encoding.BlockStateHash,\n Encoding.Channel,\n Encoding.ContractAddress,\n Encoding.TxHash,\n Encoding.OracleAddress,\n Encoding.OracleQueryId,\n Encoding.AccountAddress,\n Encoding.Signature,\n Encoding.Commitment,\n Encoding.PeerPubkey,\n Encoding.Name,\n] as const;\n\n/**\n * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_api_encoder.erl#L261-L286}\n */\nconst byteSizeForType = {\n [Encoding.KeyBlockHash]: 32,\n [Encoding.MicroBlockHash]: 32,\n [Encoding.BlockPofHash]: 32,\n [Encoding.BlockTxHash]: 32,\n [Encoding.BlockStateHash]: 32,\n [Encoding.Channel]: 32,\n [Encoding.ContractAddress]: 32,\n [Encoding.TxHash]: 32,\n [Encoding.OracleAddress]: 32,\n [Encoding.OracleQueryId]: 32,\n [Encoding.AccountAddress]: 32,\n [Encoding.Signature]: 64,\n [Encoding.Commitment]: 32,\n [Encoding.PeerPubkey]: 32,\n [Encoding.State]: 32,\n} as const;\n\nfunction ensureValidLength(data: Uint8Array, type: Encoding): void {\n if (!isKeyOfObject(type, byteSizeForType)) return;\n const reqLen = byteSizeForType[type];\n if (reqLen == null || data.length === reqLen) return;\n throw new PayloadLengthError(`Payload should be ${reqLen} bytes, got ${data.length} instead`);\n}\n\nconst getChecksum = (payload: Uint8Array): Buffer => sha256hash(sha256hash(payload)).slice(0, 4);\n\nconst addChecksum = (payload: Uint8Array): Buffer => concatBuffers([payload, getChecksum(payload)]);\n\nfunction getPayload(buffer: Buffer): Buffer {\n const payload = buffer.slice(0, -4);\n if (!getChecksum(payload).equals(buffer.slice(-4))) throw new InvalidChecksumError();\n return payload;\n}\n\nconst base64 = {\n encode: (buffer: Uint8Array) => addChecksum(buffer).toString('base64'),\n decode: (string: string) => getPayload(Buffer.from(string, 'base64')),\n};\n\nconst base58 = {\n encode: (buffer: Uint8Array) => bs58Encode(addChecksum(buffer)),\n decode: (string: string) => getPayload(Buffer.from(bs58Decode(string))),\n};\n\nconst parseType = (maybeType: unknown): [Encoding, typeof base64] => {\n const base64Type = base64Types.find((t) => t === maybeType);\n if (base64Type != null) return [base64Type, base64];\n const base58Type = base58Types.find((t) => t === maybeType);\n if (base58Type != null) return [base58Type, base58];\n throw new ArgumentError('prefix', `one of ${[...base58Types, ...base64Types].join(', ')}`, maybeType);\n};\n\n/**\n * Decode data using the default encoding/decoding algorithm\n * @param data - An Base58/64check encoded and prefixed string\n * (ex tx_..., sg_..., ak_....)\n * @returns Decoded data\n */\nexport function decode(data: Encoded.Any): Buffer {\n const [prefix, encodedPayload, extra] = data.split('_');\n if (encodedPayload == null) throw new DecodeError(`Encoded string missing payload: ${data}`);\n if (extra != null) throw new DecodeError(`Encoded string have extra parts: ${data}`);\n const [type, encoder] = parseType(prefix);\n const payload = encoder.decode(encodedPayload);\n ensureValidLength(payload, type);\n return payload;\n}\n\n/**\n * Encode data using the default encoding/decoding algorithm\n * @param data - An decoded data\n * @param type - Prefix of Transaction\n * @returns Encoded string Base58check or Base64check data\n */\nexport function encode<Type extends Encoding>(\n data: Uint8Array,\n type: Type,\n): Encoded.Generic<Type> {\n const [, encoder] = parseType(type);\n ensureValidLength(data, type);\n return `${type}_${encoder.encode(data)}`;\n}\n","/*\n * ISC License (ISC)\n * Copyright 2018 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport nacl, { SignKeyPair } from 'tweetnacl';\n// js extension is required for mjs build, not importing the whole package to reduce bundle size\n// eslint-disable-next-line import/extensions\nimport { blake2b } from 'blakejs/blake2b.js';\nimport { encode as varuintEncode } from 'varuint-bitcoin';\n\nimport { str2buf } from './bytes';\nimport { concatBuffers } from './other';\nimport {\n decode, encode, Encoded, Encoding,\n} from './encoder';\n\n/**\n * Generate address from secret key\n * @param secret - Private key\n * @returns Public key encoded as address\n */\nexport function getAddressFromPriv(secret: string | Uint8Array): Encoded.AccountAddress {\n const secretBuffer = typeof secret === 'string' ? str2buf(secret) : secret;\n const keys = nacl.sign.keyPair.fromSecretKey(secretBuffer);\n return encode(keys.publicKey, Encoding.AccountAddress);\n}\n\n/**\n * Check if address is valid\n * @param address - Address\n * @param prefix - Transaction prefix. Default: 'ak'\n * @returns is valid\n */\nexport function isAddressValid(\n address: string,\n prefix: Encoding = Encoding.AccountAddress,\n): boolean {\n try {\n decode(address as Encoded.Generic<typeof prefix>);\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Generate a random salt (positive integer)\n * @returns random salt\n */\nexport function genSalt(): number {\n return Math.floor(Math.random() * Math.floor(Number.MAX_SAFE_INTEGER));\n}\n\n/**\n * Converts a positive integer to the smallest possible\n * representation in a binary digit representation\n * @param value - Value to encode\n * @returns Encoded number\n */\nexport function encodeUnsigned(value: number): Buffer {\n const binary = Buffer.allocUnsafe(4);\n binary.writeUInt32BE(value);\n return binary.slice(binary.findIndex((i) => i !== 0));\n}\n\n/**\n * Calculate 256bits Blake2b hash of `input`\n * @param input - Data to hash\n * @returns Hash\n */\nexport function hash(input: string | Uint8Array): Buffer {\n return Buffer.from(blake2b(input, undefined, 32)); // 256 bits\n}\n\n// Todo Duplicated in tx builder. remove\n/**\n * Compute contract address\n * @category contract\n * @param owner - Address of contract owner\n * @param nonce - Round when contract was created\n * @returns Contract address\n */\nexport function encodeContractAddress(\n owner: Encoded.AccountAddress,\n nonce: number,\n): Encoded.ContractAddress {\n const publicKey = decode(owner);\n const binary = concatBuffers([publicKey, encodeUnsigned(nonce)]);\n return encode(hash(binary), Encoding.ContractAddress);\n}\n\n// KEY-PAIR HELPERS\n\n/**\n * Generate keyPair from secret key\n * @param secret - secret key\n * @returns Object with Private(privateKey) and Public(publicKey) keys\n */\nexport function generateKeyPairFromSecret(secret: Uint8Array): SignKeyPair {\n return nacl.sign.keyPair.fromSecretKey(secret);\n}\n\n/**\n * Generate a random ED25519 keypair\n * @param raw - Whether to return raw (binary) keys\n * @returns Key pair\n */\nexport function generateKeyPair(raw: true): { publicKey: Buffer; secretKey: Buffer };\nexport function generateKeyPair(raw?: false): {\n publicKey: Encoded.AccountAddress; secretKey: string;\n};\nexport function generateKeyPair(raw = false): {\n publicKey: Encoded.AccountAddress | Buffer;\n secretKey: string | Buffer;\n} {\n const keyPair = nacl.sign.keyPair();\n const publicBuffer = Buffer.from(keyPair.publicKey);\n const secretBuffer = Buffer.from(keyPair.secretKey);\n\n if (raw) {\n return {\n publicKey: publicBuffer,\n secretKey: secretBuffer,\n };\n }\n return {\n publicKey: encode(publicBuffer, Encoding.AccountAddress),\n secretKey: secretBuffer.toString('hex'),\n };\n}\n\n// SIGNATURES\n\n/**\n * Generate signature\n * @param data - Data to sign\n * @param privateKey - Key to sign with\n * @returns Signature\n */\nexport function sign(data: string | Uint8Array, privateKey: string | Uint8Array): Uint8Array {\n return nacl.sign.detached(Buffer.from(data), Buffer.from(privateKey));\n}\n\n/**\n * Verify that signature was signed by public key\n * @param data - Data to verify\n * @param signature - Signature to verify\n * @param publicKey - Key to verify against\n * @returns Valid?\n */\nexport function verify(\n data: Uint8Array,\n signature: Uint8Array,\n publicKey: string | Uint8Array,\n): boolean {\n const publicKeyBuffer = typeof publicKey === 'string' ? str2buf(publicKey) : publicKey;\n return nacl.sign.detached.verify(data, signature, publicKeyBuffer);\n}\n\nexport function messageToHash(message: string): Buffer {\n const p = Buffer.from('aeternity Signed Message:\\n', 'utf8');\n const msg = Buffer.from(message, 'utf8');\n return hash(concatBuffers([varuintEncode(p.length), p, varuintEncode(msg.length), msg]));\n}\n\nexport function signMessage(message: string, privateKey: string | Buffer): Uint8Array {\n return sign(messageToHash(message), privateKey);\n}\n\nexport function verifyMessage(\n str: string,\n signature: Uint8Array,\n publicKey: string | Uint8Array,\n): boolean {\n return verify(messageToHash(str), signature, publicKey);\n}\n\n/**\n * Check key pair for validity\n *\n * Sign a message, and then verifying that signature\n * @param privateKey - Private key to verify\n * @param publicKey - Public key to verify\n * @returns Valid?\n */\nexport function isValidKeypair(\n privateKey: string | Uint8Array,\n publicKey: string | Uint8Array,\n): boolean {\n const message = Buffer.from('TheMessage');\n const signature = sign(message, privateKey);\n return verify(message, signature, publicKey);\n}\n","import BigNumber from 'bignumber.js';\nimport { mapObject } from '../../utils/other';\n\n// # AENS\nexport type AensName = `${string}.chain`;\nexport const NAME_TTL = 180000;\n// # max number of block into the future that the name is going to be available\n// # https://github.com/aeternity/protocol/blob/epoch-v0.22.0/AENS.md#update\n// # https://github.com/aeternity/protocol/blob/44a93d3aab957ca820183c3520b9daf6b0fedff4/AENS.md#aens-entry\nexport const NAME_MAX_TTL = 36000;\nexport const NAME_MAX_CLIENT_TTL = 84600;\nexport const CLIENT_TTL = NAME_MAX_CLIENT_TTL;\nexport const MIN_GAS_PRICE = 1e9;\n// # see https://github.com/aeternity/aeternity/blob/72e440b8731422e335f879a31ecbbee7ac23a1cf/apps/aecore/src/aec_governance.erl#L67\nexport const NAME_FEE_MULTIPLIER = 1e14; // 100000000000000\nexport const NAME_FEE_BID_INCREMENT = 0.05; // # the increment is in percentage\n// # see https://github.com/aeternity/aeternity/blob/72e440b8731422e335f879a31ecbbee7ac23a1cf/apps/aecore/src/aec_governance.erl#L272\nexport const NAME_BID_TIMEOUT_BLOCKS = 480; // # ~1 day\n// # this is the max length for a domain that requires a base fee to be paid\nexport const NAME_MAX_LENGTH_FEE = 31;\nexport const NAME_BID_MAX_LENGTH = 12; // # this is the max length for a domain to be part of a bid\n// # https://github.com/aeternity/aeternity/blob/72e440b8731422e335f879a31ecbbee7ac23a1cf/apps/aecore/src/aec_governance.erl#L290\n// # https://github.com/aeternity/protocol/blob/master/AENS.md#protocol-fees-and-protection-times\n// # bid ranges:\nexport const NAME_BID_RANGES = mapObject({\n 31: 3,\n 30: 5,\n 29: 8,\n 28: 13,\n 27: 21,\n 26: 34,\n 25: 55,\n 24: 89,\n 23: 144,\n 22: 233,\n 21: 377,\n 20: 610,\n 19: 987,\n 18: 1597,\n 17: 2584,\n 16: 4181,\n 15: 6765,\n 14: 10946,\n 13: 17711,\n 12: 28657,\n 11: 46368,\n 10: 75025,\n 9: 121393,\n 8: 196418,\n 7: 317811,\n 6: 514229,\n 5: 832040,\n 4: 1346269,\n 3: 2178309,\n 2: 3524578,\n 1: 5702887,\n}, ([key, value]) => [key, new BigNumber(value).times(NAME_FEE_MULTIPLIER)]);\n\n/**\n * Enum with tag types\n * @category transaction builder\n * @see {@link https://github.com/aeternity/protocol/blob/0f6dee3d9d1e8e2469816798f5c7587a6c918f94/serializations.md#binary-serialization}\n * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_chain_objects.erl#L39-L97}\n */\n// TODO: implement serialisation for commented-out tags\nexport enum Tag {\n Account = 10,\n SignedTx = 11,\n SpendTx = 12,\n // Oracle = 20,\n // OracleQuery = 21,\n OracleRegisterTx = 22,\n OracleQueryTx = 23,\n OracleResponseTx = 24,\n OracleExtendTx = 25,\n // Name = 30,\n // NameCommitment = 31,\n NameClaimTx = 32,\n NamePreclaimTx = 33,\n NameUpdateTx = 34,\n NameRevokeTx = 35,\n NameTransferTx = 36,\n // NameAuction = 37,\n Contract = 40,\n ContractCall = 41,\n ContractCreateTx = 42,\n ContractCallTx = 43,\n ChannelCreateTx = 50,\n // ChannelSetDelegatesTx = 501,\n ChannelDepositTx = 51,\n ChannelWithdrawTx = 52,\n ChannelForceProgressTx = 521,\n ChannelCloseMutualTx = 53,\n ChannelCloseSoloTx = 54,\n ChannelSlashTx = 55,\n ChannelSettleTx = 56,\n ChannelOffChainTx = 57,\n ChannelOffChainUpdateTransfer = 570,\n ChannelOffChainUpdateDeposit = 571,\n ChannelOffChainUpdateWithdraw = 572,\n ChannelOffChainUpdateCreateContract = 573,\n ChannelOffChainUpdateCallContract = 574,\n // ChannelOffChainUpdateMeta = 576,\n ChannelClientReconnectTx = 575,\n Channel = 58,\n ChannelSnapshotSoloTx = 59,\n TreesPoi = 60,\n // TreesDb = 61,\n StateTrees = 62,\n Mtree = 63,\n MtreeValue = 64,\n ContractsMtree = 621,\n CallsMtree = 622,\n ChannelsMtree = 623,\n NameserviceMtree = 624,\n OraclesMtree = 625,\n AccountsMtree = 626,\n CompilerSophia = 70,\n GaAttachTx = 80,\n GaMetaTx = 81,\n PayingForTx = 82,\n // KeyBlock = 100,\n // MicroBlock = 101,\n // LightMicroBlock = 102,\n // Pof = 200,\n}\n","import { ArgumentError, PrefixNotFoundError, TagNotFoundError } from '../../utils/errors';\nimport { toBytes } from '../../utils/bytes';\nimport {\n decode, encode, Encoded, Encoding,\n} from '../../utils/encoder';\nimport { isItemOfArray } from '../../utils/other';\n\n/**\n * Map of prefix to ID tag constant\n * @see {@link https://github.com/aeternity/protocol/blob/master/serializations.md#the-id-type}\n * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_id.erl#L97-L102}\n * @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_api_encoder.erl#L163-L168}\n */\nconst idTagToEncoding = [\n Encoding.AccountAddress,\n Encoding.Name,\n Encoding.Commitment,\n Encoding.OracleAddress,\n Encoding.ContractAddress,\n Encoding.Channel,\n] as const;\n\ntype AddressEncodings = typeof idTagToEncoding[number];\n\n/**\n * Utility function to create and _id type\n * @category transaction builder\n * @param hashId - Encoded hash\n * @returns Buffer Buffer with ID tag and decoded HASh\n */\nexport function writeId(hashId: Encoded.Generic<AddressEncodings>): Buffer {\n if (typeof hashId !== 'string') throw new ArgumentError('hashId', 'a string', hashId);\n const encoding = hashId.slice(0, 2);\n if (!isItemOfArray(encoding, idTagToEncoding)) throw new TagNotFoundError(encoding);\n const idTag = idTagToEncoding.indexOf(encoding) + 1;\n return Buffer.from([...toBytes(idTag), ...decode(hashId)]);\n}\n\n/**\n * Utility function to read and _id type\n * @category transaction builder\n * @param buf - Data\n * @returns Encoided hash string with prefix\n */\nexport function readId(buf: Buffer): Encoded.Generic<AddressEncodings> {\n const idTag = Buffer.from(buf).readUIntBE(0, 1);\n const encoding = idTagToEncoding[idTag - 1];\n if (encoding == null) throw new PrefixNotFoundError(idTag);\n return encode(buf.slice(1, buf.length), encoding);\n}\n","import BigNumber from 'bignumber.js';\nimport { genSalt, hash } from '../../utils/crypto';\nimport {\n decode, encode, Encoded, Encoding,\n} from '../../utils/encoder';\nimport { toBytes } from '../../utils/bytes';\nimport { concatBuffers } from '../../utils/other';\nimport {\n AensName,\n NAME_BID_RANGES,\n NAME_BID_TIMEOUT_BLOCKS,\n NAME_FEE_BID_INCREMENT,\n NAME_MAX_LENGTH_FEE,\n} from './constants';\nimport { ceil } from '../../utils/bignumber';\nimport { ArgumentError, IllegalBidFeeError } from '../../utils/errors';\nimport { NamePointer } from '../../apis/node';\nimport { readId, writeId } from './address';\n\n/**\n * JavaScript-based Transaction builder helper function's\n */\n\n/**\n * Build a contract public key\n * @category contract\n * @param ownerId - The public key of the owner account\n * @param nonce - the nonce of the transaction\n * @returns Contract public key\n */\nexport function buildContractId(\n ownerId: Encoded.AccountAddress,\n nonce: number | BigNumber,\n): Encoded.ContractAddress {\n const ownerIdAndNonce = Buffer.from([...decode(ownerId), ...toBytes(nonce)]);\n const b2bHash = hash(ownerIdAndNonce);\n return encode(b2bHash, Encoding.ContractAddress);\n}\n\n/**\n * Build a oracle query id\n * @category oracle\n * @param senderId - The public key of the sender account\n * @param nonce - the nonce of the transaction\n * @param oracleId - The oracle public key\n * @returns Contract public key\n */\nexport function oracleQueryId(\n senderId: Encoded.AccountAddress,\n nonce: number | BigNumber | string,\n oracleId: Encoded.OracleAddress,\n): Encoded.OracleQueryId {\n function _int32(val: number | string | BigNumber): Buffer {\n const nonceBE = toBytes(val, true);\n return concatBuffers([Buffer.alloc(32 - nonceBE.length), nonceBE]);\n }\n\n const b2bHash = hash(\n Buffer.from([...decode(senderId), ..._int32(nonce), ...decode(oracleId)]),\n );\n return encode(b2bHash, Encoding.OracleQueryId);\n}\n\n/**\n * Format the salt into a 64-byte hex string\n * @category transaction builder\n * @param salt - Random number\n * @returns Zero-padded hex string of salt\n */\nexport function formatSalt(salt: number): Buffer {\n return Buffer.from(salt.toString(16).padStart(64, '0'), 'hex');\n}\n\n/**\n * Encode an AENS name\n * @category AENS\n * @param name - Name to encode\n * @returns `nm_` prefixed encoded AENS name\n */\nexport function produceNameId(name: AensName): Encoded.Name {\n return encode(hash(name.toLowerCase()), Encoding.Name);\n}\n\n/**\n * Generate the commitment hash by hashing the formatted salt and\n * name, base 58 encoding the result and prepending 'cm_'\n * @category transaction builder\n * @param name - Name to be registered\n * @param salt - Random salt\n * @returns Commitment hash\n */\nexport function commitmentHash(\n name: AensName,\n salt: number = genSalt(),\n): Encoded.Commitment {\n return encode(\n hash(concatBuffers([Buffer.from(name.toLowerCase()), formatSalt(salt)])),\n Encoding.Commitment,\n );\n}\n\n/**\n * Utility function to convert int to bytes\n * @category transaction builder\n * @param val - Value\n * @returns Buffer Buffer from number(BigEndian)\n */\nexport function writeInt(val: number | string | BigNumber): Buffer {\n return toBytes(val, true);\n}\n\n/**\n * Utility function to convert bytes to int\n * @category transaction builder\n * @param buf - Value\n * @returns Buffer Buffer from number(BigEndian)\n */\nexport function readInt(buf: Buffer = Buffer.from([])): string {\n return new BigNumber(Buffer.from(buf).toString('hex'), 16).toString(10);\n}\n\n/**\n * Helper function to build pointers for name update TX\n * @category transaction builder\n * @param pointers - Array of pointers\n * `([ { key: 'account_pubkey', id: 'ak_32klj5j23k23j5423l434l2j3423'} ])`\n * @returns Serialized pointers array\n */\nexport function buildPointers(pointers: NamePointer[]): Buffer[][] {\n return pointers.map(\n (p) => [\n toBytes(p.key),\n writeId(p.id as Parameters<typeof writeId>[0]),\n ],\n );\n}\n\n/**\n * Helper function to read pointers from name update TX\n * @category transaction builder\n * @param pointers - Array of pointers\n * @returns Deserialize pointer array\n */\nexport function readPointers(pointers: Array<[key: string, id: Buffer]>): NamePointer[] {\n return pointers.map(\n ([key, id]) => ({\n key: key.toString(),\n id: readId(id),\n }),\n );\n}\n\nconst AENS_SUFFIX = '.chain';\n\n/**\n * Is AENS name valid\n * @category AENS\n * @param name - AENS name\n */\nexport function isNameValid(name: string): name is AensName {\n // TODO: probably there are stronger requirements\n return name.endsWith(AENS_SUFFIX);\n}\n\nconst encodingToPointerKey = [\n [Encoding.AccountAddress, 'account_pubkey'],\n [Encoding.OracleAddress, 'oracle_pubkey'],\n [Encoding.ContractAddress, 'contract_pubkey'],\n [Encoding.Channel, 'channel'],\n] as const;\n\n/**\n * @category AENS\n * @param identifier - account/oracle/contract address, or channel\n * @returns default AENS pointer key\n */\nexport function getDefaultPointerKey(\n identifier: Encoded.Generic<typeof encodingToPointerKey[number][0]>,\n): typeof encodingToPointerKey[number][1] {\n decode(identifier);\n const encoding = identifier.substring(0, 2);\n const result = encodingToPointerKey.find(([e]) => e === encoding)?.[1];\n if (result != null) return result;\n throw new ArgumentError(\n 'identifier',\n `prefixed with one of ${encodingToPointerKey.map(([e]) => `${e}_`).join(', ')}`,\n identifier,\n );\n}\n\n/**\n * Get the minimum AENS name fee\n * @category AENS\n * @param name - the AENS name to get the fee for\n * @returns the minimum fee for the AENS name auction\n */\nexport function getMinimumNameFee(name: AensName): BigNumber {\n const nameLength = name.length - AENS_SUFFIX.length;\n return NAME_BID_RANGES[Math.min(nameLength, NAME_MAX_LENGTH_FEE)];\n}\n\n/**\n * Compute bid fee for AENS auction\n * @category AENS\n * @param name - the AENS name to get the fee for\n * @param options - Options\n * @param options.startFee - Auction start fee\n * @param options.increment - Bid multiplier(In percentage, must be between 0 and 1)\n * @returns Bid fee\n */\nexport function computeBidFee(\n name: AensName,\n { startFee, increment = NAME_FEE_BID_INCREMENT }:\n { startFee?: number | string | BigNumber; increment?: number } = {},\n): BigNumber {\n if (!(Number(increment) === increment && increment % 1 !== 0)) throw new IllegalBidFeeError(`Increment must be float. Current increment ${increment}`);\n if (increment < NAME_FEE_BID_INCREMENT) throw new IllegalBidFeeError(`minimum increment percentage is ${NAME_FEE_BID_INCREMENT}`);\n // FIXME: increment should be used somehow here\n return ceil(\n new BigNumber(startFee ?? getMinimumNameFee(name))\n .times(new BigNumber(NAME_FEE_BID_INCREMENT).plus(1)),\n );\n}\n\n/**\n * Compute auction end height\n * @category AENS\n * @param name - Name to compute auction end for\n * @param claimHeight - Auction starting height\n * @see {@link https://github.com/aeternity/aeternity/blob/72e440b8731422e335f879a31ecbbee7ac23a1cf/apps/aecore/src/aec_governance.erl#L273}\n * @returns Auction end height\n */\nexport function computeAuctionEndBlock(name: AensName, claimHeight: number): number {\n const length = name.length - AENS_SUFFIX.length;\n const h = (length <= 4 && 62 * NAME_BID_TIMEOUT_BLOCKS)\n || (length <= 8 && 31 * NAME_BID_TIMEOUT_BLOCKS)\n || (length <= 12 && NAME_BID_TIMEOUT_BLOCKS)\n || 0;\n return h + claimHeight;\n}\n\n/**\n * Is name accept going to auction\n * @category AENS\n */\nexport function isAuctionName(name: AensName): boolean {\n return name.length < 13 + AENS_SUFFIX.length;\n}\n","import BigNumber from 'bignumber.js';\nimport { readInt, writeInt } from '../helpers';\nimport { ArgumentError } from '../../../utils/errors';\n\nexport type Int = number | string | BigNumber;\n\nexport default {\n serialize(value: Int): Buffer {\n if (value < 0) throw new ArgumentError('value', 'greater or equal to 0', value);\n return writeInt(value);\n },\n\n deserialize(value: Buffer): string {\n return readInt(value);\n },\n};\n","import uInt from './u-int';\n\nexport default {\n serialize(value: number): Buffer {\n return uInt.serialize(value);\n },\n\n deserialize(value: Buffer): number {\n return +uInt.deserialize(value);\n },\n};\n","import uInt, { Int } from './u-int';\nimport { AE_AMOUNT_FORMATS, formatAmount } from '../../../utils/amount-formatter';\nimport { ArgumentError } from '../../../utils/errors';\n\nexport interface Options { denomination?: AE_AMOUNT_FORMATS }\n\nexport default {\n ...uInt,\n\n serializeAettos(value: string | undefined): string {\n if (value == null) throw new ArgumentError('value', 'provided', value);\n return value;\n },\n\n serializeOptional(value: Int | undefined, { denomination, ...options }: Options): Buffer {\n return uInt.serialize(\n this.serializeAettos(\n value != null ? formatAmount(value, { denomination }) : value,\n options,\n ),\n );\n },\n\n serialize(value: Int, options: Options): Buffer {\n return this.serializeOptional(value, options);\n },\n};\n","import coinAmount from './coin-amount';\nimport { Int } from './u-int';\nimport { IllegalArgumentError } from '../../../utils/errors';\n\nexport default {\n ...coinAmount,\n\n /**\n * @param value - Deposit value in string format. Should be equal to '0'.\n * @param options - Options\n * @returns Deposit value Buffer.\n */\n serialize(\n value: Int | undefined,\n options: Parameters<typeof coinAmount['serialize']>[1],\n ): Buffer {\n value ??= 0;\n if (+value !== 0) throw new IllegalArgumentError(`Contract deposit is not refundable, so it should be equal 0, got ${value.toString()} instead`);\n return coinAmount.serialize(value, options);\n },\n};\n","import BigNumber from 'bignumber.js';\nimport { IllegalArgumentError } from '../../../utils/errors';\nimport { MIN_GAS_PRICE, Tag } from '../constants';\nimport coinAmount from './coin-amount';\nimport { isKeyOfObject } from '../../../utils/other';\n\nconst BASE_GAS = 15000;\nconst GAS_PER_BYTE = 20;\nconst KEY_BLOCK_INTERVAL = 3;\n\n/**\n * Calculate the Base fee gas\n * @see {@link https://github.com/aeternity/protocol/blob/master/consensus/README.md#gas}\n * @param txType - The transaction type\n * @returns The base fee\n * @example\n * ```js\n * TX_FEE_BASE('channelForceProgress') => new BigNumber(30 * 15000)\n * ```\n */\nconst TX_FEE_BASE_GAS = (txType: Tag): BigNumber => {\n const feeFactors = {\n [Tag.ChannelForceProgressTx]: 30,\n [Tag.ChannelOffChainTx]: 0,\n [Tag.ChannelOffChainUpdateCallContract]: 0,\n [Tag.ChannelOffChainUpdateCreateContract]: 0,\n [Tag.ChannelOffChainUpdateDeposit]: 0,\n [Tag.ChannelOffChainUpdateWithdraw]: 0,\n [Tag.ChannelOffChainUpdateTransfer]: 0,\n [Tag.ContractCreateTx]: 5,\n [Tag.ContractCallTx]: 12,\n [Tag.GaAttachTx]: 5,\n [Tag.GaMetaTx]: 5,\n [Tag.PayingForTx]: 1 / 5,\n } as const;\n const factor = feeFactors[txType as keyof typeof feeFactors] ?? 1;\n return new BigNumber(factor * BASE_GAS);\n};\n\n/**\n * Calculate fee for Other types of transactions\n * @see {@link https://github.com/aeternity/protocol/blob/master/consensus/README.md#gas}\n * @param txType - The transaction type\n * @param txSize - The transaction size\n * @returns parameters - The transaction parameters\n * @returns parameters.relativeTtl - The relative ttl\n * @returns parameters.innerTxSize - The size of the inner transaction\n * @returns The Other fee\n * @example\n * ```js\n * TX_FEE_OTHER_GAS('oracleResponse',10, { relativeTtl: 10, innerTxSize: 10 })\n * => new BigNumber(10).times(20).plus(Math.ceil(32000 * 10 / Math.floor(60 * 24 * 365 / 2)))\n * ```\n */\nconst TX_FEE_OTHER_GAS = (\n txType: Tag,\n txSize: number,\n { relativeTtl, innerTxSize }: { relativeTtl: number; innerTxSize: number },\n): BigNumber => {\n switch (txType) {\n case Tag.OracleRegisterTx:\n case Tag.OracleExtendTx:\n case Tag.OracleQueryTx:\n case Tag.OracleResponseTx:\n return new BigNumber(txSize)\n .times(GAS_PER_BYTE)\n .plus(\n Math.ceil((32000 * relativeTtl) / Math.floor((60 * 24 * 365) / KEY_BLOCK_INTERVAL)),\n );\n case Tag.GaMetaTx:\n case Tag.PayingForTx:\n return new BigNumber(txSize).minus(innerTxSize).times(GAS_PER_BYTE);\n default:\n return new BigNumber(txSize).times(GAS_PER_BYTE);\n }\n};\n\nfunction getOracleRelativeTtl(params: any, txType: Tag): number {\n const ttlKeys = {\n [Tag.OracleRegisterTx]: 'oracleTtlValue',\n [Tag.OracleExtendTx]: 'oracleTtlValue',\n [Tag.OracleQueryTx]: 'queryTtlValue',\n [Tag.OracleResponseTx]: 'responseTtlValue',\n } as const;\n\n if (!isKeyOfObject(txType, ttlKeys)) return 1;\n return params[ttlKeys[txType]];\n}\n\n/**\n * Calculate fee based on tx type and params\n */\nexport function buildFee(txType: Tag, buildTx: any): BigNumber {\n const { rlpEncoded: { length }, txObject } = buildTx;\n\n return TX_FEE_BASE_GAS(txType)\n .plus(TX_FEE_OTHER_GAS(txType, length, {\n relativeTtl: getOracleRelativeTtl(txObject, txType),\n innerTxSize: [Tag.GaMetaTx, Tag.PayingForTx].includes(txType)\n ? txObject.tx.tx.encodedTx.rlpEncoded.length\n : 0,\n }))\n .times(MIN_GAS_PRICE);\n}\n\n/**\n * Calculate min fee\n * @category transaction builder\n * @param txType - Transaction type\n * @param rebuildTx - Callback to get built transaction with specific fee\n */\nexport function calculateMinFee(\n txType: Tag,\n rebuildTx: (value: BigNumber) => any,\n): BigNumber {\n let fee = new BigNumber(0);\n let previousFee;\n do {\n previousFee = fee;\n fee = buildFee(txType, rebuildTx(fee));\n } while (!fee.eq(previousFee));\n return fee;\n}\n\nexport default {\n ...coinAmount,\n\n serializeAettos(\n _value: string | undefined,\n { txType, rebuildTx, _computingMinFee }:\n { txType: Tag; rebuildTx: (params: any) => any; _computingMinFee?: string },\n ): string {\n if (_computingMinFee != null) return _computingMinFee;\n const minFee = calculateMinFee(txType, (fee) => rebuildTx({ _computingMinFee: fee }));\n const value = new BigNumber(_value ?? minFee);\n if (minFee.gt(value)) {\n throw new IllegalArgumentError(`Fee ${value.toString()} must be bigger then ${minFee}`);\n }\n return value.toFixed();\n },\n\n serialize: coinAmount.serializeOptional,\n};\n","import { IllegalArgumentError } from '../../../utils/errors';\nimport { MIN_GAS_PRICE, Tag } from '../constants';\nimport shortUInt from './short-u-int';\nimport { buildFee } from './fee';\n\nfunction calculateGasLimitMax(\n txType: Tag,\n gasMax: number,\n rebuildTx: (value: number) => any,\n): number {\n return gasMax - +buildFee(txType, rebuildTx(gasMax)).dividedBy(MIN_GAS_PRICE);\n}\n\nexport default {\n ...shortUInt,\n\n serialize(\n _value: number | undefined,\n {\n txType, rebuildTx, gasMax = 6e6, _computingGasLimit,\n }: {\n txType: Tag;\n rebuildTx: (params: any) => any;\n gasMax: number;\n _computingGasLimit?: number;\n },\n ): Buffer {\n if (_computingGasLimit != null) return shortUInt.serialize(_computingGasLimit);\n\n const gasLimitMax = calculateGasLimitMax(\n txType,\n gasMax,\n (gasLimit) => rebuildTx({ _computingGasLimit: gasLimit }),\n );\n const value = _value ?? gasLimitMax;\n if (value > gasLimitMax) {\n throw new IllegalArgumentError(`Gas limit ${value} must be less or equal to ${gasLimitMax}`);\n }\n return shortUInt.serialize(value);\n },\n};\n","import coinAmount from './coin-amount';\nimport { IllegalArgumentError } from '../../../utils/errors';\nimport { MIN_GAS_PRICE } from '../constants';\n\nexport default {\n ...coinAmount,\n\n serializeAettos(value: string | undefined = MIN_GAS_PRICE.toString()): string {\n if (+value < MIN_GAS_PRICE) {\n throw new IllegalArgumentError(`Gas price ${value.toString()} must be bigger then ${MIN_GAS_PRICE}`);\n }\n return value;\n },\n\n serialize: coinAmount.serializeOptional,\n};\n","export default {\n serialize(value: string): Buffer {\n return Buffer.from(value);\n },\n\n deserialize(value: Buffer): string {\n return value.toString();\n },\n};\n","import field from './field';\nimport { AensName } from '../constants';\n\nexport default {\n /**\n * @param value - AENS name\n */\n serialize(value: AensName): Buffer {\n return field.serialize(value);\n },\n\n /**\n * @param value - AENS name\n */\n deserialize(value: Buffer): AensName {\n return field.deserialize(value) as AensName;\n },\n};\n","import BigNumber from 'bignumber.js';\nimport { getMinimumNameFee } from '../helpers';\nimport { InsufficientNameFeeError } from '../../../utils/errors';\nimport { Int } from './u-int';\nimport coinAmount from './coin-amount';\nimport { AensName } from '../constants';\n\nexport default {\n ...coinAmount,\n\n serializeAettos(\n _value: string | undefined,\n txFields: { name: AensName },\n ): string {\n const minNameFee = getMinimumNameFee(txFields.name);\n const value = new BigNumber(_value ?? minNameFee);\n if (minNameFee.gt(value)) throw new InsufficientNameFeeError(value, minNameFee);\n return value.toFixed();\n },\n\n /**\n * @param value - AENS name fee Buffer\n * @param txFields - Transaction fields\n * @param txFields.name - AENS Name in transaction\n */\n serialize(\n value: Int | undefined,\n txFields: { name: AensName } & Parameters<typeof coinAmount['serialize']>[1],\n ): Buffer {\n return coinAmount.serializeOptional.call(this, value, txFields);\n },\n};\n","import _field from './field';\nimport _uInt from './u-int';\nimport _shortUInt from './short-u-int';\nimport _coinAmount from './coin-amount';\n\nimport _deposit from './deposit';\nimport _fee from './fee';\nimport _gasLimit from './gas-limit';\nimport _gasPrice from './gas-price';\nimport _name from './name';\nimport _nameFee from './name-fee';\nimport _nameId from './name-id';\n\n// TODO: remove after fixing https://github.com/Gerrit0/typedoc-plugin-missing-exports/issues/15\nconst field = _field;\nconst uInt = _uInt;\nconst shortUInt = _shortUInt;\nconst coinAmount = _coinAmount;\n\nconst deposit = _deposit;\nconst fee = _fee;\nconst gasLimit = _gasLimit;\nconst gasPrice = _gasPrice;\nconst name = _name;\nconst nameFee = _nameFee;\nconst nameId = _nameId;\n\nexport type Field = typeof field | typeof uInt | typeof shortUInt | typeof coinAmount\n | typeof deposit | typeof fee | typeof gasLimit | typeof gasPrice | typeof name | typeof nameFee\n | typeof nameId;\n\nexport {\n field,\n uInt,\n shortUInt,\n coinAmount,\n\n deposit,\n fee,\n gasLimit,\n gasPrice,\n name,\n nameFee,\n nameId,\n};\n","import { AensName } from '../constants';\nimport { produceNameId, isNameValid } from '../helpers';\nimport { writeId, readId } from '../address';\nimport { Encoded } from '../../../utils/encoder';\n\nexport default {\n /**\n * @param value - AENS name ID\n */\n serialize(value: AensName | Encoded.Name): Buffer {\n return writeId(isNameValid(value) ? produceNameId(value) : value);\n },\n\n /**\n * @param value - AENS name ID Buffer\n */\n deserialize(value: Buffer): Encoded.Name {\n return readId(value) as Encoded.Name;\n },\n};\n","/**\n * Transaction Schema for TxBuilder\n */\n// # RLP version number\n// # https://github.com/aeternity/protocol/blob/master/serializations.md#binary-serialization\n\nimport BigNumber from 'bignumber.js';\nimport { Tag } from './constants';\nimport {\n Field, uInt, shortUInt, coinAmount, name, nameId, nameFee, deposit, gasLimit, gasPrice, fee,\n} from './field-types';\nimport { Encoded, Encoding } from '../../utils/encoder';\nimport MPTree from '../../utils/mptree';\nimport { NamePointer } from '../../apis/node';\n\nexport enum ORACLE_TTL_TYPES {\n delta = 0,\n block = 1,\n}\n\n// # TRANSACTION DEFAULT TTL\nexport const TX_TTL = 0;\n// # ORACLE\nexport const QUERY_FEE = 30000;\nexport const ORACLE_TTL = { type: ORACLE_TTL_TYPES.delta, value: 500 };\nexport const QUERY_TTL = { type: ORACLE_TTL_TYPES.delta, value: 10 };\nexport const RESPONSE_TTL = { type: ORACLE_TTL_TYPES.delta, value: 10 };\n// # CONTRACT\nexport const AMOUNT = 0;\nexport const MAX_AUTH_FUN_GAS = 50000;\nexport const DRY_RUN_ACCOUNT = {\n pub: 'ak_11111111111111111111111111111111273Yts',\n amount: 100000000000000000000000000000000000n,\n} as const;\n\nexport type TxField = [\n name: string,\n type: FIELD_TYPES | Field,\n prefix?: Encoding | Encoding[],\n];\n\n/**\n * @category transaction builder\n * @see {@link https://github.com/aeternity/protocol/blob/0f6dee3d9d1e8e2469816798f5c7587a6c918f94/contracts/contract_vms.md#virtual-machines-on-the-%C3%A6ternity-blockchain}\n */\nexport enum VM_VERSIONS {\n NO_VM = 0,\n SOPHIA = 1,\n SOPHIA_IMPROVEMENTS_MINERVA = 3,\n SOPHIA_IMPROVEMENTS_FORTUNA = 4,\n FATE = 5,\n SOPHIA_IMPROVEMENTS_LIMA = 6,\n FATE_2 = 7,\n}\n\n/**\n * @category transaction builder\n * @see {@link https://github.com/aeternity/protocol/blob/0f6dee3d9d1e8e2469816798f5c7587a6c918f94/contracts/contract_vms.md#virtual-machines-on-the-%C3%A6ternity-blockchain}\n */\nexport enum ABI_VERSIONS {\n NO_ABI = 0,\n SOPHIA = 1,\n FATE = 3,\n}\n\n/**\n * @category transaction builder\n */\nexport enum PROTOCOL_VERSIONS {\n IRIS = 5,\n}\n\n// First abi/vm by default\nexport const PROTOCOL_VM_ABI = {\n [PROTOCOL_VERSIONS.IRIS]: {\n [Tag.ContractCreateTx]: {\n vmVersion: [VM_VERSIONS.FATE_2], abiVersion: [ABI_VERSIONS.FATE],\n },\n // TODO: Ensure that AEVM (SOPHIA?) is still available here\n [Tag.ContractCallTx]: {\n vmVersion: [], abiVersion: [ABI_VERSIONS.FATE, ABI_VERSIONS.SOPHIA],\n },\n [Tag.OracleRegisterTx]: {\n vmVersion: [], abiVersion: [ABI_VERSIONS.NO_ABI, ABI_VERSIONS.SOPHIA],\n },\n },\n} as const;\n\ntype PrefixType<Prefix> = Prefix extends Encoding\n ? Encoded.Generic<Prefix>\n : Prefix extends readonly Encoding[]\n ? Encoded.Generic<Prefix[number]>\n : Encoded.Generic<any>;\n\n/**\n * @category transaction builder\n */\nexport interface CtVersion {\n vmVersion: VM_VERSIONS;\n abiVersion: ABI_VERSIONS;\n}\n\n/**\n * @category transaction builder\n */\nexport enum FIELD_TYPES {\n id,\n ids,\n string,\n binary,\n bool,\n hex,\n rlpBinary,\n rlpBinaries,\n rawBinary,\n signatures,\n pointers,\n offChainUpdates,\n callStack,\n proofOfInclusion,\n mptrees,\n callReturnType,\n ctVersion,\n abiVersion,\n ttlType,\n sophiaCodeTypeInfo,\n payload,\n stateTree,\n}\n\ninterface BuildFieldTypes<Prefix extends undefined | Encoding | readonly Encoding[]> {\n [FIELD_TYPES.id]: PrefixType<Prefix>;\n [FIELD_TYPES.ids]: Array<Encoded.Generic<Prefix extends Encoding[] ? Prefix : any>>;\n [FIELD_TYPES.string]: string;\n [FIELD_TYPES.binary]: PrefixType<Prefix>;\n [FIELD_TYPES.bool]: Boolean;\n [FIELD_TYPES.hex]: string;\n [FIELD_TYPES.rlpBinary]: any;\n [FIELD_TYPES.rlpBinaries]: any[];\n [FIELD_TYPES.rawBinary]: Uint8Array;\n [FIELD_TYPES.signatures]: Uint8Array[];\n [FIELD_TYPES.pointers]: NamePointer[];\n [FIELD_TYPES.offChainUpdates]: any;\n [FIELD_TYPES.callStack]: any;\n [FIELD_TYPES.proofOfInclusion]: any;\n [FIELD_TYPES.mptrees]: MPTree[];\n [FIELD_TYPES.callReturnType]: any;\n [FIELD_TYPES.ctVersion]: CtVersion;\n [FIELD_TYPES.abiVersion]: ABI_VERSIONS;\n [FIELD_TYPES.ttlType]: ORACLE_TTL_TYPES;\n [FIELD_TYPES.sophiaCodeTypeInfo]: any;\n [FIELD_TYPES.payload]: string | undefined;\n [FIELD_TYPES.stateTree]: any;\n}\n\n// based on https://stackoverflow.com/a/50375286/6176994\ntype UnionToIntersection<Union> =\n (Union extends any ? (k: Union) => void : never) extends ((k: infer Intersection) => void)\n ? Intersection : never;\n\ntype TxElem = readonly [string, FIELD_TYPES | Field]\n| readonly [string, FIELD_TYPES, Encoding | readonly Encoding[]];\n\ntype BuildTxArgBySchemaType<\n Type extends FIELD_TYPES | Field,\n Prefix extends undefined | Encoding | readonly Encoding[],\n> =\n Type extends Field\n ? Parameters<Type['serialize']>[0]\n : Type extends FIELD_TYPES\n ? BuildFieldTypes<Prefix>[Type]\n : never;\n\ntype NullablePartial<\n T,\n NK extends keyof T = { [K in keyof T]: undefined extends T[K] ? K : never }[keyof T],\n> = Partial<Pick<T, NK>> & Omit<T, NK>;\n\ntype BuildTxArgBySchema<SchemaLine> =\n UnionToIntersection<\n SchemaLine extends ReadonlyArray<infer Elem>\n ? Elem extends TxElem\n ? NullablePartial<{ [k in Elem[0]]: BuildTxArgBySchemaType<Elem[1], Elem[2]> }>\n : never\n : never\n >;\n\nexport type RawTxObject<Tx extends TxSchema> = {\n [k in keyof Tx]-?: Tx[k] extends BigNumber ? string : Tx[k]\n};\n\nconst BASE_TX = [\n ['tag', shortUInt],\n ['VSN', shortUInt],\n] as const;\n\nexport const TX_SCHEMA = {\n [Tag.Account]: {\n 1: [\n ...BASE_TX,\n ['nonce', shortUInt],\n ['balance', uInt],\n ],\n 2: [\n ...BASE_TX,\n ['flags', uInt],\n ['nonce', shortUInt],\n ['balance', uInt],\n ['gaContract', FIELD_TYPES.id, [Encoding.ContractAddress, Encoding.Name]],\n ['gaAuthFun', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ],\n },\n [Tag.SignedTx]: {\n 1: [\n ...BASE_TX,\n ['signatures', FIELD_TYPES.signatures],\n ['encodedTx', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.SpendTx]: {\n 1: [\n ...BASE_TX,\n ['senderId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['recipientId', FIELD_TYPES.id, [Encoding.AccountAddress, Encoding.Name]],\n ['amount', coinAmount],\n ['fee', fee],\n ['ttl', shortUInt],\n ['nonce', shortUInt],\n ['payload', FIELD_TYPES.payload],\n ],\n },\n [Tag.NamePreclaimTx]: {\n 1: [\n ...BASE_TX,\n ['accountId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['nonce', shortUInt],\n ['commitmentId', FIELD_TYPES.id, Encoding.Commitment],\n ['fee', fee],\n ['ttl', shortUInt],\n ],\n },\n [Tag.NameClaimTx]: {\n 2: [\n ...BASE_TX,\n ['accountId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['nonce', shortUInt],\n ['name', name],\n ['nameSalt', uInt],\n ['nameFee', nameFee],\n ['fee', fee],\n ['ttl', shortUInt],\n ],\n },\n [Tag.NameUpdateTx]: {\n 1: [\n ...BASE_TX,\n ['accountId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['nonce', shortUInt],\n ['nameId', nameId],\n ['nameTtl', uInt],\n ['pointers', FIELD_TYPES.pointers],\n ['clientTtl', shortUInt],\n ['fee', fee],\n ['ttl', shortUInt],\n ],\n },\n [Tag.NameTransferTx]: {\n 1: [\n ...BASE_TX,\n ['accountId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['nonce', shortUInt],\n ['nameId', nameId],\n ['recipientId', FIELD_TYPES.id, [Encoding.AccountAddress, Encoding.Name]],\n ['fee', fee],\n ['ttl', shortUInt],\n ],\n },\n [Tag.NameRevokeTx]: {\n 1: [\n ...BASE_TX,\n ['accountId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['nonce', shortUInt],\n ['nameId', nameId],\n ['fee', fee],\n ['ttl', shortUInt],\n ],\n },\n [Tag.Contract]: {\n 1: [\n ...BASE_TX,\n ['owner', FIELD_TYPES.id, Encoding.AccountAddress],\n ['ctVersion', FIELD_TYPES.ctVersion],\n ['code', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['log', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['active', FIELD_TYPES.bool],\n ['referers', FIELD_TYPES.ids, Encoding.AccountAddress],\n ['deposit', deposit],\n ],\n },\n [Tag.ContractCreateTx]: {\n 1: [\n ...BASE_TX,\n ['ownerId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['nonce', shortUInt],\n ['code', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['ctVersion', FIELD_TYPES.ctVersion],\n ['fee', fee],\n ['ttl', shortUInt],\n ['deposit', deposit],\n ['amount', coinAmount],\n ['gasLimit', gasLimit],\n ['gasPrice', gasPrice],\n ['callData', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ],\n },\n [Tag.ContractCallTx]: {\n 1: [\n ...BASE_TX,\n ['callerId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['nonce', shortUInt],\n ['contractId', FIELD_TYPES.id, [Encoding.ContractAddress, Encoding.Name]],\n ['abiVersion', FIELD_TYPES.abiVersion],\n ['fee', fee],\n ['ttl', shortUInt],\n ['amount', coinAmount],\n ['gasLimit', gasLimit],\n ['gasPrice', gasPrice],\n ['callData', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ],\n },\n [Tag.ContractCall]: {\n 1: [\n ...BASE_TX,\n ['callerId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['callerNonce', shortUInt],\n ['height', shortUInt],\n ['contractId', FIELD_TYPES.id, Encoding.ContractAddress],\n ['gasPrice', gasPrice],\n ['gasUsed', shortUInt],\n ['returnValue', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['returnType', FIELD_TYPES.callReturnType],\n // TODO: add serialization for\n // <log> :: [ { <address> :: id, [ <topics> :: binary() ], <data> :: binary() } ]\n ['log', FIELD_TYPES.rawBinary],\n ],\n },\n [Tag.OracleRegisterTx]: {\n 1: [\n ...BASE_TX,\n ['accountId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['nonce', shortUInt],\n ['queryFormat', FIELD_TYPES.string],\n ['responseFormat', FIELD_TYPES.string],\n ['queryFee', coinAmount],\n ['oracleTtlType', FIELD_TYPES.ttlType],\n ['oracleTtlValue', shortUInt],\n ['fee', fee],\n ['ttl', shortUInt],\n ['abiVersion', FIELD_TYPES.abiVersion],\n ],\n },\n [Tag.OracleExtendTx]: {\n 1: [\n ...BASE_TX,\n ['oracleId', FIELD_TYPES.id, [Encoding.OracleAddress, Encoding.Name]],\n ['nonce', shortUInt],\n ['oracleTtlType', FIELD_TYPES.ttlType],\n ['oracleTtlValue', shortUInt],\n ['fee', fee],\n ['ttl', shortUInt],\n ],\n },\n [Tag.OracleQueryTx]: {\n 1: [\n ...BASE_TX,\n ['senderId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['nonce', shortUInt],\n ['oracleId', FIELD_TYPES.id, [Encoding.OracleAddress, Encoding.Name]],\n ['query', FIELD_TYPES.string],\n ['queryFee', coinAmount],\n ['queryTtlType', FIELD_TYPES.ttlType],\n ['queryTtlValue', shortUInt],\n ['responseTtlType', FIELD_TYPES.ttlType],\n ['responseTtlValue', shortUInt],\n ['fee', fee],\n ['ttl', shortUInt],\n ],\n },\n [Tag.OracleResponseTx]: {\n 1: [\n ...BASE_TX,\n ['oracleId', FIELD_TYPES.id, Encoding.OracleAddress],\n ['nonce', shortUInt],\n ['queryId', FIELD_TYPES.binary, Encoding.OracleQueryId],\n ['response', FIELD_TYPES.string],\n ['responseTtlType', FIELD_TYPES.ttlType],\n ['responseTtlValue', shortUInt],\n ['fee', fee],\n ['ttl', shortUInt],\n ],\n },\n [Tag.ChannelCreateTx]: {\n 2: [\n ...BASE_TX,\n ['initiator', FIELD_TYPES.id, Encoding.AccountAddress],\n ['initiatorAmount', uInt],\n ['responder', FIELD_TYPES.id, Encoding.AccountAddress],\n ['responderAmount', uInt],\n ['channelReserve', uInt],\n ['lockPeriod', uInt],\n ['ttl', shortUInt],\n ['fee', fee],\n ['initiatorDelegateIds', FIELD_TYPES.string],\n ['responderDelegateIds', FIELD_TYPES.string],\n ['stateHash', FIELD_TYPES.binary, 'st'],\n ['nonce', shortUInt],\n ],\n },\n [Tag.ChannelCloseMutualTx]: {\n 1: [\n ...BASE_TX,\n ['channelId', FIELD_TYPES.id, Encoding.Channel],\n ['fromId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['initiatorAmountFinal', uInt],\n ['responderAmountFinal', uInt],\n ['ttl', shortUInt],\n ['fee', fee],\n ['nonce', shortUInt],\n ],\n },\n [Tag.ChannelCloseSoloTx]: {\n 1: [\n ...BASE_TX,\n ['channelId', FIELD_TYPES.id, Encoding.Channel],\n ['fromId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['payload', FIELD_TYPES.binary, 'tx'],\n ['poi', FIELD_TYPES.binary, 'pi'],\n ['ttl', shortUInt],\n ['fee', fee],\n ['nonce', shortUInt],\n ],\n },\n [Tag.ChannelSlashTx]: {\n 1: [\n ...BASE_TX,\n ['channelId', FIELD_TYPES.id, Encoding.Channel],\n ['fromId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['payload', FIELD_TYPES.binary, 'tx'],\n ['poi', FIELD_TYPES.binary, 'pi'],\n ['ttl', shortUInt],\n ['fee', fee],\n ['nonce', shortUInt],\n ],\n },\n [Tag.ChannelDepositTx]: {\n 1: [\n ...BASE_TX,\n ['channelId', FIELD_TYPES.id, Encoding.Channel],\n ['fromId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['amount', uInt],\n ['ttl', shortUInt],\n ['fee', fee],\n ['stateHash', FIELD_TYPES.binary, 'st'],\n ['round', shortUInt],\n ['nonce', shortUInt],\n ],\n },\n [Tag.ChannelWithdrawTx]: {\n 1: [\n ...BASE_TX,\n ['channelId', FIELD_TYPES.id, Encoding.Channel],\n ['toId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['amount', uInt],\n ['ttl', shortUInt],\n ['fee', fee],\n ['stateHash', FIELD_TYPES.binary, 'st'],\n ['round', shortUInt],\n ['nonce', shortUInt],\n ],\n },\n [Tag.ChannelSettleTx]: {\n 1: [\n ...BASE_TX,\n ['channelId', FIELD_TYPES.id, Encoding.Channel],\n ['fromId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['initiatorAmountFinal', uInt],\n ['responderAmountFinal', uInt],\n ['ttl', shortUInt],\n ['fee', fee],\n ['nonce', shortUInt],\n ],\n },\n [Tag.ChannelForceProgressTx]: {\n 1: [\n ...BASE_TX,\n ['channelId', FIELD_TYPES.id, Encoding.Channel],\n ['fromId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['payload', FIELD_TYPES.binary, 'tx'],\n ['round', shortUInt],\n ['update', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['stateHash', FIELD_TYPES.binary, 'st'],\n ['offChainTrees', FIELD_TYPES.stateTree],\n ['ttl', shortUInt],\n ['fee', fee],\n ['nonce', shortUInt],\n ],\n },\n [Tag.ChannelOffChainTx]: {\n 2: [\n ...BASE_TX,\n ['channelId', FIELD_TYPES.id, Encoding.Channel],\n ['round', shortUInt],\n ['stateHash', FIELD_TYPES.binary, 'st'],\n ],\n },\n [Tag.Channel]: {\n 3: [\n ...BASE_TX,\n ['initiator', FIELD_TYPES.id, Encoding.AccountAddress],\n ['responder', FIELD_TYPES.id, Encoding.AccountAddress],\n ['channelAmount', uInt],\n ['initiatorAmount', uInt],\n ['responderAmount', uInt],\n ['channelReserve', uInt],\n ['initiatorDelegateIds', FIELD_TYPES.ids],\n ['responderDelegateIds', FIELD_TYPES.ids],\n ['stateHash', FIELD_TYPES.hex],\n ['round', shortUInt],\n ['soloRound', uInt],\n ['lockPeriod', uInt],\n ['lockedUntil', uInt],\n ['initiatorAuth', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['responderAuth', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ],\n },\n [Tag.ChannelSnapshotSoloTx]: {\n 1: [\n ...BASE_TX,\n ['channelId', FIELD_TYPES.id, Encoding.Channel],\n ['fromId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['payload', FIELD_TYPES.binary, 'tx'],\n ['ttl', shortUInt],\n ['fee', fee],\n ['nonce', shortUInt],\n ],\n },\n [Tag.ChannelOffChainUpdateTransfer]: {\n 1: [\n ...BASE_TX,\n ['from', FIELD_TYPES.id, Encoding.AccountAddress],\n ['to', FIELD_TYPES.id, Encoding.AccountAddress],\n ['amount', uInt],\n ],\n },\n [Tag.ChannelOffChainUpdateDeposit]: {\n 1: [\n ...BASE_TX,\n ['from', FIELD_TYPES.id, Encoding.AccountAddress],\n ['amount', uInt],\n ],\n },\n [Tag.ChannelOffChainUpdateWithdraw]: {\n 1: [\n ...BASE_TX,\n ['from', FIELD_TYPES.id, Encoding.AccountAddress],\n ['amount', uInt],\n ],\n },\n [Tag.ChannelOffChainUpdateCreateContract]: {\n 1: [\n ...BASE_TX,\n ['owner', FIELD_TYPES.id, Encoding.AccountAddress],\n ['ctVersion', FIELD_TYPES.ctVersion],\n ['code', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['deposit', uInt],\n ['callData', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ],\n },\n [Tag.ChannelOffChainUpdateCallContract]: {\n 1: [\n ...BASE_TX,\n ['caller', FIELD_TYPES.id, Encoding.AccountAddress],\n ['contract', FIELD_TYPES.id, Encoding.ContractAddress],\n ['abiVersion', FIELD_TYPES.abiVersion],\n ['amount', uInt],\n ['callData', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['callStack', FIELD_TYPES.callStack],\n ['gasPrice', gasPrice],\n ['gasLimit', gasLimit],\n ],\n },\n [Tag.ChannelClientReconnectTx]: {\n 1: [\n ...BASE_TX,\n ['channelId', FIELD_TYPES.id, Encoding.Channel],\n ['round', shortUInt],\n ['role', FIELD_TYPES.string],\n ['pubkey', FIELD_TYPES.id, Encoding.AccountAddress],\n ],\n },\n [Tag.TreesPoi]: {\n 1: [\n ...BASE_TX,\n ['accounts', FIELD_TYPES.mptrees],\n ['calls', FIELD_TYPES.mptrees],\n ['channels', FIELD_TYPES.mptrees],\n ['contracts', FIELD_TYPES.mptrees],\n ['ns', FIELD_TYPES.mptrees],\n ['oracles', FIELD_TYPES.mptrees],\n ],\n },\n [Tag.StateTrees]: {\n 1: [\n ...BASE_TX,\n ['contracts', FIELD_TYPES.rlpBinary],\n ['calls', FIELD_TYPES.rlpBinary],\n ['channels', FIELD_TYPES.rlpBinary],\n ['ns', FIELD_TYPES.rlpBinary],\n ['oracles', FIELD_TYPES.rlpBinary],\n ['accounts', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.Mtree]: {\n 1: [\n ...BASE_TX,\n ['values', FIELD_TYPES.rlpBinaries],\n ],\n },\n [Tag.MtreeValue]: {\n 1: [\n ...BASE_TX,\n ['key', FIELD_TYPES.hex],\n ['value', FIELD_TYPES.rawBinary],\n ],\n },\n [Tag.ContractsMtree]: {\n 1: [\n ...BASE_TX,\n ['contracts', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.CallsMtree]: {\n 1: [\n ...BASE_TX,\n ['calls', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.ChannelsMtree]: {\n 1: [\n ...BASE_TX,\n ['channels', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.NameserviceMtree]: {\n 1: [\n ...BASE_TX,\n ['mtree', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.OraclesMtree]: {\n 1: [\n ...BASE_TX,\n ['otree', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.AccountsMtree]: {\n 1: [\n ...BASE_TX,\n ['accounts', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.GaAttachTx]: {\n 1: [\n ...BASE_TX,\n ['ownerId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['nonce', shortUInt],\n ['code', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['authFun', FIELD_TYPES.rawBinary],\n ['ctVersion', FIELD_TYPES.ctVersion],\n ['fee', fee],\n ['ttl', shortUInt],\n ['gasLimit', gasLimit],\n ['gasPrice', gasPrice],\n ['callData', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ],\n },\n [Tag.GaMetaTx]: {\n 2: [\n ...BASE_TX,\n ['gaId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['authData', FIELD_TYPES.binary, Encoding.ContractBytearray],\n ['abiVersion', FIELD_TYPES.abiVersion],\n ['fee', fee],\n ['gasLimit', gasLimit],\n ['gasPrice', gasPrice],\n ['tx', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.PayingForTx]: {\n 1: [\n ...BASE_TX,\n ['payerId', FIELD_TYPES.id, Encoding.AccountAddress],\n ['nonce', shortUInt],\n ['fee', fee],\n ['tx', FIELD_TYPES.rlpBinary],\n ],\n },\n [Tag.CompilerSophia]: {\n 3: [\n ...BASE_TX,\n ['sourceCodeHash', FIELD_TYPES.rawBinary],\n ['typeInfo', FIELD_TYPES.sophiaCodeTypeInfo],\n ['byteCode', FIELD_TYPES.rawBinary],\n ['compilerVersion', FIELD_TYPES.string],\n ['payable', FIELD_TYPES.bool],\n ],\n },\n} as const;\n\nexport type TxTypeSchemas = {\n [key in Tag]: BuildTxArgBySchema<\n typeof TX_SCHEMA[key][keyof typeof TX_SCHEMA[key]]\n >\n};\n\nexport type TxSchema = TxTypeSchemas[Tag];\nexport type TxParamsCommon = Partial<UnionToIntersection<TxSchema>>;\n","/*\n * ISC License (ISC)\n * Copyright (c) 2021 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\n/* eslint-disable default-case */\nimport { encode as rlpEncode } from 'rlp';\nimport type { Input } from 'rlp';\nimport { hash } from './crypto';\nimport {\n MerkleTreeHashMismatchError,\n MissingNodeInTreeError,\n UnknownPathNibbleError,\n UnknownNodeLengthError,\n} from './errors';\n\nenum NodeType {\n Branch,\n Extension,\n Leaf,\n}\n\nexport type MPTreeBinary = [Buffer, Array<[Buffer, Buffer[]]>];\n\nexport default class MPTree {\n private readonly rootHash: string;\n\n private readonly nodes: { [key: string]: Buffer[] };\n\n private static nodeHash(node: Input): string {\n return Buffer.from(hash(rlpEncode(node))).toString('hex');\n }\n\n /**\n * Deserialize Merkle Patricia Tree\n * @param binary - Binary\n * @returns Merkle Patricia Tree\n */\n constructor(binary: MPTreeBinary) {\n this.rootHash = binary[0].toString('hex');\n this.nodes = Object.fromEntries(\n binary[1].map((node) => [node[0].toString('hex'), node[1]]),\n );\n\n if (this.nodes[this.rootHash] === undefined) throw new MissingNodeInTreeError('Can\\'t find a node by root hash');\n Object.entries(this.nodes).forEach(([key, node]) => {\n if (MPTree.nodeHash(node) !== key) throw new MerkleTreeHashMismatchError();\n const { type, payload } = MPTree.parseNode(node);\n switch (type) {\n case NodeType.Branch:\n payload\n .slice(0, 16)\n .filter((n) => n.length)\n .forEach((n) => {\n if (this.nodes[n.toString('hex')] === undefined) {\n throw new MissingNodeInTreeError('Can\\'t find a node by hash in branch node');\n }\n });\n break;\n case NodeType.Extension:\n if (this.nodes[payload[0].toString('hex')] === undefined) {\n throw new MissingNodeInTreeError('Can\\'t find a node by hash in extension node');\n }\n }\n });\n }\n\n isEqual(tree: MPTree): boolean {\n return this.rootHash === tree.rootHash;\n }\n\n private static parseNode(node: Buffer[]): {\n type: NodeType;\n payload: Buffer[];\n path: string | null;\n } {\n switch (node.length) {\n case 17:\n return { type: NodeType.Branch, payload: node, path: null };\n case 2: {\n const nibble = node[0][0] >> 4; // eslint-disable-line no-bitwise\n if (nibble > 3) throw new UnknownPathNibbleError(nibble);\n const type = nibble <= 1 ? NodeType.Extension : NodeType.Leaf;\n const slice = [0, 2].includes(nibble) ? 2 : 1;\n return { type, payload: [node[1]], path: node[0].toString('hex').slice(slice) };\n }\n default:\n throw new UnknownNodeLengthError(node.length);\n }\n }\n\n /**\n * Serialize Merkle Patricia Tree\n * @returns Binary\n */\n serialize(): MPTreeBinary {\n return [\n Buffer.from(this.rootHash, 'hex'),\n Object.entries(this.nodes).map(([mptHash, value]) => ([\n Buffer.from(mptHash, 'hex'),\n value,\n ])),\n ];\n }\n\n /**\n * Retrieve value from Merkle Patricia Tree\n * @param _key - The key of the element to retrieve\n * @returns Value associated to the specified key\n */\n get(_key: string): Buffer | undefined {\n let searchFrom = this.rootHash;\n let key = _key;\n while (true) { // eslint-disable-line no-constant-condition\n const { type, payload, path } = MPTree.parseNode(this.nodes[searchFrom]);\n switch (type) {\n case NodeType.Branch:\n if (key.length === 0) return payload[16];\n searchFrom = payload[+`0x${key[0]}`].toString('hex');\n key = key.substring(1);\n break;\n case NodeType.Extension:\n if (key.substring(0, path?.length) !== path) return undefined;\n searchFrom = payload[0].toString('hex');\n key = key.substring(path.length);\n break;\n case NodeType.Leaf:\n if (path !== key) return undefined;\n return payload[0];\n }\n }\n }\n}\n","import { decode as rlpDecode, encode as rlpEncode, NestedUint8Array } from 'rlp';\nimport {\n decode, encode, Encoded, Encoding,\n} from '../../utils/encoder';\nimport { AE_AMOUNT_FORMATS } from '../../utils/amount-formatter';\nimport { hash } from '../../utils/crypto';\nimport { Field } from './field-types';\nimport {\n FIELD_TYPES,\n RawTxObject,\n TX_SCHEMA,\n TxField,\n TxParamsCommon,\n TxSchema,\n TxTypeSchemas,\n} from './schema';\nimport { Tag } from './constants';\nimport {\n buildContractId, buildPointers, readInt, readPointers, writeInt,\n} from './helpers';\nimport { readId, writeId } from './address';\nimport { toBytes } from '../../utils/bytes';\nimport MPTree, { MPTreeBinary } from '../../utils/mptree';\nimport {\n ArgumentError,\n DecodeError,\n InvalidTxParamsError,\n SchemaNotFoundError,\n} from '../../utils/errors';\nimport { isKeyOfObject } from '../../utils/other';\nimport { NamePointer } from '../../apis/node';\n\n/**\n * JavaScript-based Transaction builder\n */\n\n// SERIALIZE AND DESERIALIZE PART\nfunction deserializeField(\n value: any,\n type: FIELD_TYPES | Field,\n prefix?: Encoding | Encoding[],\n): any {\n if (value == null) return '';\n switch (type) {\n case FIELD_TYPES.ctVersion: {\n const [vm, , abi] = value;\n return {\n vmVersion: readInt(Buffer.from([vm])),\n abiVersion: readInt(Buffer.from([abi])),\n };\n }\n case FIELD_TYPES.abiVersion:\n case FIELD_TYPES.ttlType:\n return readInt(value);\n case FIELD_TYPES.id:\n return readId(value);\n case FIELD_TYPES.ids:\n return value.map(readId);\n case FIELD_TYPES.bool:\n return value[0] === 1;\n case FIELD_TYPES.binary:\n return encode(value, prefix as Encoding);\n case FIELD_TYPES.stateTree:\n return encode(value, Encoding.StateTrees);\n case FIELD_TYPES.string:\n return value.toString();\n case FIELD_TYPES.payload:\n return encode(value, Encoding.Bytearray);\n case FIELD_TYPES.pointers:\n return readPointers(value);\n case FIELD_TYPES.rlpBinary:\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return unpackTx(encode(value, Encoding.Transaction));\n case FIELD_TYPES.rlpBinaries:\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return value.map((v: Buffer) => unpackTx(encode(v, Encoding.Transaction)));\n case FIELD_TYPES.rawBinary:\n return value;\n case FIELD_TYPES.hex:\n return value.toString('hex');\n case FIELD_TYPES.offChainUpdates:\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return value.map((v: Buffer) => unpackTx(encode(v, Encoding.Transaction)));\n case FIELD_TYPES.callStack:\n // TODO: fix this\n return [readInt(value)];\n case FIELD_TYPES.mptrees:\n return value.map((t: MPTreeBinary) => new MPTree(t));\n case FIELD_TYPES.callReturnType:\n switch (readInt(value)) {\n case '0':\n return 'ok';\n case '1':\n return 'error';\n case '2':\n return 'revert';\n default:\n return value;\n }\n case FIELD_TYPES.sophiaCodeTypeInfo:\n return value.reduce(\n (acc: object, [funHash, fnName, argType, outType]: [\n funHash: Buffer,\n fnName: string,\n argType: string,\n outType: string,\n ]) => ({\n ...acc,\n [fnName.toString()]: { funHash, argType, outType },\n }),\n {},\n );\n default:\n if (typeof type === 'number') return value;\n return type.deserialize(value);\n }\n}\n\nfunction serializeField(value: any, type: FIELD_TYPES | Field, params: any): any {\n switch (type) {\n case FIELD_TYPES.abiVersion:\n case FIELD_TYPES.ttlType:\n return writeInt(value);\n case FIELD_TYPES.id:\n return writeId(value);\n case FIELD_TYPES.ids:\n return value.map(writeId);\n case FIELD_TYPES.bool:\n return Buffer.from([(value === true) ? 1 : 0]);\n case FIELD_TYPES.binary:\n return decode(value);\n case FIELD_TYPES.stateTree:\n return decode(value);\n case FIELD_TYPES.hex:\n return Buffer.from(value, 'hex');\n case FIELD_TYPES.signatures:\n return value.map(Buffer.from);\n case FIELD_TYPES.payload:\n return typeof value === 'string' && value.split('_')[0] === 'ba'\n ? decode(value as Encoded.Bytearray)\n : toBytes(value);\n case FIELD_TYPES.string:\n return toBytes(value);\n case FIELD_TYPES.pointers:\n return buildPointers(value);\n case FIELD_TYPES.rlpBinary:\n return value.rlpEncoded ?? value;\n case FIELD_TYPES.mptrees:\n return value.map((t: MPTree) => t.serialize());\n case FIELD_TYPES.ctVersion:\n return Buffer.from([...toBytes(value.vmVersion), 0, ...toBytes(value.abiVersion)]);\n case FIELD_TYPES.callReturnType:\n switch (value) {\n case 'ok': return writeInt(0);\n case 'error': return writeInt(1);\n case 'revert': return writeInt(2);\n default: return value;\n }\n default:\n if (typeof type === 'number') return value;\n // @ts-expect-error will be solved after removing the whole serializeField function\n return type.serialize(value, params);\n }\n}\n\nfunction validateField(\n value: any,\n type: FIELD_TYPES | Field,\n prefix?: Encoding | Encoding[],\n): string | undefined {\n // All fields are required\n if (value == null) return 'Field is required';\n\n // Validate type of value\n switch (type) {\n case FIELD_TYPES.id: {\n const prefixes = Array.isArray(prefix) ? prefix : [prefix];\n if (!prefixes.includes(value.split('_')[0])) {\n if (prefix == null) { return `'${String(value)}' prefix doesn't exist'`; }\n return `'${String(value)}' prefix doesn't match expected prefix '${prefix.toString()}'`;\n }\n return undefined;\n }\n case FIELD_TYPES.ctVersion:\n if (!(Boolean(value.abiVersion) && Boolean(value.vmVersion))) {\n return 'Value must be an object with \"vmVersion\" and \"abiVersion\" fields';\n }\n return undefined;\n case FIELD_TYPES.pointers:\n if (!Array.isArray(value)) return 'Value must be of type Array';\n if (value.some((p: NamePointer) => !(Boolean(p.key) && Boolean(p.id)))) {\n return 'Value must contains only object\\'s like \\'{key: \"account_pubkey\", id: \"ak_lkamsflkalsdalksdlasdlasdlamd\"}\\'';\n }\n if (value.length > 32) {\n return `Expected 32 pointers or less, got ${value.length} instead`;\n }\n return undefined;\n default:\n return undefined;\n }\n}\n\n/**\n * Validate transaction params\n * @category transaction builder\n * @param params - Object with tx params\n * @param schema - Transaction schema\n * @param excludeKeys - Array of keys to exclude for validation\n * @returns Object with validation errors\n */\nexport function validateParams(\n params: any,\n schema: TxField[],\n { excludeKeys = [] }: { excludeKeys: string[] },\n): object {\n return Object.fromEntries(\n schema\n // TODO: allow optional keys in schema\n .filter(([key]) => !excludeKeys.includes(key)\n && !['payload', 'nameFee', 'deposit', 'gasPrice', 'fee', 'gasLimit'].includes(key))\n .map(([key, type, prefix]) => [key, validateField(params[key], type, prefix)])\n .filter(([, message]) => message),\n );\n}\n\n/**\n * Unpack binary transaction\n * @category transaction builder\n * @param binary - Array with binary transaction field's\n * @param schema - Transaction schema\n * @returns Object with transaction field's\n */\nexport function unpackRawTx<Tx extends TxSchema>(\n binary: Uint8Array | NestedUint8Array,\n schema: TxField[],\n): RawTxObject<Tx> {\n return schema\n .reduce<any>(\n (\n acc,\n [key, fieldType, prefix],\n index,\n ) => Object.assign(acc, { [key]: deserializeField(binary[index], fieldType, prefix) }),\n {},\n );\n}\n\n/**\n * @category transaction builder\n */\nexport interface BuiltTx<Tx extends TxSchema, Prefix extends Encoding> {\n tx: Encoded.Generic<Prefix>;\n rlpEncoded: Uint8Array;\n binary: Uint8Array;\n txObject: RawTxObject<Tx>;\n}\n\n/**\n * Build transaction hash\n * @category transaction builder\n * @param _params - Object with tx params\n * @param type - Transaction type\n * @param options - options\n * @param options.excludeKeys - Array of keys to exclude for validation and build\n * @param options.denomination - Denomination of amounts\n * @param options.prefix - Prefix of transaction\n * @throws {@link InvalidTxParamsError}\n * @returns object\n * @returns object.tx Base64Check transaction hash with 'tx_' prefix\n * @returns object.rlpEncoded rlp encoded transaction\n * @returns object.binary binary transaction\n */\nexport function buildTx<TxType extends Tag, Prefix>(\n _params: Omit<TxTypeSchemas[TxType], 'tag' | 'VSN'> & { VSN?: number },\n type: TxType,\n {\n excludeKeys = [],\n prefix = Encoding.Transaction,\n vsn,\n denomination = AE_AMOUNT_FORMATS.AETTOS,\n }: {\n excludeKeys?: string[];\n prefix?: Encoding;\n vsn?: number;\n denomination?: AE_AMOUNT_FORMATS;\n } = {},\n): BuiltTx<TxSchema, Prefix extends Encoding ? Prefix : Encoding.Transaction> {\n const schemas = TX_SCHEMA[type];\n\n vsn ??= Math.max(...Object.keys(schemas).map((a) => +a));\n if (!isKeyOfObject(vsn, schemas)) throw new SchemaNotFoundError('serialization', Tag[type], vsn);\n\n const schema = schemas[vsn] as unknown as TxField[];\n\n const params = _params as TxParamsCommon & { onNode: Node; denomination?: AE_AMOUNT_FORMATS };\n params.VSN = vsn;\n params.tag = type;\n params.denomination = denomination;\n const filteredSchema = schema.filter(([key]) => !excludeKeys.includes(key));\n\n // Validation\n const valid = validateParams(params, schema, { excludeKeys });\n if (Object.keys(valid).length > 0) {\n throw new InvalidTxParamsError(`Transaction build error. ${JSON.stringify(valid)}`);\n }\n\n const binary = filteredSchema\n .map(([key, fieldType]: [keyof TxSchema, FIELD_TYPES, Encoding]) => (\n serializeField(\n params[key],\n fieldType,\n {\n ...params,\n txType: type,\n rebuildTx: (overrideParams: any) => buildTx(\n { ...params, ...overrideParams },\n type,\n {\n excludeKeys, prefix: Encoding.Transaction, vsn, denomination,\n },\n ),\n },\n )\n ))\n .filter((e) => e !== undefined);\n\n const rlpEncoded = rlpEncode(binary);\n const tx = encode(rlpEncoded, prefix);\n return {\n tx,\n rlpEncoded,\n binary,\n txObject: unpackRawTx<TxTypeSchemas[Tag]>(binary, schema),\n } as any;\n}\n\n/**\n * @category transaction builder\n */\nexport interface TxUnpacked<Tx extends TxSchema> {\n txType: Tag;\n tx: RawTxObject<Tx>;\n rlpEncoded: Uint8Array;\n}\n/**\n * Unpack transaction hash\n * @category transaction builder\n * @param encodedTx - Transaction to unpack\n * @param txType - Expected transaction type\n * @returns object\n * @returns object.tx Object with transaction param's\n * @returns object.txType Transaction type\n */\nexport function unpackTx<TxType extends Tag>(\n encodedTx: Encoded.Transaction | Encoded.Poi,\n txType?: TxType,\n): TxUnpacked<TxTypeSchemas[TxType]> {\n const rlpEncoded = decode(encodedTx);\n const binary = rlpDecode(rlpEncoded);\n const objId = +readInt(binary[0] as Buffer);\n if (!isKeyOfObject(objId, TX_SCHEMA)) throw new DecodeError(`Unknown transaction tag: ${objId}`);\n if (txType != null && txType !== objId) throw new DecodeError(`Expected transaction to have ${Tag[txType]} tag, got ${Tag[objId]} instead`);\n const vsn = +readInt(binary[1] as Buffer);\n if (!isKeyOfObject(vsn, TX_SCHEMA[objId])) throw new SchemaNotFoundError('deserialization', `tag ${objId}`, vsn);\n const schema = TX_SCHEMA[objId][vsn];\n return {\n txType: objId,\n tx: unpackRawTx<TxTypeSchemas[TxType]>(binary, schema),\n rlpEncoded,\n };\n}\n\n/**\n * Build a transaction hash\n * @category transaction builder\n * @param rawTx - base64 or rlp encoded transaction\n * @returns Transaction hash\n */\nexport function buildTxHash(rawTx: Encoded.Transaction | Uint8Array): Encoded.TxHash {\n const data = typeof rawTx === 'string' && rawTx.startsWith('tx_')\n ? decode(rawTx)\n : rawTx;\n return encode(hash(data), Encoding.TxHash);\n}\n\n/**\n * Build a contract public key by contractCreateTx or gaAttach\n * @category contract\n * @param contractTx - Transaction\n * @returns Contract public key\n */\nexport function buildContractIdByContractTx(\n contractTx: Encoded.Transaction,\n): Encoded.ContractAddress {\n const { txType, tx } = unpackTx<Tag.ContractCreateTx | Tag.GaAttachTx>(contractTx);\n if (![Tag.ContractCreateTx, Tag.GaAttachTx].includes(txType)) {\n throw new ArgumentError('contractCreateTx', 'a contractCreateTx or gaAttach', txType);\n }\n return buildContractId(tx.ownerId, +tx.nonce);\n}\n","import BigNumber from 'bignumber.js';\nimport { hash, verify } from '../utils/crypto';\nimport {\n CtVersion,\n PROTOCOL_VM_ABI,\n RawTxObject,\n TxParamsCommon,\n TxSchema,\n TxTypeSchemas,\n} from './builder/schema';\nimport { Tag } from './builder/constants';\nimport { TxUnpacked, unpackTx } from './builder';\nimport { UnsupportedProtocolError } from '../utils/errors';\nimport { concatBuffers, isKeyOfObject } from '../utils/other';\nimport {\n decode, encode, Encoded, Encoding,\n} from '../utils/encoder';\nimport Node from '../Node';\n\ninterface Account {\n balance: bigint;\n id: Encoded.AccountAddress;\n nonce: number;\n}\n\nexport interface ValidatorResult {\n message: string;\n key: string;\n checkedKeys: string[];\n}\n\ntype Validator = (\n tx: {\n encodedTx: TxUnpacked<TxSchema>;\n signatures: Buffer[];\n tx: TxUnpacked<TxSchema> & {\n tx: TxTypeSchemas[Tag.SignedTx];\n };\n nonce?: number;\n ttl?: number;\n amount?: number;\n fee?: number;\n nameFee?: number;\n ctVersion?: Partial<CtVersion>;\n abiVersion?: number;\n contractId?: Encoded.ContractAddress;\n },\n options: {\n account?: Account;\n nodeNetworkId: string;\n parentTxTypes: Tag[];\n node: Node;\n txType: Tag;\n height: number;\n consensusProtocolVersion: number;\n }\n) => ValidatorResult[] | Promise<ValidatorResult[]>;\n\nconst validators: Validator[] = [];\n\nconst getSenderAddress = (\n tx: TxParamsCommon | RawTxObject<TxSchema>,\n): Encoded.AccountAddress | undefined => [\n 'senderId', 'accountId', 'ownerId', 'callerId',\n 'oracleId', 'fromId', 'initiator', 'gaId', 'payerId',\n]\n .map((key: keyof TxSchema) => tx[key])\n .filter((a) => a)\n .map((a) => a?.toString().replace(/^ok_/, 'ak_'))[0] as Encoded.AccountAddress | undefined;\n\n/**\n * Transaction Validator\n * This function validates some of transaction properties,\n * to make sure it can be posted it to the chain\n * @category transaction builder\n * @param transaction - Base64Check-encoded transaction\n * @param node - Node to validate transaction against\n * @param parentTxTypes - Types of parent transactions\n * @returns Array with verification errors\n * @example const errors = await verifyTransaction(transaction, node)\n */\nexport default async function verifyTransaction(\n transaction: Encoded.Transaction | Encoded.Poi,\n node: Node,\n parentTxTypes: Tag[] = [],\n): Promise<ValidatorResult[]> {\n const { tx, txType } = unpackTx<Tag.SignedTx>(transaction);\n const address = getSenderAddress(tx)\n ?? (txType === Tag.SignedTx ? getSenderAddress(tx.encodedTx.tx) : undefined);\n const [account, { height }, { consensusProtocolVersion, nodeNetworkId }] = await Promise.all([\n address == null\n ? undefined\n : node.getAccountByPubkey(address)\n .catch(() => ({ id: address, balance: 0n, nonce: 0 }))\n // TODO: remove after fixing https://github.com/aeternity/aepp-sdk-js/issues/1537\n .then((acc) => ({ ...acc, id: acc.id as Encoded.AccountAddress })),\n node.getCurrentKeyBlockHeight(),\n node.getNodeInfo(),\n ]);\n\n return (await Promise.all(\n validators.map((v) => v(\n tx as any,\n {\n txType, node, account, height, consensusProtocolVersion, nodeNetworkId, parentTxTypes,\n },\n )),\n )).flat();\n}\n\nvalidators.push(\n ({ encodedTx, signatures }, { account, nodeNetworkId, parentTxTypes }) => {\n if ((encodedTx ?? signatures) === undefined) return [];\n if (account == null) return [];\n if (signatures.length !== 1) return []; // TODO: Support multisignature?\n const prefix = Buffer.from([\n nodeNetworkId,\n ...parentTxTypes.includes(Tag.PayingForTx) ? ['inner_tx'] : [],\n ].join('-'));\n const txWithNetworkId = concatBuffers([prefix, encodedTx.rlpEncoded]);\n const txHashWithNetworkId = concatBuffers([prefix, hash(encodedTx.rlpEncoded)]);\n const decodedPub = decode(account.id);\n if (verify(txWithNetworkId, signatures[0], decodedPub)\n || verify(txHashWithNetworkId, signatures[0], decodedPub)) return [];\n return [{\n message: 'Signature cannot be verified, please ensure that you transaction have'\n + ' the correct prefix and the correct private key for the sender address',\n key: 'InvalidSignature',\n checkedKeys: ['encodedTx', 'signatures'],\n }];\n },\n async ({ encodedTx, tx }, { node, parentTxTypes, txType }) => {\n if ((encodedTx ?? tx) === undefined) return [];\n return verifyTransaction(\n encode((encodedTx ?? tx).rlpEncoded, Encoding.Transaction),\n node,\n [...parentTxTypes, txType],\n );\n },\n ({ ttl }, { height }) => {\n if (ttl === undefined) return [];\n ttl = +ttl;\n if (ttl === 0 || ttl >= height) return [];\n return [{\n message: `TTL ${ttl} is already expired, current height is ${height}`,\n key: 'ExpiredTTL',\n checkedKeys: ['ttl'],\n }];\n },\n ({\n amount, fee, nameFee, tx,\n }, { account, parentTxTypes, txType }) => {\n if (account == null) return [];\n if ((amount ?? fee ?? nameFee) === undefined) return [];\n fee ??= 0;\n const cost = new BigNumber(fee).plus(nameFee ?? 0).plus(amount ?? 0)\n .plus(txType === Tag.PayingForTx ? (tx.tx.encodedTx.tx).fee : 0)\n .minus(parentTxTypes.includes(Tag.PayingForTx) ? fee : 0);\n if (cost.lte(account.balance.toString())) return [];\n return [{\n message: `Account balance ${account.balance.toString()} is not enough to execute the transaction that costs ${cost.toFixed()}`,\n key: 'InsufficientBalance',\n checkedKeys: ['amount', 'fee', 'nameFee'],\n }];\n },\n ({ nonce }, { account, parentTxTypes }) => {\n if (nonce == null || account == null || parentTxTypes.includes(Tag.GaMetaTx)) return [];\n nonce = +nonce;\n const validNonce = account.nonce + 1;\n if (nonce === validNonce) return [];\n return [{\n ...nonce < validNonce\n ? {\n message: `Nonce ${nonce} is already used, valid nonce is ${validNonce}`,\n key: 'NonceAlreadyUsed',\n }\n : {\n message: `Nonce ${nonce} is too high, valid nonce is ${validNonce}`,\n key: 'NonceHigh',\n },\n checkedKeys: ['nonce'],\n }];\n },\n ({ ctVersion, abiVersion }, { txType, consensusProtocolVersion }) => {\n if (!isKeyOfObject(consensusProtocolVersion, PROTOCOL_VM_ABI)) {\n throw new UnsupportedProtocolError(`Unsupported protocol: ${consensusProtocolVersion}`);\n }\n const protocol = PROTOCOL_VM_ABI[consensusProtocolVersion];\n\n // If not contract create tx\n if (ctVersion == null) ctVersion = { abiVersion };\n const txProtocol = protocol[txType as keyof typeof protocol];\n if (txProtocol == null) return [];\n if (Object.entries(ctVersion).some(\n ([\n key,\n value,\n ]: [\n key:keyof typeof txProtocol,\n value:any]) => !(txProtocol[key].includes(+value as never)),\n )) {\n return [{\n message: `ABI/VM version ${JSON.stringify(ctVersion)} is wrong, supported is: ${JSON.stringify(txProtocol)}`,\n key: 'VmAndAbiVersionMismatch',\n checkedKeys: ['ctVersion', 'abiVersion'],\n }];\n }\n return [];\n },\n async ({ contractId }, { txType, node }) => {\n if (Tag.ContractCallTx !== txType) return [];\n contractId = contractId as Encoded.ContractAddress;\n try {\n const { active } = await node.getContract(contractId);\n if (active) return [];\n return [{\n message: `Contract ${contractId} is not active`,\n key: 'ContractNotActive',\n checkedKeys: ['contractId'],\n }];\n } catch (error) {\n if (error.response?.parsedBody?.reason == null) throw error;\n return [{\n message: error.response.parsedBody.reason,\n key: 'ContractNotFound',\n checkedKeys: ['contractId'],\n }];\n }\n },\n);\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport { AE_AMOUNT_FORMATS, formatAmount } from './utils/amount-formatter';\nimport verifyTransaction, { ValidatorResult } from './tx/validator';\nimport { pause } from './utils/other';\nimport { isNameValid, produceNameId } from './tx/builder/helpers';\nimport { DRY_RUN_ACCOUNT } from './tx/builder/schema';\nimport { AensName } from './tx/builder/constants';\nimport {\n AensPointerContextError, DryRunError, InvalidAensNameError, TransactionError,\n TxTimedOutError, TxNotInChainError, InternalError,\n} from './utils/errors';\nimport Node, { TransformNodeType } from './Node';\nimport {\n Account as AccountNode, ByteCode, ContractObject, DryRunResult, DryRunResults,\n Generation, KeyBlock, MicroBlockHeader, NameEntry, SignedTx,\n} from './apis/node';\nimport { decode, Encoded, Encoding } from './utils/encoder';\nimport AccountBase from './account/Base';\n\n/**\n * @category chain\n */\nexport function _getPollInterval(\n type: 'block' | 'microblock',\n { _expectedMineRate = 180000, _microBlockCycle = 3000, _maxPollInterval = 5000 }:\n { _expectedMineRate?: number; _microBlockCycle?: number; _maxPollInterval?: number },\n): number {\n const base = {\n block: _expectedMineRate,\n microblock: _microBlockCycle,\n }[type];\n return Math.min(base / 3, _maxPollInterval);\n}\n\n/**\n * @category exception\n */\nexport class InvalidTxError extends TransactionError {\n validation: ValidatorResult[];\n\n transaction: Encoded.Transaction;\n\n constructor(\n message: string,\n validation: ValidatorResult[],\n transaction: Encoded.Transaction,\n ) {\n super(message);\n this.name = 'InvalidTxError';\n this.validation = validation;\n this.transaction = transaction;\n }\n}\n\n/**\n * Obtain current height of the chain\n * @category chain\n * @returns Current chain height\n */\nexport async function getHeight({ onNode }: { onNode: Node }): Promise<number> {\n return (await onNode.getCurrentKeyBlockHeight()).height;\n}\n\n/**\n * Wait for a transaction to be mined\n * @category chain\n * @param th - The hash of transaction to poll\n * @param options - Options\n * @param options.interval - Interval (in ms) at which to poll the chain\n * @param options.blocks - Number of blocks mined after which to fail\n * @param options.onNode - Node to use\n * @returns The transaction as it was mined\n */\nexport async function poll(\n th: Encoded.TxHash,\n {\n blocks = 10, interval, onNode, ...options\n }:\n { blocks?: number; interval?: number; onNode: Node } & Parameters<typeof _getPollInterval>[1],\n): Promise<TransformNodeType<SignedTx>> {\n interval ??= _getPollInterval('microblock', options);\n const max = await getHeight({ onNode }) + blocks;\n do {\n const tx = await onNode.getTransactionByHash(th);\n if (tx.blockHeight !== -1) return tx;\n await pause(interval);\n } while (await getHeight({ onNode }) < max);\n throw new TxTimedOutError(blocks, th);\n}\n\n/**\n * Wait for the chain to reach a specific height\n * @category chain\n * @param height - Height to wait for\n * @param options - Options\n * @param options.interval - Interval (in ms) at which to poll the chain\n * @param options.onNode - Node to use\n * @returns Current chain height\n */\nexport async function awaitHeight(\n height: number,\n { interval, onNode, ...options }:\n { interval?: number; onNode: Node } & Parameters<typeof _getPollInterval>[1],\n): Promise<number> {\n interval ??= _getPollInterval('block', options);\n let currentHeight;\n do {\n if (currentHeight != null) await pause(interval);\n currentHeight = (await onNode.getCurrentKeyBlockHeight()).height;\n } while (currentHeight < height);\n return currentHeight;\n}\n\n/**\n * Wait for transaction confirmation\n * @category chain\n * @param txHash - Transaction hash\n * @param options - Options\n * @param options.confirm - Number of micro blocks to wait for transaction confirmation\n * @param options.onNode - Node to use\n * @returns Current Height\n */\nexport async function waitForTxConfirm(\n txHash: Encoded.TxHash,\n { confirm = 3, onNode, ...options }:\n { confirm?: number; onNode: Node } & Parameters<typeof awaitHeight>[1],\n): Promise<number> {\n const { blockHeight } = await onNode.getTransactionByHash(txHash);\n const height = await awaitHeight(blockHeight + confirm, { onNode, ...options });\n const { blockHeight: newBlockHeight } = await onNode.getTransactionByHash(txHash);\n switch (newBlockHeight) {\n case -1:\n throw new TxNotInChainError(txHash);\n case blockHeight:\n return height;\n default:\n return waitForTxConfirm(txHash, { onNode, confirm, ...options });\n }\n}\n\n/**\n * Submit a signed transaction for mining\n * @category chain\n * @param tx - Transaction to submit\n * @param options - Options\n * @param options.onNode - Node to use\n * @param options.onAccount - Account to use\n * @param options.verify - Verify transaction before sending\n * @param options.waitMined - Ensure that transaction get into block\n * @param options.confirm - Number of micro blocks that should be mined after tx get included\n * @returns Transaction details\n */\nexport async function sendTransaction(\n tx: Encoded.Transaction,\n {\n onNode, onAccount, verify = true, waitMined = true, confirm, ...options\n }:\n SendTransactionOptions,\n): Promise<SendTransactionReturnType> {\n if (verify) {\n const validation = await verifyTransaction(tx, onNode);\n if (validation.length > 0) {\n const message = `Transaction verification errors: ${\n validation.map((v: { message: string }) => v.message).join(', ')}`;\n throw new InvalidTxError(message, validation, tx);\n }\n }\n\n try {\n let __queue;\n try {\n __queue = onAccount != null ? `tx-${await onAccount.address(options)}` : null;\n } catch (error) {\n __queue = null;\n }\n const { txHash } = await onNode.postTransaction(\n { tx },\n __queue != null ? { requestOptions: { customHeaders: { __queue } } } : {},\n );\n\n if (waitMined) {\n const pollResult = await poll(txHash, { onNode, ...options });\n const txData = {\n ...pollResult,\n hash: pollResult.hash as Encoded.TxHash,\n rawTx: tx,\n };\n // wait for transaction confirmation\n if (confirm != null && (confirm === true || confirm > 0)) {\n const c = typeof confirm === 'boolean' ? undefined : confirm;\n return {\n ...txData,\n confirmationHeight: await waitForTxConfirm(txHash, { onNode, confirm: c, ...options }),\n };\n }\n return txData;\n }\n return { hash: txHash, rawTx: tx };\n } catch (error) {\n throw Object.assign(error, {\n rawTx: tx,\n verifyTx: async () => verifyTransaction(tx, onNode),\n });\n }\n}\n\ntype SendTransactionOptionsType = {\n onNode: Node;\n onAccount?: AccountBase;\n verify?: boolean;\n waitMined?: boolean;\n confirm?: boolean | number;\n} & Parameters<typeof poll>[1] & Omit<Parameters<typeof waitForTxConfirm>[1], 'confirm'>;\ninterface SendTransactionOptions extends SendTransactionOptionsType {}\ninterface SendTransactionReturnType extends Partial<TransformNodeType<SignedTx>> {\n hash: Encoded.TxHash;\n rawTx: Encoded.Transaction;\n confirmationHeight?: number;\n}\n\n/**\n * Get account by account public key\n * @category chain\n * @param address - Account address (public key)\n * @param options - Options\n * @param options.height - Get account on specific block by block height\n * @param options.hash - Get account on specific block by micro block hash or key block hash\n * @param options.onNode - Node to use\n */\nexport async function getAccount(\n address: Encoded.AccountAddress | Encoded.ContractAddress,\n { height, hash, onNode }:\n { height?: number; hash?: Encoded.KeyBlockHash | Encoded.MicroBlockHash; onNode: Node },\n): Promise<TransformNodeType<AccountNode>> {\n if (height != null) return onNode.getAccountByPubkeyAndHeight(address, height);\n if (hash != null) return onNode.getAccountByPubkeyAndHash(address, hash);\n return onNode.getAccountByPubkey(address);\n}\n\n/**\n * Request the balance of specified account\n * @category chain\n * @param address - The public account address to obtain the balance for\n * @param options - Options\n * @param options.format\n * @param options.height - The chain height at which to obtain the balance for\n * (default: top of chain)\n * @param options.hash - The block hash on which to obtain the balance for (default: top of chain)\n */\nexport async function getBalance(\n address: Encoded.AccountAddress | Encoded.ContractAddress,\n { format = AE_AMOUNT_FORMATS.AETTOS, ...options }:\n { format?: AE_AMOUNT_FORMATS } & Parameters<typeof getAccount>[1],\n): Promise<string> {\n const { balance } = await getAccount(address, options).catch(() => ({ balance: 0n }));\n\n return formatAmount(balance, { targetDenomination: format });\n}\n\n/**\n * Obtain current generation\n * @category chain\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Current Generation\n */\nexport async function getCurrentGeneration(\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<Generation>> {\n return onNode.getCurrentGeneration();\n}\n\n/**\n * Get generation by hash or height\n * @category chain\n * @param hashOrHeight - Generation hash or height\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Generation\n */\nexport async function getGeneration(\n hashOrHeight: Encoded.KeyBlockHash | number,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<Generation>> {\n if (typeof hashOrHeight === 'number') return onNode.getGenerationByHeight(hashOrHeight);\n return onNode.getGenerationByHash(hashOrHeight);\n}\n\n/**\n * Get micro block transactions\n * @category chain\n * @param hash - Micro block hash\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Transactions\n */\nexport async function getMicroBlockTransactions(\n hash: Encoded.MicroBlockHash,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<SignedTx[]>> {\n return (await onNode.getMicroBlockTransactionsByHash(hash)).transactions;\n}\n\n/**\n * Get key block\n * @category chain\n * @param hashOrHeight - Key block hash or height\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Key Block\n */\nexport async function getKeyBlock(\n hashOrHeight: Encoded.KeyBlockHash | number,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<KeyBlock>> {\n if (typeof hashOrHeight === 'number') return onNode.getKeyBlockByHeight(hashOrHeight);\n return onNode.getKeyBlockByHash(hashOrHeight);\n}\n\n/**\n * Get micro block header\n * @category chain\n * @param hash - Micro block hash\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Micro block header\n */\nexport async function getMicroBlockHeader(\n hash: Encoded.MicroBlockHash,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<MicroBlockHeader>> {\n return onNode.getMicroBlockHeaderByHash(hash);\n}\n\ninterface TxDryRunArguments {\n tx: Encoded.Transaction;\n accountAddress: Encoded.AccountAddress;\n top?: number;\n txEvents?: any;\n resolve: Function;\n reject: Function;\n}\nconst txDryRunRequests: Map<string, TxDryRunArguments[] & { timeout?: NodeJS.Timeout }> = new Map();\n\nasync function txDryRunHandler(key: string, onNode: Node): Promise<void> {\n const rs = txDryRunRequests.get(key);\n txDryRunRequests.delete(key);\n if (rs == null) throw new InternalError('Can\\'t get dry-run request');\n\n let dryRunRes;\n try {\n dryRunRes = await onNode.protectedDryRunTxs({\n top: rs[0].top,\n txEvents: rs[0].txEvents,\n txs: rs.map((req) => ({ tx: req.tx })),\n accounts: Array.from(new Set(rs.map((req) => req.accountAddress)))\n .map((pubKey) => ({ pubKey, amount: DRY_RUN_ACCOUNT.amount })),\n });\n } catch (error) {\n rs.forEach(({ reject }) => reject(error));\n return;\n }\n\n const { results, txEvents } = dryRunRes;\n results.forEach(({ result, reason, ...resultPayload }, idx) => {\n const {\n resolve, reject, tx, accountAddress,\n } = rs[idx];\n if (result === 'ok') resolve({ ...resultPayload, txEvents });\n else reject(Object.assign(new DryRunError(reason as string), { tx, accountAddress }));\n });\n}\n\n/**\n * Transaction dry-run\n * @category chain\n * @param tx - transaction to execute\n * @param accountAddress - address that will be used to execute transaction\n * @param options - Options\n * @param options.top - hash of block on which to make dry-run\n * @param options.txEvents - collect and return on-chain tx events that would result from the call\n * @param options.combine - Enables combining of similar requests to a single dry-run call\n * @param options.onNode - Node to use\n */\nexport async function txDryRun(\n tx: Encoded.Transaction,\n accountAddress: Encoded.AccountAddress,\n {\n top, txEvents, combine, onNode,\n }:\n { top?: number; txEvents?: boolean; combine?: boolean; onNode: Node },\n): Promise<{\n txEvents?: TransformNodeType<DryRunResults['txEvents']>;\n } & TransformNodeType<DryRunResult>> {\n const key = combine === true ? [top, txEvents].join() : 'immediate';\n const requests = txDryRunRequests.get(key) ?? [];\n txDryRunRequests.set(key, requests);\n return new Promise((resolve, reject) => {\n requests.push({\n tx, accountAddress, top, txEvents, resolve, reject,\n });\n if (combine !== true) {\n void txDryRunHandler(key, onNode);\n return;\n }\n requests.timeout ??= setTimeout(() => { void txDryRunHandler(key, onNode); });\n });\n}\n\n/**\n * Get contract byte code\n * @category contract\n * @param contractId - Contract address\n * @param options - Options\n * @param options.onNode - Node to use\n */\nexport async function getContractByteCode(\n contractId: Encoded.ContractAddress,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<ByteCode>> {\n return onNode.getContractCode(contractId);\n}\n\n/**\n * Get contract entry\n * @category contract\n * @param contractId - Contract address\n * @param options - Options\n * @param options.onNode - Node to use\n */\nexport async function getContract(\n contractId: Encoded.ContractAddress,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<ContractObject>> {\n return onNode.getContract(contractId);\n}\n\n/**\n * Get name entry\n * @category AENS\n * @param name - AENS name\n * @param options - Options\n * @param options.onNode - Node to use\n */\nexport async function getName(\n name: AensName,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<NameEntry>> {\n return onNode.getNameEntryByName(name);\n}\n\n/**\n * Resolve AENS name and return name hash\n * @category AENS\n * @param nameOrId - AENS name or address\n * @param key - in AENS pointers record\n * @param options - Options\n * @param options.verify - To ensure that name exist and have a corresponding pointer\n * // TODO: avoid that to don't trust to current api gateway\n * @param options.resolveByNode - Enables pointer resolving using node\n * @param options.onNode - Node to use\n * @returns Address or AENS name hash\n */\nexport async function resolveName <\n Type extends Encoding.AccountAddress | Encoding.ContractAddress,\n>(\n nameOrId: AensName | Encoded.Generic<Type>,\n key: string,\n { verify = true, resolveByNode = false, onNode }:\n { verify?: boolean; resolveByNode?: boolean; onNode: Node },\n): Promise<Encoded.Generic<Type | Encoding.Name>> {\n if (isNameValid(nameOrId)) {\n if (verify || resolveByNode) {\n const name = await onNode.getNameEntryByName(nameOrId);\n const pointer = name.pointers.find((p) => p.key === key);\n if (pointer == null) throw new AensPointerContextError(nameOrId, key);\n if (resolveByNode) return pointer.id as Encoded.Generic<Type>;\n }\n return produceNameId(nameOrId);\n }\n try {\n decode(nameOrId);\n return nameOrId;\n } catch (error) {\n throw new InvalidAensNameError(`Invalid name or address: ${nameOrId}`);\n }\n}\n","import nacl from 'tweetnacl';\nimport { v4 as uuid } from '@aeternity/uuid';\n// js extension is required for mjs build\n// eslint-disable-next-line import/extensions\nimport { ArgonType, hash } from '@aeternity/argon2-browser/dist/argon2-bundled.min.js';\nimport { getAddressFromPriv } from './crypto';\nimport { bytesToHex, hexToBytes } from './bytes';\nimport { InvalidPasswordError } from './errors';\n\nconst DERIVED_KEY_FUNCTIONS = {\n async argon2id(\n pass: string | Uint8Array,\n salt: string | Uint8Array,\n params: Partial<Keystore['crypto']['kdf_params']>,\n ): Promise<Uint8Array> {\n const { memlimit_kib: mem, opslimit: time } = params;\n\n return (await hash({\n hashLen: 32,\n pass,\n salt,\n time,\n mem,\n type: ArgonType.Argon2id,\n })).hash;\n },\n};\n\nconst CRYPTO_FUNCTIONS = {\n 'xsalsa20-poly1305': {\n encrypt: nacl.secretbox,\n decrypt(...args: Parameters<typeof nacl.secretbox.open>): Uint8Array {\n const res = nacl.secretbox.open(...args);\n if (res == null) throw new InvalidPasswordError();\n return res;\n },\n },\n};\n\nexport interface Keystore {\n name: string;\n version: 1;\n public_key: string;\n id: string;\n crypto: {\n secret_type: 'ed25519';\n symmetric_alg: keyof typeof CRYPTO_FUNCTIONS;\n ciphertext: string;\n cipher_params: {\n nonce: string;\n };\n kdf: keyof typeof DERIVED_KEY_FUNCTIONS;\n kdf_params: {\n memlimit_kib: number;\n opslimit: number;\n parallelism: number;\n salt: string;\n };\n };\n}\n\nconst CRYPTO_DEFAULTS = {\n secret_type: 'ed25519',\n symmetric_alg: 'xsalsa20-poly1305',\n kdf: 'argon2id',\n kdf_params: {\n memlimit_kib: 65536,\n opslimit: 3,\n parallelism: 1,\n },\n} as const;\n\n/**\n * Symmetric private key encryption using secret (derived) key.\n * @param plaintext - Data to be encrypted.\n * @param key - Secret key.\n * @param nonce - Randomly generated nonce.\n * @param algo - Encryption algorithm.\n * @returns Encrypted data.\n */\nfunction encrypt(\n plaintext: Uint8Array,\n key: Uint8Array,\n nonce: Uint8Array,\n algo: keyof typeof CRYPTO_FUNCTIONS = CRYPTO_DEFAULTS.symmetric_alg,\n): Uint8Array {\n return CRYPTO_FUNCTIONS[algo].encrypt(plaintext, nonce, key);\n}\n\n/**\n * Symmetric private key decryption using secret (derived) key.\n * @param ciphertext - Data to be decrypted.\n * @param key - Secret key.\n * @param nonce - Nonce from key-object.\n * @param algo - Encryption algorithm.\n * @returns Decrypted data.\n */\nfunction decrypt(\n ciphertext: Uint8Array,\n key: Uint8Array,\n nonce: Uint8Array,\n algo: keyof typeof CRYPTO_FUNCTIONS = CRYPTO_DEFAULTS.symmetric_alg,\n): Uint8Array {\n return CRYPTO_FUNCTIONS[algo].decrypt(ciphertext, nonce, key);\n}\n\n/**\n * Derive secret key from password with key derivation function.\n * @param password - User-supplied password.\n * @param nonce - Randomly generated nonce.\n * @param kdf - Key derivation function.\n * @param kdfParams - KDF parameters.\n * @returns Secret key derived from password.\n */\nasync function deriveKey(\n password: string | Uint8Array,\n nonce: string | Uint8Array,\n kdf: Keystore['crypto']['kdf'],\n kdfParams: Omit<Keystore['crypto']['kdf_params'], 'salt'>,\n): Promise<Uint8Array> {\n return DERIVED_KEY_FUNCTIONS[kdf](password, nonce, kdfParams);\n}\n\n/**\n * Recover plaintext private key from secret-storage key object.\n * @param password - Keystore object password.\n * @param keystore - Keystore object.\n * @returns Plaintext private key.\n */\nexport async function recover(\n password: string | Uint8Array,\n { crypto }: Keystore,\n): Promise<string> {\n const salt = hexToBytes(crypto.kdf_params.salt);\n return bytesToHex(decrypt(\n hexToBytes(crypto.ciphertext),\n await deriveKey(password, salt, crypto.kdf, crypto.kdf_params),\n hexToBytes(crypto.cipher_params.nonce),\n crypto.symmetric_alg,\n ));\n}\n\n/**\n * Export private key to keystore secret-storage format.\n * @param name - Key name.\n * @param password - User-supplied password.\n * @param privateKey - Private key as hex-string or a Buffer.\n * @param nonce - Randomly generated 24byte nonce.\n * @param salt - Randomly generated 16byte salt.\n * @param options - Encryption parameters.\n * @param options.kdf - Key derivation function.\n * @param options.kdf_params - KDF parameters.\n */\nexport async function dump(\n name: string,\n password: string | Uint8Array,\n privateKey: string | Uint8Array,\n nonce: Uint8Array = nacl.randomBytes(24),\n salt: Uint8Array = nacl.randomBytes(16),\n options?: Partial<Keystore['crypto']>,\n): Promise<Keystore> {\n const opt = { ...CRYPTO_DEFAULTS, ...options };\n const derivedKey = await deriveKey(password, salt, opt.kdf, opt.kdf_params);\n const payload = typeof privateKey === 'string' ? hexToBytes(privateKey) : privateKey;\n return {\n name,\n version: 1,\n public_key: getAddressFromPriv(payload),\n id: uuid(),\n crypto: {\n secret_type: opt.secret_type,\n symmetric_alg: opt.symmetric_alg,\n ciphertext: bytesToHex(encrypt(payload, derivedKey, nonce, opt.symmetric_alg)),\n cipher_params: { nonce: bytesToHex(nonce) },\n kdf: opt.kdf,\n kdf_params: {\n ...opt.kdf_params,\n salt: bytesToHex(salt),\n },\n },\n };\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\n/**\n * Transaction methods\n *\n * This is implementation of [Tx](api/tx.md) relays\n * the creation of transactions to {@link Node}.\n * These methods provide ability to create native transactions.\n */\nimport BigNumber from 'bignumber.js';\nimport {\n ABI_VERSIONS, CtVersion, PROTOCOL_VM_ABI, TX_TTL, TxParamsCommon,\n} from './builder/schema';\nimport { Tag } from './builder/constants';\nimport {\n ArgumentError, UnsupportedProtocolError, UnknownTxError, InvalidTxParamsError,\n} from '../utils/errors';\nimport Node from '../Node';\nimport { Encoded } from '../utils/encoder';\nimport { buildTx as syncBuildTx, unpackTx } from './builder/index';\nimport { isKeyOfObject } from '../utils/other';\nimport { AE_AMOUNT_FORMATS } from '../utils/amount-formatter';\n\ntype Int = number | string | BigNumber;\n\nexport type BuildTxOptions <TxType extends Tag, OmitFields extends string> =\n Omit<Parameters<typeof _buildTx<TxType>>[1], OmitFields>;\n\n/**\n * Validated vm/abi version or get default based on transaction type and NODE version\n * @category transaction builder\n * @param txType - Type of transaction\n * @param ctVersion - Object with vm and abi version fields\n * @returns Object with vm/abi version\n */\nexport async function getVmVersion(\n txType: Tag.ContractCreateTx, ctVersion: Partial<CtVersion> & { onNode: Node }\n): Promise<CtVersion>;\nexport async function getVmVersion(\n txType: Tag, ctVersion: Partial<Pick<CtVersion, 'abiVersion'>> & { onNode: Node }\n): Promise<Pick<CtVersion, 'abiVersion'>>;\nexport async function getVmVersion(\n txType: Tag,\n { vmVersion, abiVersion, onNode }: Partial<CtVersion> & { onNode: Node },\n): Promise<Partial<CtVersion>> {\n const { consensusProtocolVersion } = await onNode.getNodeInfo();\n if (!isKeyOfObject(consensusProtocolVersion, PROTOCOL_VM_ABI)) {\n throw new UnsupportedProtocolError('Not supported consensus protocol version');\n }\n const supportedProtocol = PROTOCOL_VM_ABI[consensusProtocolVersion];\n if (!isKeyOfObject(txType, supportedProtocol)) {\n throw new UnknownTxError('Not supported tx type');\n }\n const protocolForTX = supportedProtocol[txType];\n abiVersion ??= protocolForTX.abiVersion[0];\n vmVersion ??= protocolForTX.vmVersion[0];\n return { vmVersion, abiVersion };\n}\n\n/**\n * Calculate fee, get absolute ttl (ttl + height), get account nonce\n * @category transaction builder\n * @param txType - Type of transaction\n * @param params - Object which contains all tx data\n * @returns Object with account nonce, absolute ttl and transaction fee\n */\nexport async function prepareTxParams(\n txType: Tag,\n {\n senderId,\n nonce,\n ttl = TX_TTL,\n absoluteTtl,\n strategy,\n onNode,\n }: PrepareTxParamsOptions,\n): Promise<{ ttl: number; nonce: number }> {\n nonce ??= (\n await onNode.getAccountNextNonce(senderId, { strategy }).catch(() => ({ nextNonce: 1 }))\n ).nextNonce;\n\n if (ttl !== 0) {\n if (ttl < 0) throw new ArgumentError('ttl', 'greater or equal to 0', ttl);\n ttl += absoluteTtl === true ? 0 : (await onNode.getCurrentKeyBlock()).height;\n }\n\n return { ttl, nonce };\n}\n\ninterface PrepareTxParamsOptions extends Pick<TxParamsCommon, 'nonce' | 'ttl'> {\n senderId: Encoded.AccountAddress;\n absoluteTtl?: boolean;\n strategy?: 'continuity' | 'max';\n onNode: Node;\n}\n\n// TODO: find a better name or rearrange methods\n/**\n * @category transaction builder\n */\nexport async function _buildTx<TxType extends Tag>(\n txType: TxType,\n { denomination, absoluteTtl, ..._params }:\n Omit<Parameters<typeof syncBuildTx<TxType, 'tx'>>[0], 'fee' | 'nonce' | 'ttl' | 'ctVersion' | 'abiVersion'>\n & {\n onNode: Node;\n fee?: Int;\n nonce?: number;\n ttl?: number;\n denomination?: AE_AMOUNT_FORMATS;\n absoluteTtl?: boolean;\n }\n & (TxType extends Tag.OracleExtendTx | Tag.OracleResponseTx\n ? { callerId: Encoded.AccountAddress } : {})\n & (TxType extends Tag.ContractCreateTx | Tag.GaAttachTx ? { ctVersion?: CtVersion } : {})\n & (TxType extends Tag.ContractCallTx | Tag.OracleRegisterTx\n ? { abiVersion?: ABI_VERSIONS } : {}),\n): Promise<Encoded.Transaction> {\n // TODO: avoid this assertion\n const params = _params as unknown as TxParamsCommon & { onNode: Node };\n let senderKey: keyof TxParamsCommon | '<absent>';\n switch (txType) {\n case Tag.SpendTx:\n case Tag.OracleQueryTx:\n senderKey = 'senderId';\n break;\n case Tag.NameClaimTx:\n case Tag.NameUpdateTx:\n case Tag.NameRevokeTx:\n case Tag.NameTransferTx:\n case Tag.NamePreclaimTx:\n case Tag.OracleRegisterTx:\n senderKey = 'accountId';\n break;\n case Tag.ContractCreateTx:\n case Tag.GaAttachTx:\n senderKey = 'ownerId';\n break;\n case Tag.ContractCallTx:\n case Tag.OracleExtendTx:\n case Tag.OracleResponseTx:\n senderKey = 'callerId';\n break;\n case Tag.ChannelCloseSoloTx:\n case Tag.ChannelSlashTx:\n case Tag.ChannelSettleTx:\n case Tag.ChannelSnapshotSoloTx:\n senderKey = 'fromId';\n break;\n case Tag.PayingForTx:\n senderKey = 'payerId';\n break;\n default:\n throw new ArgumentError('txType', 'valid transaction type', txType);\n }\n // TODO: move specific cases to field-types\n if ([Tag.ContractCreateTx, Tag.GaAttachTx].includes(txType)) {\n params.ctVersion = await getVmVersion(\n Tag.ContractCreateTx,\n { ...params, ...params.ctVersion },\n );\n }\n if (txType === Tag.ContractCallTx) {\n params.abiVersion = (await getVmVersion(Tag.ContractCallTx, params)).abiVersion;\n }\n if (txType === Tag.OracleRegisterTx) {\n params.abiVersion ??= ABI_VERSIONS.NO_ABI;\n }\n if (txType === Tag.PayingForTx) {\n params.tx = unpackTx(params.tx);\n }\n const senderId = params[senderKey];\n // TODO: do this check on TypeScript level\n if (senderId == null) throw new InvalidTxParamsError(`Transaction field ${senderKey} is missed`);\n const extraParams = await prepareTxParams(txType, { ...params, senderId, absoluteTtl });\n return syncBuildTx({ ...params, ...extraParams } as any, txType, { denomination }).tx;\n}\n","import nacl from 'tweetnacl';\nimport { full as hmac } from 'tweetnacl-auth';\nimport { fromString } from 'bip32-path';\nimport aesjs from 'aes-js';\nimport { sha256hash, encode, Encoding } from './encoder';\nimport { CryptographyError } from './errors';\nimport { bytesToHex } from './bytes';\nimport { concatBuffers } from './other';\n\nconst Ecb = aesjs.ModeOfOperation.ecb;\n\n// TODO: at least don't export `encryptKey` and `decryptKey`\n/**\n * Encrypt given data using `password`\n * @param password - Password to encrypt with\n * @param binaryData - Data to encrypt\n * @returns Encrypted data\n * @deprecated use 'sha.js' and 'aes-js' packages directly instead\n */\nexport function encryptKey(password: string, binaryData: Uint8Array): Uint8Array {\n const hashedPasswordBytes = sha256hash(password);\n const aesEcb = new Ecb(hashedPasswordBytes);\n return aesEcb.encrypt(binaryData);\n}\n\n/**\n * Decrypt given data using `password`\n * @param password - Password to decrypt with\n * @param encrypted - Data to decrypt\n * @returns Decrypted data\n * @deprecated use 'sha.js' and 'aes-js' packages directly instead\n */\nexport function decryptKey(password: string, encrypted: Uint8Array): Uint8Array {\n const encryptedBytes = Buffer.from(encrypted);\n const hashedPasswordBytes = sha256hash(password);\n const aesEcb = new Ecb(hashedPasswordBytes);\n return aesEcb.decrypt(encryptedBytes);\n}\n\n/**\n * @category exception\n */\nexport class DerivationError extends CryptographyError {\n constructor(message: string) {\n super(message);\n this.name = 'DerivationError';\n }\n}\n\nconst ED25519_CURVE = Buffer.from('ed25519 seed');\nconst HARDENED_OFFSET = 0x80000000;\n\ninterface KeyTreeNode {\n secretKey: Uint8Array;\n chainCode: Uint8Array;\n}\n\ninterface HDWallet {\n secretKey: string;\n chainCode: string;\n}\n\ninterface Account {\n secretKey: string;\n publicKey: string;\n}\n\ntype Dec<N extends number> = [-1, 0, 1, 2, 3, 4][N];\ntype Bip32PathT<MaxLen extends number, H extends 'H' | 'h' | '\\''> = MaxLen extends -1\n ? `${number}${H}`\n : Bip32PathT<Dec<MaxLen>, H> | `${Bip32PathT<Dec<MaxLen>, H>}/${number}${H}`;\ntype Bip32Path<MaxLen extends number> =\n '' | Bip32PathT<MaxLen, 'H'> | Bip32PathT<MaxLen, 'h'> | Bip32PathT<MaxLen, '\\''>;\n\nexport function deriveChild({ secretKey, chainCode }: KeyTreeNode, index: number): KeyTreeNode {\n if (index < HARDENED_OFFSET) {\n throw new DerivationError(`Segment ${index} is not hardened`);\n }\n const indexBuffer = Buffer.allocUnsafe(4);\n indexBuffer.writeUInt32BE(index, 0);\n\n const data = concatBuffers([Buffer.alloc(1, 0), secretKey, indexBuffer]);\n\n const I = hmac(data, chainCode);\n const IL = I.slice(0, 32);\n const IR = I.slice(32);\n return {\n secretKey: IL,\n chainCode: IR,\n };\n}\n\nexport function derivePathFromKey(path: Bip32Path<5>, key: KeyTreeNode): KeyTreeNode {\n const segments = path === '' ? [] : fromString(path).toPathArray();\n segments.forEach((segment, i) => {\n if (segment < HARDENED_OFFSET) {\n throw new DerivationError(`Segment #${i + 1} is not hardened`);\n }\n });\n\n return segments.reduce((parentKey, segment) => deriveChild(parentKey, segment), key);\n}\n\nexport function getMasterKeyFromSeed(seed: Uint8Array): KeyTreeNode {\n const I = hmac(seed, ED25519_CURVE);\n const IL = I.slice(0, 32);\n const IR = I.slice(32);\n return {\n secretKey: IL,\n chainCode: IR,\n };\n}\n\nexport function derivePathFromSeed(path: 'm' | `m/${Bip32Path<5>}`, seed: Uint8Array): KeyTreeNode {\n if (!['m', 'm/'].includes(path.slice(0, 2))) {\n throw new DerivationError('Root element is required');\n }\n const masterKey = getMasterKeyFromSeed(seed);\n return derivePathFromKey(path.slice(2) as Bip32Path<5>, masterKey);\n}\n\nfunction formatAccount(keys: nacl.SignKeyPair): Account {\n const { secretKey, publicKey } = keys;\n return {\n secretKey: bytesToHex(secretKey),\n publicKey: encode(publicKey, Encoding.AccountAddress),\n };\n}\n\nexport function getKeyPair(secretKey: Uint8Array): nacl.SignKeyPair {\n return nacl.sign.keyPair.fromSeed(secretKey);\n}\n\nexport function generateSaveHDWalletFromSeed(seed: Uint8Array, password: string): HDWallet {\n const walletKey = derivePathFromSeed('m/44h/457h', seed);\n return {\n secretKey: bytesToHex(encryptKey(password, walletKey.secretKey)),\n chainCode: bytesToHex(encryptKey(password, walletKey.chainCode)),\n };\n}\n\nexport function getSaveHDWalletAccounts(\n saveHDWallet: HDWallet,\n password: string,\n accountCount: number,\n): Account[] {\n const walletKey = {\n secretKey: decryptKey(password, Buffer.from(saveHDWallet.secretKey, 'hex')),\n chainCode: decryptKey(password, Buffer.from(saveHDWallet.chainCode, 'hex')),\n };\n return (new Array(accountCount)).fill(undefined)\n .map((_, idx) => formatAccount(getKeyPair(derivePathFromKey(`${idx}h/0h/0h`, walletKey).secretKey)));\n}\n\nexport const getHdWalletAccountFromSeed = (\n seed: Uint8Array,\n accountIdx: number,\n): Account & { idx: number } => {\n const walletKey = derivePathFromSeed('m/44h/457h', seed);\n const derived = derivePathFromKey(`${accountIdx}h/0h/0h`, walletKey);\n const keyPair = getKeyPair(derived.secretKey);\n return {\n ...formatAccount(keyPair),\n idx: accountIdx,\n };\n};\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport BigNumber from 'bignumber.js';\nimport {\n sendTransaction, getAccount, getBalance, resolveName,\n} from './chain';\nimport { _buildTx, BuildTxOptions } from './tx';\nimport { buildTxHash, unpackTx } from './tx/builder';\nimport { ArgumentError } from './utils/errors';\nimport { Encoded, Encoding } from './utils/encoder';\nimport { Tag, AensName } from './tx/builder/constants';\nimport AccountBase from './account/Base';\n\n/**\n * Sign and post a transaction to the chain\n * @category chain\n * @param tx - Transaction\n * @param options - Options\n * @param options.verify - Verify transaction before broadcast, throw error if not\n * valid\n * @returns Transaction\n */\nexport async function send(\n tx: Encoded.Transaction,\n options: SendOptions,\n): Promise<SendReturnType> {\n // TODO: detect authFun in AccountGa\n const authFun = options.innerTx === true\n ? undefined\n : (await getAccount(await options.onAccount.address(options), options)).authFun;\n\n const signed = await options.onAccount.signTransaction(tx, {\n ...options,\n authFun,\n networkId: (await options.onNode.getStatus()).networkId,\n });\n\n return options.innerTx === true\n ? { hash: buildTxHash(signed), rawTx: signed }\n : sendTransaction(signed, options);\n}\n\ntype SendOptionsType = Parameters<AccountBase['signTransaction']>[1]\n& Parameters<typeof sendTransaction>[1] & { onAccount: AccountBase };\nexport interface SendOptions extends SendOptionsType {}\ninterface SendReturnType extends Awaited<ReturnType<typeof sendTransaction>> {}\n\n/**\n * Send coins to another account\n * @category chain\n * @param amount - Amount to spend\n * @param recipientIdOrName - Address or name of recipient account\n * @param options - Options\n * @returns Transaction\n */\nexport async function spend(\n amount: number | string,\n recipientIdOrName: Encoded.AccountAddress | AensName,\n options: SpendOptions,\n): ReturnType<typeof send> {\n return send(\n await _buildTx(Tag.SpendTx, {\n ...options,\n senderId: await options.onAccount.address(options),\n recipientId: await resolveName<Encoding.AccountAddress>(\n recipientIdOrName,\n 'account_pubkey',\n options,\n ),\n amount,\n }),\n options,\n );\n}\n\ntype SpendOptionsType = BuildTxOptions<Tag.SpendTx, 'senderId' | 'recipientId' | 'amount'>\n& Parameters<typeof resolveName>[2] & { onAccount: AccountBase } & SendOptions;\ninterface SpendOptions extends SpendOptionsType {}\n\n// TODO: Rename to spendFraction\n/**\n * Send a fraction of coin balance to another account\n * @category chain\n * @param fraction - Fraction of balance to spend (between 0 and 1)\n * @param recipientIdOrName - Address or name of recipient account\n * @param options - Options\n * @returns Transaction\n */\nexport async function transferFunds(\n fraction: number | string,\n recipientIdOrName: AensName | Encoded.AccountAddress,\n options: TransferFundsOptions,\n): ReturnType<typeof send> {\n if (fraction < 0 || fraction > 1) {\n throw new ArgumentError('fraction', 'a number between 0 and 1', fraction);\n }\n const recipientId = await resolveName<Encoding.AccountAddress>(\n recipientIdOrName,\n 'account_pubkey',\n options,\n );\n const senderId = await options.onAccount.address(options);\n const balance = new BigNumber(\n await getBalance.bind(options.onAccount)(senderId, options),\n );\n const desiredAmount = balance.times(fraction).integerValue(BigNumber.ROUND_HALF_UP);\n const { tx: { fee } } = unpackTx(\n await _buildTx(Tag.SpendTx, {\n ...options, senderId, recipientId, amount: desiredAmount,\n }),\n Tag.SpendTx,\n );\n // Reducing of the amount may reduce transaction fee, so this is not completely accurate\n const amount = desiredAmount.plus(fee).gt(balance) ? balance.minus(fee) : desiredAmount;\n return send(\n await _buildTx(Tag.SpendTx, {\n ...options, senderId, recipientId, amount,\n }),\n options,\n );\n}\n\ntype TransferFundsOptionsType = BuildTxOptions<Tag.SpendTx, 'senderId' | 'recipientId' | 'amount'>\n& Parameters<typeof resolveName>[2] & { onAccount: AccountBase } & SendOptions;\ninterface TransferFundsOptions extends TransferFundsOptionsType {}\n\n/**\n * Submit transaction of another account paying for it (fee and gas)\n * @category chain\n * @param transaction - tx_<base64>-encoded transaction\n * @param options - Options\n * @returns Object Transaction\n */\nexport async function payForTransaction(\n transaction: Encoded.Transaction,\n options: PayForTransactionOptions,\n): ReturnType<typeof send> {\n return send(\n await _buildTx(\n Tag.PayingForTx,\n { ...options, payerId: await options.onAccount.address(options), tx: transaction },\n ),\n options,\n );\n}\n\ninterface PayForTransactionOptions extends\n BuildTxOptions<Tag.PayingForTx, 'payerId' | 'tx'>, SendOptions {\n onAccount: AccountBase;\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\n/**\n * Aens methods - routines to interact with the æternity naming system\n *\n * The high-level description of the naming system is\n * https://github.com/aeternity/protocol/blob/master/AENS.md in the protocol\n * repository.\n */\n\nimport BigNumber from 'bignumber.js';\nimport { genSalt } from './utils/crypto';\nimport { commitmentHash, isAuctionName } from './tx/builder/helpers';\nimport {\n CLIENT_TTL, NAME_TTL, Tag, AensName,\n} from './tx/builder/constants';\nimport { ArgumentError } from './utils/errors';\nimport { Encoded } from './utils/encoder';\nimport { send, SendOptions } from './spend';\nimport { getName, getHeight } from './chain';\nimport { _buildTx, BuildTxOptions } from './tx';\nimport { TransformNodeType } from './Node';\nimport { NameEntry, NamePointer } from './apis/node';\nimport AccountBase from './account/Base';\n\ninterface KeyPointers {\n [key: string]: string | Buffer;\n}\n\n/**\n * Revoke a name\n * @category AENS\n * @param name - Name hash\n * @param options - Options\n * @param options.onAccount - Make operation on specific account from sdk (you pass\n * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param options.fee - fee\n * @param options.ttl - ttl\n * @param options.nonce - nonce\n * @returns Transaction result\n * @example\n * ```js\n * const name = 'test.chain'\n * const nameObject = await sdkInstance.aensQuery(name)\n *\n * await sdkInstance.aensRevoke(name, { fee, ttl , nonce })\n * // or\n * await nameObject.revoke({ fee, ttl, nonce })\n * ```\n */\nexport async function aensRevoke(\n name: AensName,\n options: AensRevokeOptions,\n): ReturnType<typeof send> {\n const nameRevokeTx = await _buildTx(Tag.NameRevokeTx, {\n ...options,\n nameId: name,\n accountId: await options.onAccount.address(options),\n });\n return send(nameRevokeTx, options);\n}\n\ninterface AensRevokeOptions extends\n BuildTxOptions<Tag.NameRevokeTx, 'nameId' | 'accountId'>,\n SendOptions {}\n\n/**\n * Update a name\n * @category AENS\n * @param name - AENS name\n * @param pointers - Map of pointer keys to corresponding addresses\n * @param options - Options\n * @param options.extendPointers - Get the pointers from the node and merge with provided\n * ones. Pointers with the same type will be overwritten\n * @param options.onAccount - Make operation on specific account from sdk (you\n * pass publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param options.fee - fee\n * @param options.ttl - ttl\n * @param options.nonce - nonce\n * @param options.nameTtl - Name ttl represented in number of\n * blocks (Max value is 50000 blocks)\n * @param options.clientTtl=84600 a suggestion as to how long any\n * clients should cache this information\n * @throws Invalid pointer array error\n * @example\n * ```js\n * const name = 'test.chain'\n * const pointersArray = ['ak_asd23dasdas...,' 'ct_asdf34fasdasd...']\n * const nameObject = await sdkInstance.aensQuery(name)\n *\n * await sdkInstance.aensUpdate(name, pointersArray, { nameTtl, ttl, fee, nonce, clientTtl })\n * // or\n * await nameObject.update(pointers, { nameTtl, ttl, fee, nonce, clientTtl })\n * ```\n */\nexport async function aensUpdate(\n name: AensName,\n pointers: KeyPointers,\n { extendPointers, ...options }: AensUpdateOptions,\n): ReturnType<typeof send> {\n const allPointers = {\n ...extendPointers === true && Object.fromEntries(\n (await getName(name, options)).pointers\n .map(({ key, id }: { key: string; id: string }) => [key, id]),\n ),\n ...pointers,\n };\n\n const nameUpdateTx = await _buildTx(Tag.NameUpdateTx, {\n clientTtl: CLIENT_TTL,\n nameTtl: NAME_TTL,\n ...options,\n nameId: name,\n accountId: await options.onAccount.address(options),\n pointers: Object.entries(allPointers).map(([key, id]) => ({ key, id: id.toString() })),\n });\n\n return send(nameUpdateTx, options);\n}\n\ninterface AensUpdateOptions extends\n BuildTxOptions<Tag.NameUpdateTx, 'nameId' | 'accountId' | 'pointers' | 'clientTtl' | 'nameTtl'>,\n SendOptions {\n extendPointers?: boolean;\n clientTtl?: number;\n nameTtl?: number;\n}\n\n/**\n * Transfer a domain to another account\n * @category AENS\n * @param name - AENS name\n * @param account - Recipient account publick key\n * @param options - Options\n * @param options.onAccount - Make operation on specific account from sdk (you pass\n * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param options.fee - fee\n * @param options.ttl - ttl\n * @param options.nonce - nonce\n * @returns Transaction result\n * @example\n * ```js\n * const name = 'test.chain'\n * const recipientPub = 'ak_asd23dasdas...'\n * const nameObject = await sdkInstance.aensQuery(name)\n *\n * await sdkInstance.aensTransfer(name, recipientPub, { ttl, fee, nonce })\n * // or\n * await nameObject.transfer(recipientPub, { ttl, fee, nonce })\n * ```\n */\nexport async function aensTransfer(\n name: AensName,\n account: Encoded.AccountAddress,\n options: AensTransferOptions,\n): ReturnType<typeof send> {\n const nameTransferTx = await _buildTx(Tag.NameTransferTx, {\n ...options,\n nameId: name,\n accountId: await options.onAccount.address(options),\n recipientId: account,\n });\n\n return send(nameTransferTx, options);\n}\n\ninterface AensTransferOptions extends\n BuildTxOptions<Tag.NameTransferTx, 'nameId' | 'accountId' | 'recipientId'>,\n SendOptions {}\n\n/**\n * Query the AENS name info from the node\n * and return the object with info and predefined functions for manipulating name\n * @category AENS\n * @param name - AENS name\n * @param opt - Options\n * @returns\n * @example\n * ```js\n * const nameObject = sdkInstance.aensQuery('test.chain')\n * console.log(nameObject)\n * {\n * id, // name hash\n * pointers, // array of pointers\n * update, // Update name function\n * extendTtl, // Extend Ttl name function\n * transfer, // Transfer name function\n * revoke // Revoke name function\n * }\n * ```\n */\nexport async function aensQuery(\n name: AensName,\n opt: Parameters<typeof getName>[1] & Parameters<typeof aensUpdate>[2]\n & Parameters<typeof aensTransfer>[2],\n): Promise<Readonly<\n TransformNodeType<NameEntry> & {\n id: Encoded.Name;\n owner: Encoded.AccountAddress;\n pointers: KeyPointers | NamePointer[];\n ttl: number;\n update: (\n pointers: KeyPointers,\n options?: Omit<Parameters<typeof aensQuery>[1], 'onNode' | 'onCompiler' | 'onAccount'> & {\n onAccount?: AccountBase;\n }\n ) => ReturnType<typeof aensUpdate> & ReturnType<typeof aensQuery>;\n transfer: (\n account: Encoded.AccountAddress,\n options?: Parameters<typeof aensQuery>[1]\n ) => ReturnType<typeof aensUpdate> & ReturnType<typeof aensQuery>;\n revoke: (options?: Omit<Parameters<typeof aensRevoke>[1], 'onNode' | 'onCompiler' | 'onAccount'> & {\n onAccount?: AccountBase;\n }\n ) => ReturnType<typeof aensRevoke>;\n extendTtl: (\n nameTtl: number,\n options?: Omit<Parameters<typeof aensQuery>[1], 'onNode' | 'onCompiler' | 'onAccount'>\n ) => ReturnType<typeof aensUpdate> & ReturnType<typeof aensQuery>;\n }\n >> {\n const nameEntry = await getName(name, opt);\n return Object.freeze({\n ...nameEntry,\n id: nameEntry.id as Encoded.Name,\n owner: nameEntry.owner as Encoded.AccountAddress,\n async update(pointers, options) {\n return {\n ...await aensUpdate(name, pointers, { ...opt, ...options }),\n ...await aensQuery(name, { ...opt, ...options }),\n };\n },\n async transfer(account, options) {\n return {\n ...await aensTransfer(name, account, { ...opt, ...options }),\n ...await aensQuery(name, { ...opt, ...options }),\n };\n },\n async revoke(options) {\n return aensRevoke(name, { ...opt, ...options });\n },\n async extendTtl(nameTtl = NAME_TTL, options = {}) {\n if (nameTtl > NAME_TTL || nameTtl <= 0) {\n throw new ArgumentError('nameTtl', `a number between 1 and ${NAME_TTL} blocks`, nameTtl);\n }\n\n return {\n ...await aensUpdate(name, {}, {\n ...opt, ...options, nameTtl, extendPointers: true,\n }),\n ...await aensQuery(name, { ...opt, ...options }),\n };\n },\n });\n}\n\n/**\n * Claim a previously preclaimed registration. This can only be done after the\n * preclaim step\n * @category AENS\n * @param name - AENS name\n * @param salt - Salt from pre-claim, or 0 if it's a bid\n * @param options - options\n * @param options.onAccount - Make operation on specific account from sdk (you pass\n * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param options.fee - fee\n * @param options.ttl - ttl\n * @param options.nonce - nonce\n * @param options.nameFee - Name Fee (By default calculated by sdk)\n * @returns the result of the claim\n * @example\n * ```js\n * const name = 'test.chain'\n * const salt = preclaimResult.salt // salt from pre-claim transaction\n *\n * await sdkInstance.aensClaim(name, salt, { ttl, fee, nonce, nameFee })\n * ```\n */\nexport async function aensClaim(\n name: AensName,\n salt: number,\n options: AensClaimOptions,\n): Promise<AensClaimReturnType> {\n const claimTx = await _buildTx(Tag.NameClaimTx, {\n ...options,\n accountId: await options.onAccount.address(options),\n nameSalt: salt,\n name,\n });\n\n const result = await send(claimTx, options);\n if (!isAuctionName(name)) {\n const nameInter = result.blockHeight != null && result.blockHeight > 0\n ? await aensQuery(name, options)\n : {};\n return Object.assign(result, nameInter);\n }\n return result;\n}\n\ntype AensClaimOptionsType = BuildTxOptions<Tag.NameClaimTx, 'accountId' | 'nameSalt' | 'name'>\n& SendOptions & Parameters<typeof aensQuery>[1];\ninterface AensClaimOptions extends AensClaimOptionsType {}\ninterface AensClaimReturnType extends\n Awaited<ReturnType<typeof send>>,\n Partial<Awaited<ReturnType<typeof aensQuery>>> {}\n\n/**\n * Preclaim a name. Sends a hash of the name and a random salt to the node\n * @category AENS\n * @param name - AENS name\n * @param options - Options\n * @param options.onAccount - Make operation on specific account from sdk (you pass\n * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param options.fee - fee\n * @param options.ttl - ttl\n * @param options.nonce - nonce\n * @example\n * ```js\n * const name = 'test.chain'\n * const salt = preclaimResult.salt // salt from pre-claim transaction\n *\n * await sdkInstance.aensPreclaim(name, { ttl, fee, nonce })\n * {\n * ...transactionResult,\n * claim, // Claim function (options={}) => claimTransactionResult\n * salt,\n * commitmentId\n * }\n * ```\n */\nexport async function aensPreclaim(name: AensName, options: AensPreclaimOptions): Promise<Readonly<\nAwaited<ReturnType<typeof send>> & {\n height: number;\n salt: number;\n commitmentId: string;\n claim: (opts?: Parameters<typeof aensClaim>[2]) => ReturnType<typeof aensClaim>;\n}\n>> {\n const salt = genSalt();\n const height = await getHeight(options);\n const commitmentId = commitmentHash(name, salt);\n\n const preclaimTx = await _buildTx(Tag.NamePreclaimTx, {\n ...options,\n accountId: await options.onAccount.address(options),\n commitmentId,\n });\n\n return Object.freeze({\n ...await send(preclaimTx, options),\n height,\n salt,\n commitmentId,\n async claim(opts?: Parameters<typeof aensClaim>[2]) {\n return aensClaim(name, salt, { ...options, ...opts });\n },\n });\n}\n\ninterface AensPreclaimOptions extends\n BuildTxOptions<Tag.NamePreclaimTx, 'accountId' | 'commitmentId'>,\n SendOptions,\n AensClaimOptions {}\n\n/**\n * Bid to name auction\n * @category AENS\n * @param name - Domain name\n * @param nameFee - Name fee (bid fee)\n * @param options - Options\n * @param options.onAccount - Make operation on specific account from sdk (you pass\n * publickKey) or using provided KeyPair(Can be keypair object or MemoryAccount)\n * @param options.fee - fee\n * @param options.ttl - ttl\n * @param options.nonce - nonce\n * @returns Transaction result\n * @example\n * ```js\n * const name = 'test.chain'\n * const bidFee = computeBidFee(name, startFee, incrementPercentage)\n *\n * await sdkInstance.aensBid(name, 213109412839123, { ttl, fee, nonce })\n * ```\n */\nexport async function aensBid(\n name: AensName,\n nameFee: number | string | BigNumber,\n options: Omit<Parameters<typeof aensClaim>[2], 'nameFee'>,\n): ReturnType<typeof aensClaim> {\n return aensClaim(name, 0, { ...options, nameFee });\n}\n","/*\n* ISC License (ISC)\n* Copyright (c) 2022 aeternity developers\n*\n* Permission to use, copy, modify, and/or distribute this software for any\n* purpose with or without fee is hereby granted, provided that the above\n* copyright notice and this permission notice appear in all copies.\n*\n* THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n* PERFORMANCE OF THIS SOFTWARE.\n*/\nimport { Encoder as Calldata } from '@aeternity/aepp-calldata';\nimport { DRY_RUN_ACCOUNT, AMOUNT } from '../tx/builder/schema';\nimport { Tag, AensName } from '../tx/builder/constants';\nimport { buildContractIdByContractTx, unpackTx } from '../tx/builder';\nimport { _buildTx } from '../tx';\nimport { send } from '../spend';\nimport { decode, Encoded } from '../utils/encoder';\nimport {\n MissingContractDefError,\n MissingContractAddressError,\n InactiveContractError,\n BytecodeMismatchError,\n DuplicateContractError,\n MissingFunctionNameError,\n InvalidMethodInvocationError,\n NotPayableFunctionError,\n TypeError,\n NodeInvocationError,\n IllegalArgumentError,\n NoSuchContractFunctionError,\n MissingEventDefinitionError,\n AmbiguousEventDefinitionError,\n UnexpectedTsError,\n InternalError,\n} from '../utils/errors';\nimport { hash as calcHash } from '../utils/crypto';\nimport { Aci as BaseAci } from '../apis/compiler';\nimport { ContractCallReturnType } from '../apis/node';\nimport Compiler from './Compiler';\nimport Node from '../Node';\nimport {\n getAccount, getContract, getContractByteCode, getKeyBlock, resolveName, txDryRun,\n} from '../chain';\nimport AccountBase from '../account/Base';\n\ninterface FunctionACI {\n arguments: any[];\n name: string;\n payable: boolean;\n returns: string;\n stateful: boolean;\n}\n\ninterface Aci extends BaseAci {\n encodedAci: {\n contract: {\n name: string;\n event: any;\n kind: string;\n state: any;\n type_defs: any[];\n functions: FunctionACI[];\n };\n };\n externalEncodedAci: any[];\n}\n\ninterface Event {\n address: Encoded.ContractAddress;\n data: string;\n topics: Array<string | number>;\n}\n\ninterface DecodedEvent {\n name: string;\n args: unknown;\n contract: {\n name: string;\n address: Encoded.ContractAddress;\n };\n}\n\ntype TxData = Awaited<ReturnType<typeof send>>;\n\nexport interface ContractInstance {\n _aci: Aci;\n _name: string;\n calldata: any;\n source?: string;\n bytecode?: Encoded.ContractBytearray;\n deployInfo: {\n address?: Encoded.ContractAddress;\n result?: {\n callerId: string;\n callerNonce: string;\n contractId: string;\n gasPrice: bigint;\n gasUsed: number;\n height: number;\n log: any[];\n returnType: ContractCallReturnType;\n returnValue: string;\n };\n owner?: Encoded.AccountAddress;\n transaction?: string;\n rawTx?: string;\n txData?: TxData;\n };\n options: any;\n compile: (options?: {}) => Promise<Encoded.ContractBytearray>;\n _estimateGas: (name: string, params: any[], options: object) => Promise<number>;\n deploy: (params?: any[], options?: object) => Promise<any>;\n call: (fn: string, params?: any[], options?: {}) => Promise<{\n hash: string;\n tx: any;\n txData: TxData;\n rawTx: string;\n result: {\n callerId: Encoded.AccountAddress;\n callerNonce: number;\n contractId: Encoded.ContractAddress;\n gasPrice: number;\n gasUsed: number;\n height: number;\n log: any[];\n returnType: ContractCallReturnType;\n returnValue: string;\n };\n decodedResult: any;\n decodedEvents: DecodedEvent[];\n }>;\n decodeEvents: (\n events: Event[], options?: { omitUnknown?: boolean; contractAddressToName?: any }\n ) => DecodedEvent[];\n methods: any;\n}\n\n/**\n * Generate contract ACI object with predefined js methods for contract usage - can be used for\n * creating a reference to already deployed contracts\n * @category contract\n * @param options - Options object\n * @returns JS Contract API\n * @example\n * ```js\n * const contractIns = await aeSdk.getContractInstance({ source })\n * await contractIns.deploy([321]) or await contractIns.methods.init(321)\n * const callResult = await contractIns.call('setState', [123]) or\n * await contractIns.methods.setState.send(123, options)\n * const staticCallResult = await contractIns.call('setState', [123], { callStatic: true }) or\n * await contractIns.methods.setState.get(123, options)\n * ```\n * Also you can call contract like: `await contractIns.methods.setState(123, options)`\n * Then sdk decide to make on-chain or static call(dry-run API) transaction based on function is\n * stateful or not\n */\nexport default async function getContractInstance({\n onAccount,\n onCompiler,\n onNode,\n source,\n bytecode,\n aci: _aci,\n contractAddress,\n fileSystem = {},\n validateBytecode,\n ...otherOptions\n}: {\n onAccount?: AccountBase;\n onCompiler: Compiler;\n onNode: Node;\n source?: string;\n bytecode?: Encoded.ContractBytearray;\n aci?: Aci;\n contractAddress?: Encoded.ContractAddress | AensName;\n fileSystem?: Record<string, string>;\n validateBytecode?: boolean;\n [key: string]: any;\n}): Promise<ContractInstance> {\n if (_aci == null && source != null) {\n // TODO: should be fixed when the compiledAci interface gets updated\n _aci = await onCompiler.generateACI({ code: source, options: { fileSystem } }) as Aci;\n }\n if (_aci == null) throw new MissingContractDefError();\n\n if (contractAddress != null) {\n contractAddress = await resolveName(\n contractAddress,\n 'contract_pubkey',\n { resolveByNode: true, onNode },\n ) as Encoded.ContractAddress;\n }\n\n if (contractAddress == null && source == null && bytecode == null) {\n throw new MissingContractAddressError('Can\\'t create instance by ACI without address');\n }\n\n if (contractAddress != null) {\n const contract = await getContract(contractAddress, { onNode });\n if (contract.active == null) throw new InactiveContractError(contractAddress);\n }\n\n const instance: ContractInstance = {\n _aci,\n _name: _aci.encodedAci.contract.name,\n calldata: new Calldata([_aci.encodedAci, ..._aci.externalEncodedAci]),\n source,\n bytecode,\n deployInfo: { address: contractAddress },\n options: {\n onAccount,\n onCompiler,\n onNode,\n amount: AMOUNT,\n callStatic: false,\n fileSystem,\n ...otherOptions,\n },\n /* eslint-disable @typescript-eslint/no-unused-vars */\n /* eslint-disable @typescript-eslint/no-empty-function */\n async compile(_options?: {}): Promise<any> {},\n async _estimateGas(_name: string, _params: any[], _options: object): Promise<any> {},\n async deploy(_params?: any[], _options?: any): Promise<any> {},\n async call(_fn: string, _params?: any[], _options?: {}): Promise<any> {},\n decodeEvents(_events: Event[], options?: { omitUnknown?: boolean }): any {},\n /* eslint-enable @typescript-eslint/no-unused-vars */\n /* eslint-enable @typescript-eslint/no-empty-function */\n methods: undefined,\n };\n\n if (validateBytecode != null) {\n if (contractAddress == null) throw new MissingContractAddressError('Can\\'t validate bytecode without contract address');\n const onChanBytecode = (await getContractByteCode(contractAddress, { onNode })).bytecode;\n const isValid: boolean = source != null\n ? await onCompiler.validateByteCode(\n { bytecode: onChanBytecode, source, options: instance.options },\n ).then(() => true, () => false)\n : bytecode === onChanBytecode;\n if (!isValid) throw new BytecodeMismatchError(source != null ? 'source' : 'bytecode');\n }\n\n /**\n * Compile contract\n * @returns bytecode\n */\n instance.compile = async (options = {}): Promise<Encoded.ContractBytearray> => {\n if (instance.bytecode != null) throw new IllegalArgumentError('Contract already compiled');\n if (instance.source == null) throw new IllegalArgumentError('Can\\'t compile without source code');\n instance.bytecode = (await onCompiler.compileContract({\n code: instance.source, options: { ...instance.options, ...options },\n })).bytecode as Encoded.ContractBytearray;\n return instance.bytecode;\n };\n\n const handleCallError = (\n { returnType, returnValue }: {\n returnType: ContractCallReturnType;\n returnValue: Encoded.ContractBytearray;\n },\n transaction: string,\n ): void => {\n let message: string;\n switch (returnType) {\n case 'ok': return;\n case 'revert':\n message = instance.calldata.decodeFateString(returnValue);\n break;\n case 'error':\n message = decode(returnValue).toString();\n break;\n default:\n throw new InternalError(`Unknown return type: ${returnType}`);\n }\n throw new NodeInvocationError(message, transaction);\n };\n\n const sendAndProcess = async (tx: Encoded.Transaction, options: any): Promise<{\n result?: ContractInstance['deployInfo']['result'];\n hash: TxData['hash'];\n tx: Awaited<ReturnType<typeof unpackTx<Tag.ContractCallTx | Tag.ContractCreateTx>>>;\n txData: TxData;\n rawTx: Encoded.Transaction;\n }> => {\n options = { ...instance.options, ...options };\n const txData = await send(tx, options);\n const result = {\n hash: txData.hash,\n tx: unpackTx<Tag.ContractCallTx | Tag.ContractCreateTx>(txData.rawTx),\n txData,\n rawTx: txData.rawTx,\n };\n if (txData.blockHeight == null) return result;\n const { callInfo } = await onNode.getTransactionInfoByHash(txData.hash);\n Object.assign(result.txData, callInfo); // TODO: don't duplicate data in result\n // @ts-expect-error TODO api should be updated to match types\n handleCallError(callInfo, tx);\n return { ...result, result: callInfo };\n };\n\n instance._estimateGas = async (name: string, params: any[], options: object): Promise<number> => {\n const { result: { gasUsed } } = await instance\n .call(name, params, { ...options, callStatic: true });\n // taken from https://github.com/aeternity/aepp-sdk-js/issues/1286#issuecomment-977814771\n return Math.floor(gasUsed * 1.25);\n };\n\n /**\n * Deploy contract\n * @param params - Contract init function arguments array\n * @param options - Options\n * @returns deploy info\n */\n instance.deploy = async (\n params = [],\n options?:\n Parameters<typeof instance.compile>[0] &\n Parameters<typeof instance.call>[2] &\n Parameters<AccountBase['address']>[0] &\n Parameters<typeof sendAndProcess>[1],\n ): Promise<ContractInstance['deployInfo']> => {\n const opt = { ...instance.options, ...options };\n if (instance.bytecode == null) await instance.compile(opt);\n // @ts-expect-error TODO: need to fix compatibility between return types of `deploy` and `call`\n if (opt.callStatic === true) return instance.call('init', params, opt);\n if (instance.deployInfo.address != null) throw new DuplicateContractError();\n\n const ownerId = await opt.onAccount.address(options);\n const tx = await _buildTx(Tag.ContractCreateTx, {\n ...opt,\n gasLimit: opt.gasLimit ?? await instance._estimateGas('init', params, opt),\n callData: instance.calldata.encode(instance._name, 'init', params),\n code: instance.bytecode,\n ownerId,\n onNode,\n });\n const contractId = buildContractIdByContractTx(tx);\n const {\n hash, rawTx, result, txData,\n } = await sendAndProcess(tx, opt);\n instance.deployInfo = Object.freeze({\n result,\n owner: ownerId,\n transaction: hash,\n rawTx,\n txData,\n address: contractId,\n });\n return instance.deployInfo;\n };\n\n /**\n * Get function schema from contract ACI object\n * @param name - Function name\n * @returns function ACI\n */\n function getFunctionACI(name: string): Partial<FunctionACI> {\n const fn = instance._aci.encodedAci.contract.functions.find(\n (f: { name: string }) => f.name === name,\n );\n if (fn != null) {\n return fn;\n }\n if (name === 'init') return { payable: false };\n throw new NoSuchContractFunctionError(`Function ${name} doesn't exist in contract`);\n }\n\n /**\n * Call contract function\n * @param fn - Function name\n * @param params - Array of function arguments\n * @param options - Array of function arguments\n * @returns CallResult\n */\n instance.call = async (fn: string, params: any[] = [], options: object = {}) => {\n const opt = { ...instance.options, ...options };\n const fnACI = getFunctionACI(fn);\n const contractId = instance.deployInfo.address;\n\n if (fn == null) throw new MissingFunctionNameError();\n if (fn === 'init' && opt.callStatic === false) throw new InvalidMethodInvocationError('\"init\" can be called only via dryRun');\n if (contractId == null && fn !== 'init') throw new InvalidMethodInvocationError('You need to deploy contract before calling!');\n if (fn !== 'init' && opt.amount > 0 && fnACI.payable === false) throw new NotPayableFunctionError(opt.amount, fn);\n\n const callerId = await Promise.resolve()\n .then(() => opt.onAccount.address(opt))\n .catch((error: any) => {\n if (opt.callStatic === true) return DRY_RUN_ACCOUNT.pub;\n throw error;\n }) as Encoded.AccountAddress;\n const callData = instance.calldata.encode(instance._name, fn, params);\n\n let res: any;\n if (opt.callStatic === true) {\n if (typeof opt.top === 'number') {\n opt.top = (await getKeyBlock(opt.top, { onNode })).hash;\n }\n const txOpt = { ...opt, onNode, callData };\n if (opt.nonce == null && opt.top != null) {\n opt.nonce = (await getAccount(callerId, { hash: opt.top, onNode })).nonce + 1;\n }\n const tx = await (fn === 'init'\n ? _buildTx(Tag.ContractCreateTx, { ...txOpt, code: instance.bytecode, ownerId: callerId })\n : _buildTx(Tag.ContractCallTx, { ...txOpt, callerId, contractId }));\n\n const { callObj, ...dryRunOther } = await txDryRun(tx, callerId, { onNode, ...opt });\n if (callObj == null) throw new UnexpectedTsError();\n handleCallError({\n returnType: callObj.returnType as ContractCallReturnType,\n returnValue: callObj.returnValue as Encoded.ContractBytearray,\n }, tx);\n res = { ...dryRunOther, tx: unpackTx(tx), result: callObj };\n } else {\n const tx = await _buildTx(Tag.ContractCallTx, {\n ...opt,\n onNode,\n gasLimit: opt.gasLimit ?? await instance._estimateGas(fn, params, opt),\n callerId,\n contractId,\n callData,\n });\n res = await sendAndProcess(tx, opt);\n }\n if (opt.callStatic === true || res.txData.blockHeight != null) {\n res.decodedResult = fnACI.returns != null && fnACI.returns !== 'unit' && fn !== 'init'\n && instance.calldata.decode(instance._name, fn, res.result.returnValue);\n res.decodedEvents = instance.decodeEvents(res.result.log, opt);\n }\n return res;\n };\n\n /**\n * @param address - Contract address that emitted event\n * @param nameHash - Hash of emitted event name\n * @param options - Options\n * @returns Contract name\n * @throws {@link MissingEventDefinitionError}\n * @throws {@link AmbiguousEventDefinitionError}\n */\n function getContractNameByEvent(\n address: Encoded.ContractAddress,\n nameHash: BigInt,\n { contractAddressToName }: {\n contractAddressToName?: { [key: Encoded.ContractAddress]: string };\n },\n ): string {\n const addressToName = { ...instance.options.contractAddressToName, ...contractAddressToName };\n if (addressToName[address] != null) return addressToName[address];\n\n const matchedEvents = [\n instance._aci.encodedAci,\n ...instance._aci.externalEncodedAci,\n ]\n .filter(({ contract }) => contract?.event)\n .map(({ contract }) => [contract.name, contract.event.variant])\n .map(([name, events]) => events.map((event: {}) => [name, Object.keys(event)[0]]))\n .flat()\n .filter(([, eventName]) => BigInt(`0x${calcHash(eventName).toString('hex')}`) === nameHash);\n switch (matchedEvents.length) {\n case 0: throw new MissingEventDefinitionError(nameHash.toString(), address);\n case 1: return matchedEvents[0][0];\n default: throw new AmbiguousEventDefinitionError(address, matchedEvents);\n }\n }\n\n /**\n * Decode Events\n * @param events - Array of encoded events (callRes.result.log)\n * @param options - Options\n * @returns DecodedEvents\n */\n instance.decodeEvents = (\n events: Event[],\n { omitUnknown, ...opt }: { omitUnknown?: boolean } = {},\n ): DecodedEvent[] => events\n .map((event) => {\n const topics = event.topics.map((t: string | number) => BigInt(t));\n let contractName;\n try {\n contractName = getContractNameByEvent(event.address, topics[0], opt);\n } catch (error) {\n if ((omitUnknown ?? false) && error instanceof MissingEventDefinitionError) return null;\n throw error;\n }\n const decoded = instance.calldata.decodeEvent(contractName, event.data, topics);\n const [name, args] = Object.entries(decoded)[0];\n return {\n name,\n args,\n contract: {\n name: contractName,\n address: event.address,\n },\n };\n }).filter((e: DecodedEvent | null): e is DecodedEvent => e != null);\n\n /**\n * Generate proto function based on contract function using Contract ACI schema\n * All function can be called like:\n * ```js\n * await contract.methods.testFunction()\n * ```\n * then sdk will decide to use dry-run or send tx\n * on-chain base on if function stateful or not.\n * Also, you can manually do that:\n * ```js\n * await contract.methods.testFunction.get() // use call-static (dry-run)\n * await contract.methods.testFunction.send() // send tx on-chain\n * ```\n */\n instance.methods = Object.fromEntries(instance._aci.encodedAci.contract.functions\n .map(({ name, arguments: aciArgs, stateful }: FunctionACI) => {\n const genHandler = (callStatic: boolean) => async (...args: any[]) => {\n const options = args.length === aciArgs.length + 1 ? args.pop() : {};\n if (typeof options !== 'object') throw new TypeError(`Options should be an object: ${options as string}`);\n if (name === 'init') return instance.deploy(args, { callStatic, ...options });\n return instance.call(name, args, { callStatic, ...options });\n };\n return [\n name,\n Object.assign(\n genHandler(name === 'init' ? false : !stateful),\n {\n get: genHandler(true),\n send: genHandler(false),\n },\n ),\n ];\n }));\n\n return instance;\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\n/**\n * Contract module - routines to interact with the æternity contract\n *\n * High level documentation of the contracts are available at\n * https://github.com/aeternity/protocol/tree/master/contracts and\n */\n\nimport { AensName } from '../tx/builder/constants';\nimport { produceNameId } from '../tx/builder/helpers';\nimport { concatBuffers } from '../utils/other';\nimport { decode, Encoded } from '../utils/encoder';\nimport AccountBase from '../account/Base';\nimport Node from '../Node';\n\nexport { default as getContractInstance } from './aci';\n\n/**\n * Utility method to create a delegate signature for a contract\n * @category contract\n * @param ids - The list of id's to prepend\n * @param opt - Options\n * @param opt.onNode - Node to use\n * @param opt.onAccount - Account to use\n * @returns Signature in hex representation\n */\nasync function delegateSignatureCommon(\n ids: Encoded.Any[],\n { onAccount, onNode, ...opt }:\n { onAccount: AccountBase; onNode: Node } & Parameters<AccountBase['sign']>[1],\n): Promise<string> {\n const signature = await onAccount.sign(\n concatBuffers([\n Buffer.from((await onNode.getStatus()).networkId),\n ...ids.map((e) => decode(e)),\n ]),\n opt,\n );\n return Buffer.from(signature).toString('hex');\n}\n\n/**\n * Helper to generate a signature to delegate pre-claim/claim/transfer/revoke of a name to\n * a contract.\n * @category contract\n * @param contractId - Contract Id\n * @param opt - Options\n * @param opt.name - The name\n * @returns Signature for delegation\n * @example\n * ```js\n * const aeSdk = new AeSdk({ ... })\n * const contractId = 'ct_asd2ks...' // contract address\n * const name = 'example.chain' // AENS name\n * const onAccount = await aeSdk.address() // Sign with a specific account\n * // Preclaim signature\n * const preclaimSig = await aeSdk.createAensDelegationSignature(contractId, { onAccount: current })\n * // Claim, transfer and revoke signature\n * const aensDelegationSig = await contract.createAensDelegationSignature(\n * contractId, { name, onAccount: current }\n * )\n * ```\n */\nexport async function createAensDelegationSignature(\n contractId: Encoded.ContractAddress,\n opt: Parameters<AccountBase['address']>[0] & Parameters<typeof delegateSignatureCommon>[1] &\n { name?: AensName },\n): Promise<string> {\n return delegateSignatureCommon(\n [\n await opt.onAccount.address(opt),\n ...opt.name != null ? [produceNameId(opt.name)] : [],\n contractId,\n ],\n opt,\n );\n}\n\n/**\n * Helper to generate a signature to delegate register/extend/respond of a Oracle to a contract.\n * @category contract\n * @param contractId - Contract Id\n * @param opt - Options\n * @param opt.queryId - Oracle Query Id\n * @returns Signature for delegation\n * @example\n * ```js\n * const aeSdk = new AeSdk({ ... })\n * const contractId = 'ct_asd2ks...' // contract address\n * const queryId = 'oq_...' // Oracle Query Id\n * const onAccount = await aeSdk.address() // Sign with a specific account\n * // Oracle register and extend signature\n * const oracleDelegationSig = await aeSdk.createOracleDelegationSignature(contractId)\n * // Oracle respond signature\n * const respondSig = await aeSdk.createOracleDelegationSignature(contractId, { queryId })\n * ```\n */\nexport async function createOracleDelegationSignature(\n contractId: Encoded.ContractAddress,\n opt: Parameters<AccountBase['address']>[0] & Parameters<typeof delegateSignatureCommon>[1] &\n { queryId?: Encoded.OracleQueryId },\n): Promise<string> {\n return delegateSignatureCommon(\n [opt.queryId ?? await opt.onAccount.address(opt), contractId],\n opt,\n );\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\n/**\n * Oracle methods - routines to interact with the æternity oracle system\n *\n * The high-level description of the oracle system is\n * https://github.com/aeternity/protocol/blob/master/ORACLE.md in the protocol\n * repository.\n */\n\nimport BigNumber from 'bignumber.js';\nimport { send, SendOptions } from './spend';\nimport { mapObject, pause } from './utils/other';\nimport { oracleQueryId } from './tx/builder/helpers';\nimport { unpackTx } from './tx/builder';\nimport {\n ORACLE_TTL,\n ORACLE_TTL_TYPES,\n QUERY_FEE,\n QUERY_TTL,\n RESPONSE_TTL,\n} from './tx/builder/schema';\nimport { Tag } from './tx/builder/constants';\nimport { RequestTimedOutError } from './utils/errors';\nimport {\n decode, encode, Encoded, Encoding,\n} from './utils/encoder';\nimport { _getPollInterval } from './chain';\nimport { _buildTx, BuildTxOptions } from './tx';\nimport Node from './Node';\nimport AccountBase from './account/Base';\n\ntype OracleQueries = Awaited<ReturnType<Node['getOracleQueriesByPubkey']>>['oracleQueries'];\n\n/**\n * Poll for oracle queries\n * @category oracle\n * @param oracleId - Oracle public key\n * @param onQuery - OnQuery callback\n * @param options - Options object\n * @param options.interval - Poll interval(default: 5000)\n * @param options.onNode - Node to use\n * @returns Callback to stop polling function\n */\nexport function pollForQueries(\n oracleId: Encoded.OracleAddress,\n onQuery: (queries: OracleQueries) => void,\n { interval, onNode, ...options }: { interval?: number; onNode: Node }\n & Parameters<typeof _getPollInterval>[1],\n): () => void {\n interval ??= _getPollInterval('microblock', options);\n const knownQueryIds = new Set();\n const checkNewQueries = async (): Promise<void> => {\n const queries = ((await onNode.getOracleQueriesByPubkey(oracleId)).oracleQueries ?? [])\n .filter(({ id }) => !knownQueryIds.has(id));\n queries.forEach(({ id }) => knownQueryIds.add(id));\n if (queries.length > 0) onQuery(queries);\n };\n\n let stopped = false;\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n (async () => {\n while (!stopped) { // eslint-disable-line no-unmodified-loop-condition\n // TODO: allow to handle this error somehow\n await checkNewQueries().catch(console.error);\n await pause(interval);\n }\n })();\n return () => { stopped = true; };\n}\n\n/**\n * Poll for oracle query response\n * @category oracle\n * @param oracleId - Oracle public key\n * @param queryId - Oracle Query id\n * @param options - Options object\n * @param options.interval - Poll interval\n * @param options.onNode - Node to use\n * @returns OracleQuery object\n */\nexport async function pollForQueryResponse(\n oracleId: Encoded.OracleAddress,\n queryId: Encoded.OracleQueryId,\n { interval, onNode, ...options }:\n { interval?: number; onNode: Node } & Parameters<typeof _getPollInterval>[1],\n): Promise<string> {\n interval ??= _getPollInterval('microblock', options);\n let height;\n let ttl;\n let response;\n do {\n if (height != null) await pause(interval);\n ({ response, ttl } = await onNode.getOracleQueryByPubkeyAndQueryId(oracleId, queryId));\n const responseBuffer = decode(response as Encoded.OracleResponse);\n if (responseBuffer.length > 0) return responseBuffer.toString();\n height = await this.getHeight();\n } while (ttl >= height);\n throw new RequestTimedOutError(height);\n}\n\n/**\n * Constructor for OracleQuery Object (helper object for using OracleQuery)\n * @category oracle\n * @param oracleId - Oracle public key\n * @param queryId - Oracle Query id\n * @param options - Options\n * @returns OracleQuery object\n */\nexport async function getQueryObject(\n oracleId: Encoded.OracleAddress,\n queryId: Encoded.OracleQueryId,\n options: RespondToQueryOptions & Parameters<typeof pollForQueryResponse>[2],\n): Promise<GetQueryObjectReturnType> {\n const record = await options.onNode.getOracleQueryByPubkeyAndQueryId(oracleId, queryId);\n return {\n ...record,\n decodedQuery: decode(record.query as Encoded.OracleQueryId).toString(),\n decodedResponse: decode(record.response as Encoded.OracleResponse).toString(),\n respond: async (response, opt) => (\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n respondToQuery(oracleId, queryId, response, { ...options, ...opt })\n ),\n pollForResponse: async (opt) => pollForQueryResponse(oracleId, queryId, { ...options, ...opt }),\n };\n}\n\ninterface GetQueryObjectReturnType extends Awaited<ReturnType<Node['getOracleQueryByPubkeyAndQueryId']>> {\n decodedQuery: string;\n decodedResponse: string;\n respond: (response: string, options?: Parameters<typeof respondToQuery>[3]) =>\n ReturnType<typeof respondToQuery>;\n pollForResponse: (options?: Parameters<typeof pollForQueryResponse>[2]) =>\n ReturnType<typeof pollForQueryResponse>;\n}\n\n/**\n * Post query to oracle\n * @category oracle\n * @param oracleId - Oracle public key\n * @param query - Oracle query object\n * @param options - Options object\n * @param options.queryTtl - queryTtl Oracle query time to leave\n * @param options.responseTtl - queryFee Oracle query response time to leave\n * @param options.queryFee - queryFee Oracle query fee\n * @param options.fee - fee Transaction fee\n * @param options.ttl - Transaction time to leave\n * @returns Query object\n */\nexport async function postQueryToOracle(\n oracleId: Encoded.OracleAddress,\n query: string,\n options: PostQueryToOracleOptions,\n): Promise<Awaited<ReturnType<typeof send>> & Awaited<ReturnType<typeof getQueryObject>>> {\n options.queryFee ??= (await options.onNode.getOracleByPubkey(oracleId)).queryFee.toString();\n const senderId = await options.onAccount.address(options);\n\n const oracleQueryTx = await _buildTx(Tag.OracleQueryTx, {\n queryTtlType: QUERY_TTL.type,\n queryTtlValue: QUERY_TTL.value,\n responseTtlType: RESPONSE_TTL.type,\n responseTtlValue: RESPONSE_TTL.value,\n ...options,\n oracleId,\n senderId,\n query,\n });\n const { nonce } = unpackTx(oracleQueryTx, Tag.OracleQueryTx).tx;\n const queryId = oracleQueryId(senderId, nonce, oracleId);\n return {\n ...await send(oracleQueryTx, options),\n ...await getQueryObject(oracleId, queryId, options),\n };\n}\n\ntype PostQueryToOracleOptionsType = Parameters<typeof send>[1]\n& Parameters<typeof getQueryObject>[2]\n& BuildTxOptions<Tag.OracleQueryTx, 'oracleId' | 'senderId' | 'query' | 'queryTtlType' | 'queryTtlValue' | 'responseTtlType' | 'responseTtlValue'>\n& {\n queryTtlType?: ORACLE_TTL_TYPES;\n queryTtlValue?: number;\n responseTtlType?: ORACLE_TTL_TYPES;\n responseTtlValue?: number;\n};\ninterface PostQueryToOracleOptions extends PostQueryToOracleOptionsType {}\n\n/**\n * Extend oracle ttl\n * @category oracle\n * @param oracleId - Oracle public key\n * @param options - Options object\n * @param options.fee - fee Transaction fee\n * @param options.ttl - Transaction time to leave\n * @param options.oracleTtlType - Oracle time to leave for extend\n * @param options.oracleTtlValue - Oracle time to leave for extend\n * @returns Oracle object\n */\nexport async function extendOracleTtl(\n oracleId: Encoded.OracleAddress,\n options: ExtendOracleTtlOptions,\n): Promise<Awaited<ReturnType<typeof send>> & Awaited<ReturnType<typeof getOracleObject>>> {\n const oracleExtendTx = await _buildTx(Tag.OracleExtendTx, {\n oracleTtlType: ORACLE_TTL.type,\n oracleTtlValue: ORACLE_TTL.value,\n ...options,\n callerId: await options.onAccount.address(options),\n oracleId,\n });\n return {\n ...await send(oracleExtendTx, options),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n ...await getOracleObject(oracleId, options),\n };\n}\n\ntype ExtendOracleTtlOptionsType = SendOptions & Parameters<typeof getOracleObject>[1]\n& BuildTxOptions<Tag.OracleExtendTx, 'oracleTtlType' | 'oracleTtlValue' | 'callerId' | 'oracleId'>\n& { oracleTtlType?: ORACLE_TTL_TYPES; oracleTtlValue?: number };\ninterface ExtendOracleTtlOptions extends ExtendOracleTtlOptionsType {}\n\n/**\n * Extend oracle ttl\n * @category oracle\n * @param oracleId - Oracle public key\n * @param queryId - Oracle query id\n * @param response - Oracle query response\n * @param options - Options object\n * @param options.responseTtl - responseTtl Query response time to leave\n * @param options.fee - Transaction fee\n * @param options.ttl - Transaction time to leave\n * @returns Oracle object\n */\nexport async function respondToQuery(\n oracleId: Encoded.OracleAddress,\n queryId: Encoded.OracleQueryId,\n response: string,\n options: RespondToQueryOptions,\n): Promise<Awaited<ReturnType<typeof send>> & Awaited<ReturnType<typeof getOracleObject>>> {\n const oracleRespondTx = await _buildTx(Tag.OracleResponseTx, {\n responseTtlType: RESPONSE_TTL.type,\n responseTtlValue: RESPONSE_TTL.value,\n ...options,\n callerId: await options.onAccount.address(options),\n oracleId,\n queryId,\n response,\n });\n return {\n ...await send(oracleRespondTx, options),\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n ...await getOracleObject(oracleId, options),\n };\n}\n\ntype RespondToQueryOptionsType = SendOptions & Parameters<typeof getOracleObject>[1]\n& BuildTxOptions<Tag.OracleResponseTx, 'callerId' | 'oracleId' | 'queryId' | 'response' | 'responseTtlType' | 'responseTtlValue'>\n& { responseTtlType?: ORACLE_TTL_TYPES; responseTtlValue?: number };\ninterface RespondToQueryOptions extends RespondToQueryOptionsType {}\n\n/**\n * Constructor for Oracle Object (helper object for using Oracle)\n * @category oracle\n * @param oracleId - Oracle public key\n * @param options - Options\n * @returns Oracle object\n */\nexport async function getOracleObject(\n oracleId: Encoded.OracleAddress,\n options: { onNode: Node; onAccount: AccountBase },\n): Promise<GetOracleObjectReturnType> {\n return {\n ...await options.onNode.getOracleByPubkey(oracleId),\n queries: (await options.onNode.getOracleQueriesByPubkey(oracleId)).oracleQueries,\n ...mapObject<Function, Function>(\n {\n pollQueries: pollForQueries,\n postQuery: postQueryToOracle,\n respondToQuery,\n extendOracle: extendOracleTtl,\n getQuery: getQueryObject,\n },\n ([name, handler]) => [\n name,\n (...args: any) => {\n const lastArg = args[args.length - 1];\n if (lastArg != null && typeof lastArg === 'object' && lastArg.constructor === Object) {\n Object.assign(lastArg, { ...options, ...lastArg });\n } else args.push(options);\n return handler(oracleId, ...args);\n },\n ],\n ),\n } as any;\n}\n\ninterface GetOracleObjectReturnType extends Awaited<ReturnType<Node['getOracleByPubkey']>> {\n id: Encoded.OracleAddress;\n queries: OracleQueries;\n // TODO: replace getOracleObject with a class\n pollQueries: (cb: Parameters<typeof pollForQueries>[1]) => ReturnType<typeof pollForQueries>;\n postQuery: Function;\n respondToQuery: Function;\n extendOracle: Function;\n getQuery: Function;\n}\n\n/**\n * Register oracle\n * @category oracle\n * @param queryFormat - Format of query\n * @param responseFormat - Format of query response\n * @param options - Options\n * @param options.queryFee - Oracle query Fee\n * @param options - Options object\n * @param options.abiVersion - Always 0 (do not use virtual machine)\n * @param options.fee - Transaction fee\n * @param options.ttl - Transaction time to leave\n * @returns Oracle object\n */\nexport async function registerOracle(\n queryFormat: string,\n responseFormat: string,\n options: RegisterOracleOptions,\n): Promise<Awaited<ReturnType<typeof send>> & Awaited<ReturnType<typeof getOracleObject>>> {\n const accountId = await options.onAccount.address(options);\n const oracleRegisterTx = await _buildTx(Tag.OracleRegisterTx, {\n queryFee: QUERY_FEE,\n oracleTtlValue: ORACLE_TTL.value,\n oracleTtlType: ORACLE_TTL.type,\n ...options,\n accountId,\n queryFormat,\n responseFormat,\n });\n return {\n ...await send(oracleRegisterTx, options),\n ...await getOracleObject(encode(decode(accountId), Encoding.OracleAddress), options),\n };\n}\n\ntype RegisterOracleOptionsType = SendOptions & Parameters<typeof getOracleObject>[1]\n& BuildTxOptions<Tag.OracleRegisterTx, 'accountId' | 'queryFormat' | 'responseFormat' | 'queryFee' | 'oracleTtlType' | 'oracleTtlValue'>\n& {\n queryFee?: number | string | BigNumber;\n oracleTtlType?: ORACLE_TTL_TYPES;\n oracleTtlValue?: number;\n};\ninterface RegisterOracleOptions extends RegisterOracleOptionsType {}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\n/**\n * Generalized Account module - routines to use generalized account\n */\n\nimport { MAX_AUTH_FUN_GAS, TxSchema } from '../tx/builder/schema';\nimport { Tag } from '../tx/builder/constants';\nimport {\n buildContractIdByContractTx, buildTx, BuiltTx, TxUnpacked, unpackTx,\n} from '../tx/builder';\nimport {\n _buildTx, BuildTxOptions, getVmVersion, prepareTxParams,\n} from '../tx';\nimport { hash } from '../utils/crypto';\nimport { decode, Encoded, Encoding } from '../utils/encoder';\nimport { IllegalArgumentError, MissingParamError, InvalidAuthDataError } from '../utils/errors';\nimport { concatBuffers } from '../utils/other';\nimport AccountBase from '../account/Base';\nimport { getContractInstance } from './methods';\nimport { send, SendOptions } from '../spend';\nimport Node from '../Node';\nimport { getAccount } from '../chain';\nimport Compiler from './Compiler';\n\n/**\n * Check if account is GA\n * @category contract\n * @param address - Account address\n * @param options - Options\n * @returns if account is GA\n */\nexport async function isGA(\n address: Encoded.AccountAddress,\n options: Parameters<typeof getAccount>[1],\n): Promise<boolean> {\n const { contractId } = await getAccount(address, options);\n return contractId != null;\n}\n\n/**\n * Convert current account to GA\n * @category contract\n * @param authFnName - Authorization function name\n * @param source - Auth contract source code\n * @param args - init arguments\n * @param options - Options\n * @returns General Account Object\n */\nexport async function createGeneralizedAccount(\n authFnName: string,\n source: string,\n args: any[],\n {\n onAccount, onCompiler, onNode, ...options\n }: CreateGeneralizedAccountOptions,\n): Promise<Readonly<{\n owner: Encoded.AccountAddress;\n transaction: Encoded.TxHash;\n rawTx: Encoded.Transaction;\n gaContractId: Encoded.ContractAddress;\n }>> {\n const ownerId = await onAccount.address(options);\n if (await isGA(ownerId, { onNode })) throw new IllegalArgumentError(`Account ${ownerId} is already GA`);\n\n const contract = await getContractInstance({\n onAccount, onCompiler, onNode, source,\n });\n\n const tx = await _buildTx(Tag.GaAttachTx, {\n ...options,\n onNode,\n code: await contract.compile(),\n gasLimit: options.gasLimit ?? await contract._estimateGas('init', args, options),\n ownerId,\n callData: contract.calldata.encode(contract._name, 'init', args),\n authFun: hash(authFnName),\n });\n const contractId = buildContractIdByContractTx(tx);\n const { hash: transaction, rawTx } = await send(tx, {\n onNode, onAccount, onCompiler, ...options,\n });\n\n return Object.freeze({\n owner: ownerId,\n transaction,\n rawTx,\n gaContractId: contractId,\n });\n}\n\ninterface CreateGeneralizedAccountOptions extends\n BuildTxOptions<Tag.GaAttachTx, 'authFun' | 'callData' | 'code' | 'ownerId' | 'gasLimit'>,\n SendOptions {\n onAccount: AccountBase;\n onCompiler: Compiler;\n onNode: Node;\n gasLimit?: number;\n}\n\n/**\n * Create a metaTx transaction\n * @category contract\n * @param rawTransaction - Inner transaction\n * @param authData - Object with gaMeta params\n * @param authFnName - Authorization function name\n * @param options - Options\n * @param options.onAccount - Account to use\n * @returns Transaction string\n */\nexport async function createMetaTx(\n rawTransaction: Encoded.Transaction,\n authData: {\n gasLimit?: number;\n callData?: Encoded.ContractBytearray;\n source?: string;\n args?: any[];\n },\n authFnName: string,\n {\n onAccount, onCompiler, onNode, ...options\n }:\n { onAccount: AccountBase; onCompiler: Compiler; onNode: Node }\n & Parameters<AccountBase['address']>[0],\n): Promise<Encoded.Transaction> {\n const wrapInEmptySignedTx = (\n tx: Encoded.Transaction | Uint8Array | TxUnpacked<TxSchema>,\n ): BuiltTx<TxSchema, Encoding.Transaction> => (\n buildTx({ encodedTx: tx, signatures: [] }, Tag.SignedTx)\n );\n\n if (Object.keys(authData).length <= 0) throw new MissingParamError('authData is required');\n\n const gasLimit = authData.gasLimit ?? MAX_AUTH_FUN_GAS;\n if (gasLimit > MAX_AUTH_FUN_GAS) {\n throw new InvalidAuthDataError(`the maximum gasLimit value for ga authFun is ${MAX_AUTH_FUN_GAS}, got ${gasLimit}`);\n }\n\n const authCallData = authData.callData ?? await (async () => {\n if (authData.source == null || authData.args == null) throw new InvalidAuthDataError('Auth data must contain source code and arguments.');\n const contract = await getContractInstance({\n onCompiler, onNode, source: authData.source,\n });\n return contract.calldata.encode(contract._name, authFnName, authData.args);\n })();\n\n const { abiVersion } = await getVmVersion(Tag.ContractCallTx, { onNode });\n const wrappedTx = wrapInEmptySignedTx(unpackTx<Tag.SignedTx>(rawTransaction));\n const params = {\n ...options,\n tx: {\n ...wrappedTx,\n tx: wrappedTx.txObject,\n },\n // TODO: accept an address instead\n gaId: await onAccount.address(options),\n abiVersion,\n authData: authCallData,\n gasLimit,\n vsn: 2,\n };\n // @ts-expect-error createMetaTx needs to be integrated into tx builder\n const { fee } = await prepareTxParams(Tag.GaMetaTx, { ...params, onNode });\n const { rlpEncoded: metaTxRlp } = buildTx({ ...params, fee }, Tag.GaMetaTx);\n return wrapInEmptySignedTx(metaTxRlp).tx;\n}\n\n/**\n * Build a transaction hash the same as `Auth.tx_hash`\n * @category contract\n * @param transaction - tx-encoded transaction\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Transaction hash\n */\nexport async function buildAuthTxHash(\n transaction: Encoded.Transaction,\n { onNode }: { onNode: Node },\n): Promise<Uint8Array> {\n const { networkId } = await onNode.getStatus();\n return new Uint8Array(hash(\n concatBuffers([Buffer.from(networkId), decode(transaction)]),\n ));\n}\n","import { Encoded } from '../utils/encoder';\nimport { createMetaTx } from '../contract/ga';\nimport Node from '../Node';\n\n/**\n * @deprecated Use createMetaTx instead\n * @hidden\n */\nexport async function signUsingGA(\n tx: Encoded.Transaction,\n { authData, authFun, ...options }: {\n authData: Parameters<typeof createMetaTx>[1];\n authFun: Parameters<typeof createMetaTx>[2];\n } & Parameters<typeof createMetaTx>[3],\n): Promise<Encoded.Transaction> {\n return createMetaTx(tx, authData, authFun, options);\n}\n\n/**\n * @deprecated Use getHeight instead\n * @hidden\n */\nexport async function height({ onNode }: { onNode: Node }): Promise<number> {\n return (await onNode.getCurrentKeyBlockHeight()).height;\n}\n","import BigNumber from 'bignumber.js';\nimport { buildTx } from '../tx/builder';\nimport { Tag } from '../tx/builder/constants';\nimport { calculateMinFee as calculateMinFeeInternal } from '../tx/builder/field-types/fee';\nimport { TxParamsCommon } from '../tx/builder/schema';\nimport { AE_AMOUNT_FORMATS } from '../utils/amount-formatter';\nimport { mapObject } from '../utils/other';\nimport { Encoding } from '../utils/encoder';\n\nexport * from './methods';\n\n/**\n * @deprecated use NamePointer from apis/node instead\n * @hidden\n */\nexport interface Pointer {\n key: string;\n id: string;\n}\n\n/**\n * @deprecated use genSalt instead\n * @hidden\n */\nexport function salt(): number {\n return Math.floor(Math.random() * Math.floor(Number.MAX_SAFE_INTEGER));\n}\n\n/**\n * @deprecated use genSalt instead\n * @hidden\n */\nexport const createSalt = salt;\n\n/**\n * Calculate min fee\n * @category transaction builder\n * @param txType - Transaction type\n * @param options - Options object\n * @param options.params - Tx params\n * @deprecated use buildTx to generate transaction, unpack it and refer to `fee` field\n * @hidden\n * @example\n * ```js\n * calculateMinFee('spendTx', { gasLimit, params })\n * ```\n */\nexport function calculateMinFee(\n txType: Tag,\n { params, vsn, denomination }: CalculateMinFeeOptions,\n): BigNumber {\n return calculateMinFeeInternal(\n txType,\n (fee: BigNumber) => (\n // @ts-expect-error anyway this planned to be removed\n buildTx({ ...params, _computingMinFee: fee }, txType, { vsn, denomination })\n ),\n );\n}\n\ninterface CalculateMinFeeOptions {\n params: TxParamsCommon;\n vsn?: number;\n denomination?: AE_AMOUNT_FORMATS;\n}\n\n/**\n * @deprecated Maximum gas limit depends on transaction size, this value is outdated,\n * sdk check/provides gasLimit by itself while building a transaction\n * @hidden\n */\nexport const GAS_MAX = 1600000 - 21000;\n\n/**\n * @deprecated use `Tag`\n * @hidden\n */\nexport enum TX_TYPE {\n account = 10,\n signed = 11,\n spend = 12,\n oracleRegister = 22,\n oracleQuery = 23,\n oracleResponse = 24,\n oracleExtend = 25,\n nameClaim = 32,\n namePreClaim = 33,\n nameUpdate = 34,\n nameRevoke = 35,\n nameTransfer = 36,\n contract = 40,\n contractCallResult = 41,\n contractCreate = 42,\n contractCall = 43,\n channelCreate = 50,\n channelDeposit = 51,\n channelWithdraw = 52,\n channelCloseMutual = 53,\n channelCloseSolo = 54,\n channelSlash = 55,\n channelSettle = 56,\n channelOffChain = 57,\n channel = 58,\n channelSnapshotSolo = 59,\n proofOfInclusion = 60,\n stateTrees = 62,\n merklePatriciaTree = 63,\n merklePatriciaTreeValue = 64,\n sophiaByteCode = 70,\n gaAttach = 80,\n gaMeta = 81,\n payingFor = 82,\n channelForceProgress = 521,\n channelOffChainUpdateTransfer = 570,\n channelOffChainUpdateDeposit = 571,\n channelOffChainUpdateWithdrawal = 572,\n channelOffChainCreateContract = 573,\n channelOffChainCallContract = 574,\n channelReconnect = 575,\n contractsTree = 621,\n contractCallsTree = 622,\n channelsTree = 623,\n nameserviceTree = 624,\n oraclesTree = 625,\n accountsTree = 626,\n}\n\n/**\n * @deprecated use `readId`, `writeId`\n * @hidden\n */\nexport const ID_TAG = {\n account: 1,\n name: 2,\n commitment: 3,\n oracle: 4,\n contract: 5,\n channel: 6,\n} as const;\n\n/**\n * @deprecated use `readId`, `writeId`\n * @hidden\n */\nexport const PREFIX_ID_TAG = {\n ak: ID_TAG.account,\n nm: ID_TAG.name,\n cm: ID_TAG.commitment,\n ok: ID_TAG.oracle,\n ct: ID_TAG.contract,\n ch: ID_TAG.channel,\n} as const;\n\n/**\n * @deprecated use `readId`, `writeId`\n * @hidden\n */\nexport const ID_TAG_PREFIX = mapObject(\n PREFIX_ID_TAG,\n ([key, value]: [Encoding, number]) => [value, key],\n);\n\n/**\n * @deprecated use `getDefaultPointerKey`\n * @hidden\n */\nexport enum POINTER_KEY_BY_PREFIX {\n ak = 'account_pubkey',\n ok = 'oracle_pubkey',\n ct = 'contract_pubkey',\n ch = 'channel',\n}\n","import _Object$defineProperty from \"@babel/runtime-corejs3/core-js/object/define-property\";\nexport default function _defineProperty(obj, key, value) {\n if (key in obj) {\n _Object$defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","import { RestError, PipelineResponse, PipelinePolicy } from '@azure/core-rest-pipeline';\nimport { AdditionalPolicyConfig } from '@azure/core-client';\nimport { pause } from './other';\nimport semverSatisfies from './semver-satisfies';\nimport { UnsupportedVersionError } from './errors';\n\nexport const genRequestQueuesPolicy = (): AdditionalPolicyConfig => {\n const requestQueues = new Map<string, Promise<unknown>>();\n\n return {\n policy: {\n name: 'request-queues',\n async sendRequest(request, next) {\n const key = request.headers.get('__queue');\n request.headers.delete('__queue');\n const getResponse = async (): Promise<PipelineResponse> => next(request);\n if (key == null) return getResponse();\n const req = (requestQueues.get(key) ?? Promise.resolve()).then(getResponse, getResponse);\n // TODO: remove after fixing https://github.com/aeternity/aeternity/issues/3803\n // gap to ensure that node won't reject the nonce\n requestQueues.set(key, req.then(async () => pause(750)));\n return req;\n },\n },\n position: 'perCall',\n };\n};\n\nexport const genCombineGetRequestsPolicy = (): AdditionalPolicyConfig => {\n const pendingGetRequests = new Map<string, Promise<PipelineResponse>>();\n\n return {\n policy: {\n name: 'combine-requests',\n async sendRequest(request, next) {\n if (request.method !== 'GET') return next(request);\n const key = JSON.stringify([request.url, request.body]);\n const response = pendingGetRequests.get(key) ?? next(request);\n pendingGetRequests.set(key, response);\n try {\n return await response;\n } finally {\n pendingGetRequests.delete(key);\n }\n },\n },\n position: 'perCall',\n };\n};\n\nexport const genErrorFormatterPolicy = (\n getMessage: (b: any) => string,\n): AdditionalPolicyConfig => ({\n policy: {\n name: 'error-formatter',\n async sendRequest(request, next) {\n try {\n return await next(request);\n } catch (error) {\n if (!(error instanceof RestError) || error.request == null) throw error;\n if (error.response?.bodyAsText == null) throw error;\n\n let body;\n try {\n body = JSON.parse(error.response.bodyAsText);\n } catch (e) {\n throw error;\n }\n error.message = `${new URL(error.request.url).pathname.slice(1)} error`;\n const message = getMessage(body);\n if (message !== '') error.message += `:${message}`;\n throw error;\n }\n },\n },\n position: 'perCall',\n});\n\nexport const genVersionCheckPolicy = (\n name: string,\n ignorePath: string,\n versionPromise: Promise<string>,\n geVersion: string,\n ltVersion: string,\n): PipelinePolicy => ({\n name: 'version-check',\n async sendRequest(request, next) {\n if (new URL(request.url).pathname === ignorePath) return next(request);\n const args = [await versionPromise, geVersion, ltVersion] as const;\n if (!semverSatisfies(...args)) throw new UnsupportedVersionError(name, ...args);\n return next(request);\n },\n});\n","export default function semverSatisfies(\n version: string,\n geVersion: string,\n ltVersion: string,\n): boolean {\n const getComponents = (v: string): number[] => v\n .split(/[-+]/)[0].split('.').map((i) => +i);\n\n const versionComponents = getComponents(version);\n const geComponents = getComponents(geVersion);\n const ltComponents = getComponents(ltVersion);\n\n const base = Math.max(...versionComponents, ...geComponents, ...ltComponents) + 1;\n const componentsToNumber = (components: number[]): number => components.reverse()\n .reduce((acc, n, idx) => acc + n * base ** idx, 0);\n\n const vNumber = componentsToNumber(versionComponents);\n const geNumber = componentsToNumber(geComponents);\n const ltNumber = componentsToNumber(ltComponents);\n return vNumber >= geNumber && vNumber < ltNumber;\n}\n","import * as coreClient from \"@azure/core-client\";\n\nexport const Header: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Header\",\n modelProperties: {\n hash: {\n serializedName: \"hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n height: {\n serializedName: \"height\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n prevHash: {\n serializedName: \"prev_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n prevKeyHash: {\n serializedName: \"prev_key_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n miner: {\n serializedName: \"miner\",\n type: {\n name: \"String\"\n }\n },\n beneficiary: {\n serializedName: \"beneficiary\",\n type: {\n name: \"String\"\n }\n },\n target: {\n serializedName: \"target\",\n type: {\n name: \"String\"\n }\n },\n pow: {\n constraints: {\n MinItems: 42,\n MaxItems: 42\n },\n serializedName: \"pow\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n time: {\n serializedName: \"time\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n info: {\n serializedName: \"info\",\n type: {\n name: \"String\"\n }\n },\n pofHash: {\n serializedName: \"pof_hash\",\n type: {\n name: \"String\"\n }\n },\n txsHash: {\n serializedName: \"txs_hash\",\n type: {\n name: \"String\"\n }\n },\n signature: {\n serializedName: \"signature\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ErrorModel: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ErrorModel\",\n modelProperties: {\n reason: {\n serializedName: \"reason\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const KeyBlock: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"KeyBlock\",\n modelProperties: {\n hash: {\n serializedName: \"hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n height: {\n serializedName: \"height\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n prevHash: {\n serializedName: \"prev_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n prevKeyHash: {\n serializedName: \"prev_key_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n miner: {\n serializedName: \"miner\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n beneficiary: {\n serializedName: \"beneficiary\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n target: {\n serializedName: \"target\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n pow: {\n constraints: {\n MinItems: 42,\n MaxItems: 42\n },\n serializedName: \"pow\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n time: {\n serializedName: \"time\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n info: {\n serializedName: \"info\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const HashResponse: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"HashResponse\",\n modelProperties: {\n hash: {\n serializedName: \"hash\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const HeightResponse: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"HeightResponse\",\n modelProperties: {\n height: {\n serializedName: \"height\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const MicroBlockHeader: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"MicroBlockHeader\",\n modelProperties: {\n hash: {\n serializedName: \"hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n height: {\n serializedName: \"height\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n pofHash: {\n serializedName: \"pof_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n prevHash: {\n serializedName: \"prev_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n prevKeyHash: {\n serializedName: \"prev_key_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n txsHash: {\n serializedName: \"txs_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n signature: {\n serializedName: \"signature\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n time: {\n serializedName: \"time\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"version\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const SignedTxs: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"SignedTxs\",\n modelProperties: {\n transactions: {\n serializedName: \"transactions\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"SignedTx\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const SignedTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"SignedTx\",\n modelProperties: {\n tx: {\n serializedName: \"tx\",\n type: {\n name: \"Composite\",\n className: \"Tx\"\n }\n },\n blockHeight: {\n serializedName: \"block_height\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n blockHash: {\n serializedName: \"block_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n hash: {\n serializedName: \"hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n signatures: {\n serializedName: \"signatures\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const Tx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Tx\",\n uberParent: \"Tx\",\n polymorphicDiscriminator: {\n serializedName: \"type\",\n clientName: \"type\"\n },\n modelProperties: {\n recipientId: {\n serializedName: \"recipient_id\",\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n senderId: {\n serializedName: \"sender_id\",\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n payload: {\n serializedName: \"payload\",\n type: {\n name: \"String\"\n }\n },\n initiatorId: {\n serializedName: \"initiator_id\",\n type: {\n name: \"String\"\n }\n },\n initiatorAmount: {\n serializedName: \"initiator_amount\",\n type: {\n name: \"String\"\n }\n },\n responderId: {\n serializedName: \"responder_id\",\n type: {\n name: \"String\"\n }\n },\n responderAmount: {\n serializedName: \"responder_amount\",\n type: {\n name: \"String\"\n }\n },\n channelReserve: {\n serializedName: \"channel_reserve\",\n type: {\n name: \"String\"\n }\n },\n lockPeriod: {\n serializedName: \"lock_period\",\n type: {\n name: \"String\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n type: {\n name: \"String\"\n }\n },\n delegateIds: {\n serializedName: \"delegate_ids\",\n type: {\n name: \"Composite\",\n className: \"Delegates\"\n }\n },\n channelId: {\n serializedName: \"channel_id\",\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n type: {\n name: \"String\"\n }\n },\n round: {\n serializedName: \"round\",\n type: {\n name: \"String\"\n }\n },\n toId: {\n serializedName: \"to_id\",\n type: {\n name: \"String\"\n }\n },\n update: {\n serializedName: \"update\",\n type: {\n name: \"Composite\",\n className: \"OffChainUpdate\"\n }\n },\n offchainTrees: {\n serializedName: \"offchain_trees\",\n type: {\n name: \"String\"\n }\n },\n initiatorAmountFinal: {\n serializedName: \"initiator_amount_final\",\n type: {\n name: \"String\"\n }\n },\n responderAmountFinal: {\n serializedName: \"responder_amount_final\",\n type: {\n name: \"String\"\n }\n },\n poi: {\n serializedName: \"poi\",\n type: {\n name: \"String\"\n }\n },\n initiatorDelegateIds: {\n serializedName: \"initiator_delegate_ids\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n responderDelegateIds: {\n serializedName: \"responder_delegate_ids\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n queryFormat: {\n serializedName: \"query_format\",\n type: {\n name: \"String\"\n }\n },\n responseFormat: {\n serializedName: \"response_format\",\n type: {\n name: \"String\"\n }\n },\n queryFee: {\n serializedName: \"query_fee\",\n type: {\n name: \"String\"\n }\n },\n oracleTtl: {\n serializedName: \"oracle_ttl\",\n type: {\n name: \"Composite\",\n className: \"RelativeTTL\"\n }\n },\n accountId: {\n serializedName: \"account_id\",\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n type: {\n name: \"String\"\n }\n },\n oracleId: {\n serializedName: \"oracle_id\",\n type: {\n name: \"String\"\n }\n },\n query: {\n serializedName: \"query\",\n type: {\n name: \"String\"\n }\n },\n queryTtl: {\n serializedName: \"query_ttl\",\n type: {\n name: \"Composite\",\n className: \"Ttl\"\n }\n },\n responseTtl: {\n serializedName: \"response_ttl\",\n type: {\n name: \"Composite\",\n className: \"RelativeTTL\"\n }\n },\n queryId: {\n serializedName: \"query_id\",\n type: {\n name: \"String\"\n }\n },\n response: {\n serializedName: \"response\",\n type: {\n name: \"String\"\n }\n },\n commitmentId: {\n serializedName: \"commitment_id\",\n type: {\n name: \"String\"\n }\n },\n name: {\n serializedName: \"name\",\n type: {\n name: \"String\"\n }\n },\n nameSalt: {\n serializedName: \"name_salt\",\n type: {\n name: \"String\"\n }\n },\n nameFee: {\n serializedName: \"name_fee\",\n type: {\n name: \"String\"\n }\n },\n nameId: {\n serializedName: \"name_id\",\n type: {\n name: \"String\"\n }\n },\n nameTtl: {\n serializedName: \"name_ttl\",\n type: {\n name: \"String\"\n }\n },\n pointers: {\n serializedName: \"pointers\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"NamePointer\"\n }\n }\n }\n },\n clientTtl: {\n serializedName: \"client_ttl\",\n type: {\n name: \"String\"\n }\n },\n ownerId: {\n serializedName: \"owner_id\",\n type: {\n name: \"String\"\n }\n },\n code: {\n serializedName: \"code\",\n type: {\n name: \"String\"\n }\n },\n vmVersion: {\n serializedName: \"vm_version\",\n type: {\n name: \"String\"\n }\n },\n deposit: {\n serializedName: \"deposit\",\n type: {\n name: \"String\"\n }\n },\n gas: {\n serializedName: \"gas\",\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n type: {\n name: \"String\"\n }\n },\n callData: {\n serializedName: \"call_data\",\n type: {\n name: \"String\"\n }\n },\n callerId: {\n serializedName: \"caller_id\",\n type: {\n name: \"String\"\n }\n },\n contractId: {\n serializedName: \"contract_id\",\n type: {\n name: \"String\"\n }\n },\n authFun: {\n constraints: {\n Pattern: new RegExp(\"^(0x|0X)?[a-fA-F0-9]+$\")\n },\n serializedName: \"auth_fun\",\n type: {\n name: \"String\"\n }\n },\n gaId: {\n serializedName: \"ga_id\",\n type: {\n name: \"String\"\n }\n },\n authData: {\n serializedName: \"auth_data\",\n type: {\n name: \"String\"\n }\n },\n tx: {\n serializedName: \"tx\",\n type: {\n name: \"Composite\",\n className: \"SignedTx\"\n }\n },\n payerId: {\n serializedName: \"payer_id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n type: {\n serializedName: \"type\",\n required: true,\n type: {\n name: \"Enum\",\n allowedValues: [\n \"SpendTx\",\n \"ChannelCreateTx\",\n \"ChannelDepositTx\",\n \"ChannelWithdrawTx\",\n \"ChannelForceProgressTx\",\n \"ChannelCloseMutualTx\",\n \"ChannelCloseSoloTx\",\n \"ChannelSlashTx\",\n \"ChannelSettleTx\",\n \"ChannelSnapshotSoloTx\",\n \"ChannelSetDelegatesTx\",\n \"OracleRegisterTx\",\n \"OracleExtendTx\",\n \"OracleQueryTx\",\n \"OracleRespondTx\",\n \"NamePreclaimTx\",\n \"NameClaimTx\",\n \"NameUpdateTx\",\n \"NameTransferTx\",\n \"NameRevokeTx\",\n \"ContractCreateTx\",\n \"ContractCallTx\",\n \"GAAttachTx\",\n \"GAMetaTx\",\n \"PayingForTx\"\n ]\n }\n }\n }\n }\n};\n\nexport const Delegates: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Delegates\",\n modelProperties: {\n initiator: {\n serializedName: \"initiator\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n responder: {\n serializedName: \"responder\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const OffChainUpdate: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"OffChainUpdate\",\n uberParent: \"OffChainUpdate\",\n polymorphicDiscriminator: {\n serializedName: \"op\",\n clientName: \"op\"\n },\n modelProperties: {\n op: {\n serializedName: \"op\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const RelativeTTL: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"RelativeTTL\",\n modelProperties: {\n type: {\n defaultValue: \"delta\",\n isConstant: true,\n serializedName: \"type\",\n type: {\n name: \"String\"\n }\n },\n value: {\n serializedName: \"value\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const Ttl: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Ttl\",\n modelProperties: {\n type: {\n serializedName: \"type\",\n required: true,\n type: {\n name: \"Enum\",\n allowedValues: [\"delta\", \"block\"]\n }\n },\n value: {\n serializedName: \"value\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NamePointer: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NamePointer\",\n modelProperties: {\n key: {\n serializedName: \"key\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n id: {\n serializedName: \"id\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const CountResponse: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CountResponse\",\n modelProperties: {\n count: {\n serializedName: \"count\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const Generation: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Generation\",\n modelProperties: {\n keyBlock: {\n serializedName: \"key_block\",\n type: {\n name: \"Composite\",\n className: \"KeyBlock\"\n }\n },\n microBlocks: {\n serializedName: \"micro_blocks\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const Account: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Account\",\n modelProperties: {\n id: {\n serializedName: \"id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n balance: {\n serializedName: \"balance\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n payable: {\n serializedName: \"payable\",\n type: {\n name: \"Boolean\"\n }\n },\n kind: {\n serializedName: \"kind\",\n type: {\n name: \"Enum\",\n allowedValues: [\"basic\", \"generalized\"]\n }\n },\n contractId: {\n serializedName: \"contract_id\",\n type: {\n name: \"String\"\n }\n },\n authFun: {\n serializedName: \"auth_fun\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NextNonceResponse: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NextNonceResponse\",\n modelProperties: {\n nextNonce: {\n serializedName: \"next_nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const DryRunInput: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DryRunInput\",\n modelProperties: {\n top: {\n serializedName: \"top\",\n type: {\n name: \"String\"\n }\n },\n accounts: {\n serializedName: \"accounts\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"DryRunAccount\"\n }\n }\n }\n },\n txs: {\n serializedName: \"txs\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"DryRunInputItem\"\n }\n }\n }\n },\n txEvents: {\n defaultValue: false,\n serializedName: \"tx_events\",\n type: {\n name: \"Boolean\"\n }\n }\n }\n }\n};\n\nexport const DryRunAccount: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DryRunAccount\",\n modelProperties: {\n pubKey: {\n serializedName: \"pub_key\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const DryRunInputItem: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DryRunInputItem\",\n modelProperties: {\n tx: {\n serializedName: \"tx\",\n type: {\n name: \"String\"\n }\n },\n callReq: {\n serializedName: \"call_req\",\n type: {\n name: \"Composite\",\n className: \"DryRunCallReq\"\n }\n }\n }\n }\n};\n\nexport const DryRunCallReq: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DryRunCallReq\",\n modelProperties: {\n calldata: {\n serializedName: \"calldata\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n contract: {\n serializedName: \"contract\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n type: {\n name: \"String\"\n }\n },\n gas: {\n serializedName: \"gas\",\n type: {\n name: \"String\"\n }\n },\n caller: {\n serializedName: \"caller\",\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n type: {\n name: \"String\"\n }\n },\n context: {\n serializedName: \"context\",\n type: {\n name: \"Composite\",\n className: \"DryRunCallContext\"\n }\n }\n }\n }\n};\n\nexport const DryRunCallContext: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DryRunCallContext\",\n modelProperties: {\n tx: {\n serializedName: \"tx\",\n type: {\n name: \"String\"\n }\n },\n txHash: {\n serializedName: \"tx_hash\",\n type: {\n name: \"String\"\n }\n },\n stateful: {\n serializedName: \"stateful\",\n type: {\n name: \"Boolean\"\n }\n }\n }\n }\n};\n\nexport const DryRunResults: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DryRunResults\",\n modelProperties: {\n results: {\n serializedName: \"results\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"DryRunResult\"\n }\n }\n }\n },\n txEvents: {\n serializedName: \"tx_events\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n }\n }\n }\n }\n }\n};\n\nexport const DryRunResult: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DryRunResult\",\n modelProperties: {\n type: {\n serializedName: \"type\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n result: {\n serializedName: \"result\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n reason: {\n serializedName: \"reason\",\n type: {\n name: \"String\"\n }\n },\n callObj: {\n serializedName: \"call_obj\",\n type: {\n name: \"Composite\",\n className: \"ContractCallObject\"\n }\n }\n }\n }\n};\n\nexport const ContractCallObject: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ContractCallObject\",\n modelProperties: {\n callerId: {\n serializedName: \"caller_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callerNonce: {\n serializedName: \"caller_nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n height: {\n serializedName: \"height\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n contractId: {\n serializedName: \"contract_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasUsed: {\n serializedName: \"gas_used\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n log: {\n serializedName: \"log\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"Event\"\n }\n }\n }\n },\n returnValue: {\n serializedName: \"return_value\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n returnType: {\n serializedName: \"return_type\",\n required: true,\n type: {\n name: \"Enum\",\n allowedValues: [\"ok\", \"error\", \"revert\"]\n }\n }\n }\n }\n};\n\nexport const Event: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Event\",\n modelProperties: {\n address: {\n serializedName: \"address\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n topics: {\n serializedName: \"topics\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n data: {\n serializedName: \"data\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const TxInfoObject: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"TxInfoObject\",\n modelProperties: {\n callInfo: {\n serializedName: \"call_info\",\n type: {\n name: \"Composite\",\n className: \"ContractCallObject\"\n }\n },\n gaInfo: {\n serializedName: \"ga_info\",\n type: {\n name: \"Composite\",\n className: \"GAObject\"\n }\n },\n txInfo: {\n serializedName: \"tx_info\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const GAObject: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"GAObject\",\n modelProperties: {\n callerId: {\n serializedName: \"caller_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n height: {\n serializedName: \"height\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasUsed: {\n serializedName: \"gas_used\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n returnValue: {\n serializedName: \"return_value\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n returnType: {\n serializedName: \"return_type\",\n required: true,\n type: {\n name: \"Enum\",\n allowedValues: [\"ok\", \"error\"]\n }\n },\n innerObject: {\n serializedName: \"inner_object\",\n type: {\n name: \"Composite\",\n className: \"TxInfoObject\"\n }\n }\n }\n }\n};\n\nexport const EncodedTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"EncodedTx\",\n modelProperties: {\n tx: {\n serializedName: \"tx\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PostTxResponse: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PostTxResponse\",\n modelProperties: {\n txHash: {\n serializedName: \"tx_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ContractObject: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ContractObject\",\n modelProperties: {\n id: {\n serializedName: \"id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ownerId: {\n serializedName: \"owner_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n vmVersion: {\n serializedName: \"vm_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n active: {\n serializedName: \"active\",\n required: true,\n type: {\n name: \"Boolean\"\n }\n },\n referrerIds: {\n serializedName: \"referrer_ids\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n deposit: {\n serializedName: \"deposit\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ByteCode: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ByteCode\",\n modelProperties: {\n bytecode: {\n serializedName: \"bytecode\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PoI: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PoI\",\n modelProperties: {\n poi: {\n serializedName: \"poi\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const RegisteredOracle: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"RegisteredOracle\",\n modelProperties: {\n id: {\n serializedName: \"id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n queryFormat: {\n serializedName: \"query_format\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responseFormat: {\n serializedName: \"response_format\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n queryFee: {\n serializedName: \"query_fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OracleQueries: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"OracleQueries\",\n modelProperties: {\n oracleQueries: {\n serializedName: \"oracle_queries\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"OracleQuery\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const OracleQuery: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"OracleQuery\",\n modelProperties: {\n id: {\n serializedName: \"id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n senderId: {\n serializedName: \"sender_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n senderNonce: {\n serializedName: \"sender_nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n oracleId: {\n serializedName: \"oracle_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n query: {\n serializedName: \"query\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n response: {\n serializedName: \"response\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responseTtl: {\n serializedName: \"response_ttl\",\n type: {\n name: \"Composite\",\n className: \"Ttl\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NameEntry: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NameEntry\",\n modelProperties: {\n id: {\n serializedName: \"id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n owner: {\n serializedName: \"owner\",\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n pointers: {\n serializedName: \"pointers\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"NamePointer\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const Channel: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Channel\",\n modelProperties: {\n id: {\n serializedName: \"id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n initiatorId: {\n serializedName: \"initiator_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responderId: {\n serializedName: \"responder_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n channelAmount: {\n serializedName: \"channel_amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n initiatorAmount: {\n serializedName: \"initiator_amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responderAmount: {\n serializedName: \"responder_amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n channelReserve: {\n serializedName: \"channel_reserve\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n delegateIds: {\n serializedName: \"delegate_ids\",\n type: {\n name: \"Composite\",\n className: \"Delegates\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n round: {\n serializedName: \"round\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n soloRound: {\n serializedName: \"solo_round\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n lockPeriod: {\n serializedName: \"lock_period\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n lockedUntil: {\n serializedName: \"locked_until\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PeerPubKey: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PeerPubKey\",\n modelProperties: {\n pubkey: {\n serializedName: \"pubkey\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const Status: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Status\",\n modelProperties: {\n genesisKeyBlockHash: {\n serializedName: \"genesis_key_block_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n solutions: {\n serializedName: \"solutions\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n difficulty: {\n serializedName: \"difficulty\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n syncing: {\n serializedName: \"syncing\",\n required: true,\n type: {\n name: \"Boolean\"\n }\n },\n syncProgress: {\n constraints: {\n InclusiveMaximum: 100,\n InclusiveMinimum: 0\n },\n serializedName: \"sync_progress\",\n type: {\n name: \"Number\"\n }\n },\n listening: {\n serializedName: \"listening\",\n required: true,\n type: {\n name: \"Boolean\"\n }\n },\n protocols: {\n serializedName: \"protocols\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"Protocol\"\n }\n }\n }\n },\n nodeVersion: {\n serializedName: \"node_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nodeRevision: {\n serializedName: \"node_revision\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n peerCount: {\n serializedName: \"peer_count\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n peerConnections: {\n serializedName: \"peer_connections\",\n type: {\n name: \"Composite\",\n className: \"PeerConnections\"\n }\n },\n pendingTransactionsCount: {\n serializedName: \"pending_transactions_count\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n networkId: {\n serializedName: \"network_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n peerPubkey: {\n serializedName: \"peer_pubkey\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n topKeyBlockHash: {\n serializedName: \"top_key_block_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n topBlockHeight: {\n serializedName: \"top_block_height\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const Protocol: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Protocol\",\n modelProperties: {\n version: {\n serializedName: \"version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n effectiveAtHeight: {\n serializedName: \"effective_at_height\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PeerConnections: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PeerConnections\",\n modelProperties: {\n inbound: {\n serializedName: \"inbound\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n outbound: {\n serializedName: \"outbound\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const SpendTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"SpendTx\",\n modelProperties: {\n recipientId: {\n serializedName: \"recipient_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n senderId: {\n serializedName: \"sender_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n payload: {\n serializedName: \"payload\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OracleRegisterTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"OracleRegisterTx\",\n modelProperties: {\n queryFormat: {\n serializedName: \"query_format\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responseFormat: {\n serializedName: \"response_format\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n queryFee: {\n serializedName: \"query_fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n oracleTtl: {\n serializedName: \"oracle_ttl\",\n type: {\n name: \"Composite\",\n className: \"Ttl\"\n }\n },\n accountId: {\n serializedName: \"account_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OracleExtendTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"OracleExtendTx\",\n modelProperties: {\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n oracleTtl: {\n serializedName: \"oracle_ttl\",\n type: {\n name: \"Composite\",\n className: \"RelativeTTL\"\n }\n },\n oracleId: {\n serializedName: \"oracle_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OracleQueryTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"OracleQueryTx\",\n modelProperties: {\n oracleId: {\n serializedName: \"oracle_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n query: {\n serializedName: \"query\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n queryFee: {\n serializedName: \"query_fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n queryTtl: {\n serializedName: \"query_ttl\",\n type: {\n name: \"Composite\",\n className: \"Ttl\"\n }\n },\n responseTtl: {\n serializedName: \"response_ttl\",\n type: {\n name: \"Composite\",\n className: \"RelativeTTL\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n senderId: {\n serializedName: \"sender_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OracleRespondTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"OracleRespondTx\",\n modelProperties: {\n queryId: {\n serializedName: \"query_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n response: {\n serializedName: \"response\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responseTtl: {\n serializedName: \"response_ttl\",\n type: {\n name: \"Composite\",\n className: \"RelativeTTL\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n oracleId: {\n serializedName: \"oracle_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NamePreclaimTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NamePreclaimTx\",\n modelProperties: {\n commitmentId: {\n serializedName: \"commitment_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n accountId: {\n serializedName: \"account_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NameClaimTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NameClaimTx\",\n modelProperties: {\n name: {\n serializedName: \"name\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nameSalt: {\n serializedName: \"name_salt\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nameFee: {\n serializedName: \"name_fee\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n accountId: {\n serializedName: \"account_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NameUpdateTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NameUpdateTx\",\n modelProperties: {\n nameId: {\n serializedName: \"name_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nameTtl: {\n serializedName: \"name_ttl\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n pointers: {\n serializedName: \"pointers\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"NamePointer\"\n }\n }\n }\n },\n clientTtl: {\n serializedName: \"client_ttl\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n accountId: {\n serializedName: \"account_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NameTransferTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NameTransferTx\",\n modelProperties: {\n nameId: {\n serializedName: \"name_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n recipientId: {\n serializedName: \"recipient_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n accountId: {\n serializedName: \"account_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NameRevokeTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NameRevokeTx\",\n modelProperties: {\n nameId: {\n serializedName: \"name_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n accountId: {\n serializedName: \"account_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const CommitmentId: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CommitmentId\",\n modelProperties: {\n commitmentId: {\n serializedName: \"commitment_id\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const NameHash: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"NameHash\",\n modelProperties: {\n nameId: {\n serializedName: \"name_id\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelCreateTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelCreateTx\",\n modelProperties: {\n initiatorId: {\n serializedName: \"initiator_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n initiatorAmount: {\n serializedName: \"initiator_amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responderId: {\n serializedName: \"responder_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responderAmount: {\n serializedName: \"responder_amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n channelReserve: {\n serializedName: \"channel_reserve\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n lockPeriod: {\n serializedName: \"lock_period\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n delegateIds: {\n serializedName: \"delegate_ids\",\n type: {\n name: \"Composite\",\n className: \"Delegates\"\n }\n }\n }\n }\n};\n\nexport const ChannelDepositTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelDepositTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n round: {\n serializedName: \"round\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelWithdrawTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelWithdrawTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n toId: {\n serializedName: \"to_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n round: {\n serializedName: \"round\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelForceProgressTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelForceProgressTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n payload: {\n serializedName: \"payload\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n round: {\n serializedName: \"round\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n update: {\n serializedName: \"update\",\n type: {\n name: \"Composite\",\n className: \"OffChainUpdate\"\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n offchainTrees: {\n serializedName: \"offchain_trees\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelCloseMutualTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelCloseMutualTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n initiatorAmountFinal: {\n serializedName: \"initiator_amount_final\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responderAmountFinal: {\n serializedName: \"responder_amount_final\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelCloseSoloTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelCloseSoloTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n payload: {\n serializedName: \"payload\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n poi: {\n serializedName: \"poi\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelSlashTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelSlashTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n payload: {\n serializedName: \"payload\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n poi: {\n serializedName: \"poi\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelSettleTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelSettleTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n initiatorAmountFinal: {\n serializedName: \"initiator_amount_final\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n responderAmountFinal: {\n serializedName: \"responder_amount_final\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelSnapshotSoloTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelSnapshotSoloTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n payload: {\n serializedName: \"payload\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ChannelSetDelegatesTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ChannelSetDelegatesTx\",\n modelProperties: {\n channelId: {\n serializedName: \"channel_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fromId: {\n serializedName: \"from_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n initiatorDelegateIds: {\n serializedName: \"initiator_delegate_ids\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n responderDelegateIds: {\n serializedName: \"responder_delegate_ids\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n stateHash: {\n serializedName: \"state_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n round: {\n serializedName: \"round\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n payload: {\n serializedName: \"payload\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PubKey: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PubKey\",\n modelProperties: {\n pubKey: {\n serializedName: \"pub_key\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PeerDetails: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PeerDetails\",\n modelProperties: {\n host: {\n serializedName: \"host\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n port: {\n serializedName: \"port\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n firstSeen: {\n serializedName: \"first_seen\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n lastSeen: {\n serializedName: \"last_seen\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n genesisHash: {\n serializedName: \"genesis_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n topHash: {\n serializedName: \"top_hash\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n topDifficulty: {\n serializedName: \"top_difficulty\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n networkId: {\n serializedName: \"network_id\",\n type: {\n name: \"String\"\n }\n },\n nodeVersion: {\n serializedName: \"node_version\",\n type: {\n name: \"String\"\n }\n },\n nodeRevision: {\n serializedName: \"node_revision\",\n type: {\n name: \"String\"\n }\n },\n nodeVendor: {\n serializedName: \"node_vendor\",\n type: {\n name: \"String\"\n }\n },\n nodeOs: {\n serializedName: \"node_os\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const Peers: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Peers\",\n modelProperties: {\n peers: {\n serializedName: \"peers\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n blocked: {\n serializedName: \"blocked\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n }\n }\n }\n};\n\nexport const PeerCount: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PeerCount\",\n modelProperties: {\n connected: {\n serializedName: \"connected\",\n type: {\n name: \"Composite\",\n className: \"PeerCountConnected\"\n }\n },\n available: {\n serializedName: \"available\",\n type: {\n name: \"Composite\",\n className: \"PeerCountAvailable\"\n }\n },\n blocked: {\n serializedName: \"blocked\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PeerCountConnected: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PeerCountConnected\",\n modelProperties: {\n inbound: {\n serializedName: \"inbound\",\n type: {\n name: \"String\"\n }\n },\n outbound: {\n serializedName: \"outbound\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const PeerCountAvailable: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PeerCountAvailable\",\n modelProperties: {\n verified: {\n serializedName: \"verified\",\n type: {\n name: \"String\"\n }\n },\n unverified: {\n serializedName: \"unverified\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ContractCreateTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ContractCreateTx\",\n modelProperties: {\n ownerId: {\n serializedName: \"owner_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n code: {\n serializedName: \"code\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n vmVersion: {\n serializedName: \"vm_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n deposit: {\n serializedName: \"deposit\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gas: {\n serializedName: \"gas\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n callData: {\n serializedName: \"call_data\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ContractCallTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ContractCallTx\",\n modelProperties: {\n callerId: {\n serializedName: \"caller_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n contractId: {\n serializedName: \"contract_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gas: {\n serializedName: \"gas\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callData: {\n serializedName: \"call_data\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const UnsignedTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"UnsignedTx\",\n modelProperties: {\n tx: {\n serializedName: \"tx\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const TokenSupply: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"TokenSupply\",\n modelProperties: {\n accounts: {\n serializedName: \"accounts\",\n type: {\n name: \"String\"\n }\n },\n contracts: {\n serializedName: \"contracts\",\n type: {\n name: \"String\"\n }\n },\n contractOracles: {\n serializedName: \"contract_oracles\",\n type: {\n name: \"String\"\n }\n },\n locked: {\n serializedName: \"locked\",\n type: {\n name: \"String\"\n }\n },\n oracles: {\n serializedName: \"oracles\",\n type: {\n name: \"String\"\n }\n },\n oracleQueries: {\n serializedName: \"oracle_queries\",\n type: {\n name: \"String\"\n }\n },\n pendingRewards: {\n serializedName: \"pending_rewards\",\n type: {\n name: \"String\"\n }\n },\n total: {\n serializedName: \"total\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const GAAttachTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"GAAttachTx\",\n modelProperties: {\n ownerId: {\n serializedName: \"owner_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n code: {\n serializedName: \"code\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n vmVersion: {\n serializedName: \"vm_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gas: {\n serializedName: \"gas\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n callData: {\n serializedName: \"call_data\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n authFun: {\n constraints: {\n Pattern: new RegExp(\"^(0x|0X)?[a-fA-F0-9]+$\")\n },\n serializedName: \"auth_fun\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const GAMetaTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"GAMetaTx\",\n modelProperties: {\n gaId: {\n serializedName: \"ga_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gas: {\n serializedName: \"gas\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n ttl: {\n serializedName: \"ttl\",\n type: {\n name: \"String\"\n }\n },\n authData: {\n serializedName: \"auth_data\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n tx: {\n serializedName: \"tx\",\n type: {\n name: \"Composite\",\n className: \"SignedTx\"\n }\n }\n }\n }\n};\n\nexport const PayingForTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"PayingForTx\",\n modelProperties: {\n payerId: {\n serializedName: \"payer_id\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n fee: {\n serializedName: \"fee\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n nonce: {\n serializedName: \"nonce\",\n type: {\n name: \"String\"\n }\n },\n tx: {\n serializedName: \"tx\",\n type: {\n name: \"Composite\",\n className: \"SignedTx\"\n }\n }\n }\n }\n};\n\nexport const CheckTxInPoolResponse: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CheckTxInPoolResponse\",\n modelProperties: {\n status: {\n serializedName: \"status\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OffChainTransfer: coreClient.CompositeMapper = {\n serializedName: \"OffChainTransfer\",\n type: {\n name: \"Composite\",\n className: \"OffChainTransfer\",\n uberParent: \"OffChainUpdate\",\n polymorphicDiscriminator: OffChainUpdate.type.polymorphicDiscriminator,\n modelProperties: {\n ...OffChainUpdate.type.modelProperties,\n from: {\n serializedName: \"from\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n to: {\n serializedName: \"to\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OffChainWithdrawal: coreClient.CompositeMapper = {\n serializedName: \"OffChainWithdrawal\",\n type: {\n name: \"Composite\",\n className: \"OffChainWithdrawal\",\n uberParent: \"OffChainUpdate\",\n polymorphicDiscriminator: OffChainUpdate.type.polymorphicDiscriminator,\n modelProperties: {\n ...OffChainUpdate.type.modelProperties,\n to: {\n serializedName: \"to\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OffChainDeposit: coreClient.CompositeMapper = {\n serializedName: \"OffChainDeposit\",\n type: {\n name: \"Composite\",\n className: \"OffChainDeposit\",\n uberParent: \"OffChainUpdate\",\n polymorphicDiscriminator: OffChainUpdate.type.polymorphicDiscriminator,\n modelProperties: {\n ...OffChainUpdate.type.modelProperties,\n from: {\n serializedName: \"from\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OffChainNewContract: coreClient.CompositeMapper = {\n serializedName: \"OffChainNewContract\",\n type: {\n name: \"Composite\",\n className: \"OffChainNewContract\",\n uberParent: \"OffChainUpdate\",\n polymorphicDiscriminator: OffChainUpdate.type.polymorphicDiscriminator,\n modelProperties: {\n ...OffChainUpdate.type.modelProperties,\n owner: {\n serializedName: \"owner\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n vmVersion: {\n serializedName: \"vm_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n code: {\n serializedName: \"code\",\n type: {\n name: \"Composite\",\n className: \"ByteCode\"\n }\n },\n deposit: {\n serializedName: \"deposit\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callData: {\n serializedName: \"call_data\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const OffChainCallContract: coreClient.CompositeMapper = {\n serializedName: \"OffChainCallContract\",\n type: {\n name: \"Composite\",\n className: \"OffChainCallContract\",\n uberParent: \"OffChainUpdate\",\n polymorphicDiscriminator: OffChainUpdate.type.polymorphicDiscriminator,\n modelProperties: {\n ...OffChainUpdate.type.modelProperties,\n caller: {\n serializedName: \"caller\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n contract: {\n serializedName: \"contract\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n abiVersion: {\n serializedName: \"abi_version\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n amount: {\n serializedName: \"amount\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gas: {\n serializedName: \"gas\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n gasPrice: {\n serializedName: \"gas_price\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callData: {\n serializedName: \"call_data\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const CreateContractUnsignedTx: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CreateContractUnsignedTx\",\n modelProperties: {\n ...UnsignedTx.type.modelProperties,\n contractId: {\n serializedName: \"contract_id\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport let discriminators = {\n \"Tx.undefined\": Tx,\n OffChainUpdate: OffChainUpdate,\n \"OffChainUpdate.OffChainTransfer\": OffChainTransfer,\n \"OffChainUpdate.OffChainWithdrawal\": OffChainWithdrawal,\n \"OffChainUpdate.OffChainDeposit\": OffChainDeposit,\n \"OffChainUpdate.OffChainNewContract\": OffChainNewContract,\n \"OffChainUpdate.OffChainCallContract\": OffChainCallContract\n};\n","import {\n OperationParameter,\n OperationURLParameter,\n OperationQueryParameter\n} from \"@azure/core-client\";\nimport {\n DryRunInput as DryRunInputMapper,\n EncodedTx as EncodedTxMapper\n} from \"../models/mappers\";\n\nexport const accept: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue: \"application/json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const $host: OperationURLParameter = {\n parameterPath: \"$host\",\n mapper: {\n serializedName: \"$host\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n skipEncoding: true\n};\n\nexport const intAsString: OperationQueryParameter = {\n parameterPath: \"intAsString\",\n mapper: {\n defaultValue: false,\n serializedName: \"int-as-string\",\n type: {\n name: \"Boolean\"\n }\n }\n};\n\nexport const hash: OperationURLParameter = {\n parameterPath: \"hash\",\n mapper: {\n serializedName: \"hash\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const height: OperationURLParameter = {\n parameterPath: \"height\",\n mapper: {\n constraints: {\n InclusiveMaximum: 18446744073709552000,\n InclusiveMinimum: 0\n },\n serializedName: \"height\",\n required: true,\n type: {\n name: \"Number\"\n }\n }\n};\n\nexport const index: OperationURLParameter = {\n parameterPath: \"index\",\n mapper: {\n constraints: {\n InclusiveMinimum: 1\n },\n serializedName: \"index\",\n required: true,\n type: {\n name: \"Number\"\n }\n }\n};\n\nexport const pubkey: OperationURLParameter = {\n parameterPath: \"pubkey\",\n mapper: {\n serializedName: \"pubkey\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const strategy: OperationQueryParameter = {\n parameterPath: [\"options\", \"strategy\"],\n mapper: {\n defaultValue: \"max\",\n serializedName: \"strategy\",\n type: {\n name: \"Enum\",\n allowedValues: [\"max\", \"continuity\"]\n }\n }\n};\n\nexport const contentType: OperationParameter = {\n parameterPath: [\"options\", \"contentType\"],\n mapper: {\n defaultValue: \"application/json\",\n isConstant: true,\n serializedName: \"Content-Type\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const body: OperationParameter = {\n parameterPath: \"body\",\n mapper: DryRunInputMapper\n};\n\nexport const body1: OperationParameter = {\n parameterPath: \"body\",\n mapper: EncodedTxMapper\n};\n\nexport const fromParam: OperationQueryParameter = {\n parameterPath: [\"options\", \"from\"],\n mapper: {\n serializedName: \"from\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const limit: OperationQueryParameter = {\n parameterPath: [\"options\", \"limit\"],\n mapper: {\n defaultValue: 20,\n constraints: {\n InclusiveMaximum: 1000,\n InclusiveMinimum: 1\n },\n serializedName: \"limit\",\n type: {\n name: \"Number\"\n }\n }\n};\n\nexport const typeParam: OperationQueryParameter = {\n parameterPath: [\"options\", \"type\"],\n mapper: {\n defaultValue: \"all\",\n serializedName: \"type\",\n type: {\n name: \"Enum\",\n allowedValues: [\"open\", \"closed\", \"all\"]\n }\n }\n};\n\nexport const queryId: OperationURLParameter = {\n parameterPath: \"queryId\",\n mapper: {\n serializedName: \"query-id\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const name: OperationURLParameter = {\n parameterPath: \"name\",\n mapper: {\n serializedName: \"name\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n","import * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport * as Parameters from \"./models/parameters\";\nimport * as Mappers from \"./models/mappers\";\nimport {\n NodeOptionalParams,\n GetTopHeaderOptionalParams,\n GetTopHeaderResponse,\n GetCurrentKeyBlockOptionalParams,\n GetCurrentKeyBlockResponse,\n GetCurrentKeyBlockHashOptionalParams,\n GetCurrentKeyBlockHashResponse,\n GetCurrentKeyBlockHeightOptionalParams,\n GetCurrentKeyBlockHeightResponse,\n GetPendingKeyBlockOptionalParams,\n GetPendingKeyBlockResponse,\n GetKeyBlockByHashOptionalParams,\n GetKeyBlockByHashResponse,\n GetKeyBlockByHeightOptionalParams,\n GetKeyBlockByHeightResponse,\n GetMicroBlockHeaderByHashOptionalParams,\n GetMicroBlockHeaderByHashResponse,\n GetMicroBlockTransactionsByHashOptionalParams,\n GetMicroBlockTransactionsByHashResponse,\n GetMicroBlockTransactionByHashAndIndexOptionalParams,\n GetMicroBlockTransactionByHashAndIndexResponse,\n GetMicroBlockTransactionsCountByHashOptionalParams,\n GetMicroBlockTransactionsCountByHashResponse,\n GetCurrentGenerationOptionalParams,\n GetCurrentGenerationResponse,\n GetGenerationByHashOptionalParams,\n GetGenerationByHashResponse,\n GetGenerationByHeightOptionalParams,\n GetGenerationByHeightResponse,\n GetAccountByPubkeyOptionalParams,\n GetAccountByPubkeyResponse,\n GetAccountByPubkeyAndHeightOptionalParams,\n GetAccountByPubkeyAndHeightResponse,\n GetAccountByPubkeyAndHashOptionalParams,\n GetAccountByPubkeyAndHashResponse,\n GetPendingAccountTransactionsByPubkeyOptionalParams,\n GetPendingAccountTransactionsByPubkeyResponse,\n GetAccountNextNonceOptionalParams,\n GetAccountNextNonceResponse,\n DryRunInput,\n ProtectedDryRunTxsOptionalParams,\n ProtectedDryRunTxsResponse,\n GetTransactionByHashOptionalParams,\n GetTransactionByHashResponse,\n GetTransactionInfoByHashOptionalParams,\n GetTransactionInfoByHashResponse,\n EncodedTx,\n PostTransactionOptionalParams,\n PostTransactionResponse,\n GetContractOptionalParams,\n GetContractResponse,\n GetContractCodeOptionalParams,\n GetContractCodeResponse,\n GetContractPoIOptionalParams,\n GetContractPoIResponse,\n GetOracleByPubkeyOptionalParams,\n GetOracleByPubkeyResponse,\n GetOracleQueriesByPubkeyOptionalParams,\n GetOracleQueriesByPubkeyResponse,\n GetOracleQueryByPubkeyAndQueryIdOptionalParams,\n GetOracleQueryByPubkeyAndQueryIdResponse,\n GetNameEntryByNameOptionalParams,\n GetNameEntryByNameResponse,\n GetChannelByPubkeyOptionalParams,\n GetChannelByPubkeyResponse,\n GetPeerPubkeyOptionalParams,\n GetPeerPubkeyResponse,\n GetStatusOptionalParams,\n GetStatusResponse,\n GetChainEndsOptionalParams,\n GetChainEndsResponse\n} from \"./models\";\n\nexport class Node extends coreClient.ServiceClient {\n $host: string;\n intAsString?: boolean;\n\n /**\n * Initializes a new instance of the Node class.\n * @param $host server parameter\n * @param options The parameter options\n */\n constructor($host: string, options?: NodeOptionalParams) {\n if ($host === undefined) {\n throw new Error(\"'$host' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: NodeOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-node/1.0.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n baseUri: options.endpoint ?? options.baseUri ?? \"{$host}\"\n };\n super(optionsWithDefaults);\n\n if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();\n const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(\n (pipelinePolicy) =>\n pipelinePolicy.name ===\n coreRestPipeline.bearerTokenAuthenticationPolicyName\n );\n if (!bearerTokenAuthenticationPolicyFound) {\n this.pipeline.removePolicy({\n name: coreRestPipeline.bearerTokenAuthenticationPolicyName\n });\n this.pipeline.addPolicy(\n coreRestPipeline.bearerTokenAuthenticationPolicy({\n scopes: `${optionsWithDefaults.baseUri}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge:\n coreClient.authorizeRequestOnClaimChallenge\n }\n })\n );\n }\n }\n // Parameter assignments\n this.$host = $host;\n }\n\n /**\n * Get the top header (either key or micro block)\n * @param options The options parameters.\n */\n getTopHeader(\n options?: GetTopHeaderOptionalParams\n ): Promise<GetTopHeaderResponse> {\n return this.sendOperationRequest({ options }, getTopHeaderOperationSpec);\n }\n\n /**\n * Get the current key block\n * @param options The options parameters.\n */\n getCurrentKeyBlock(\n options?: GetCurrentKeyBlockOptionalParams\n ): Promise<GetCurrentKeyBlockResponse> {\n return this.sendOperationRequest(\n { options },\n getCurrentKeyBlockOperationSpec\n );\n }\n\n /**\n * Get the hash of the current key block\n * @param options The options parameters.\n */\n getCurrentKeyBlockHash(\n options?: GetCurrentKeyBlockHashOptionalParams\n ): Promise<GetCurrentKeyBlockHashResponse> {\n return this.sendOperationRequest(\n { options },\n getCurrentKeyBlockHashOperationSpec\n );\n }\n\n /**\n * Get the height of the current key block\n * @param options The options parameters.\n */\n getCurrentKeyBlockHeight(\n options?: GetCurrentKeyBlockHeightOptionalParams\n ): Promise<GetCurrentKeyBlockHeightResponse> {\n return this.sendOperationRequest(\n { options },\n getCurrentKeyBlockHeightOperationSpec\n );\n }\n\n /**\n * Get the pending key block\n * @param options The options parameters.\n */\n getPendingKeyBlock(\n options?: GetPendingKeyBlockOptionalParams\n ): Promise<GetPendingKeyBlockResponse> {\n return this.sendOperationRequest(\n { options },\n getPendingKeyBlockOperationSpec\n );\n }\n\n /**\n * Get a key block by hash\n * @param hash The hash of the block - either a keyblock or a microblock\n * @param options The options parameters.\n */\n getKeyBlockByHash(\n hash: string,\n options?: GetKeyBlockByHashOptionalParams\n ): Promise<GetKeyBlockByHashResponse> {\n return this.sendOperationRequest(\n { hash, options },\n getKeyBlockByHashOperationSpec\n );\n }\n\n /**\n * Get a key block by height\n * @param height The height\n * @param options The options parameters.\n */\n getKeyBlockByHeight(\n height: number,\n options?: GetKeyBlockByHeightOptionalParams\n ): Promise<GetKeyBlockByHeightResponse> {\n return this.sendOperationRequest(\n { height, options },\n getKeyBlockByHeightOperationSpec\n );\n }\n\n /**\n * Get a micro block header by hash\n * @param hash The hash of the block - either a keyblock or a microblock\n * @param options The options parameters.\n */\n getMicroBlockHeaderByHash(\n hash: string,\n options?: GetMicroBlockHeaderByHashOptionalParams\n ): Promise<GetMicroBlockHeaderByHashResponse> {\n return this.sendOperationRequest(\n { hash, options },\n getMicroBlockHeaderByHashOperationSpec\n );\n }\n\n /**\n * Get micro block transactions by hash\n * @param hash The hash of the micro block\n * @param options The options parameters.\n */\n getMicroBlockTransactionsByHash(\n hash: string,\n options?: GetMicroBlockTransactionsByHashOptionalParams\n ): Promise<GetMicroBlockTransactionsByHashResponse> {\n return this.sendOperationRequest(\n { hash, options },\n getMicroBlockTransactionsByHashOperationSpec\n );\n }\n\n /**\n * Get a micro block transaction by hash and index\n * @param hash The hash of the micro block\n * @param index The index of the transaction in a block\n * @param options The options parameters.\n */\n getMicroBlockTransactionByHashAndIndex(\n hash: string,\n index: number,\n options?: GetMicroBlockTransactionByHashAndIndexOptionalParams\n ): Promise<GetMicroBlockTransactionByHashAndIndexResponse> {\n return this.sendOperationRequest(\n { hash, index, options },\n getMicroBlockTransactionByHashAndIndexOperationSpec\n );\n }\n\n /**\n * Get micro block transaction count by hash\n * @param hash The hash of the micro block\n * @param options The options parameters.\n */\n getMicroBlockTransactionsCountByHash(\n hash: string,\n options?: GetMicroBlockTransactionsCountByHashOptionalParams\n ): Promise<GetMicroBlockTransactionsCountByHashResponse> {\n return this.sendOperationRequest(\n { hash, options },\n getMicroBlockTransactionsCountByHashOperationSpec\n );\n }\n\n /**\n * Get the current generation\n * @param options The options parameters.\n */\n getCurrentGeneration(\n options?: GetCurrentGenerationOptionalParams\n ): Promise<GetCurrentGenerationResponse> {\n return this.sendOperationRequest(\n { options },\n getCurrentGenerationOperationSpec\n );\n }\n\n /**\n * Get a generation by hash\n * @param hash The hash of the key block\n * @param options The options parameters.\n */\n getGenerationByHash(\n hash: string,\n options?: GetGenerationByHashOptionalParams\n ): Promise<GetGenerationByHashResponse> {\n return this.sendOperationRequest(\n { hash, options },\n getGenerationByHashOperationSpec\n );\n }\n\n /**\n * Get a generation by height\n * @param height The height\n * @param options The options parameters.\n */\n getGenerationByHeight(\n height: number,\n options?: GetGenerationByHeightOptionalParams\n ): Promise<GetGenerationByHeightResponse> {\n return this.sendOperationRequest(\n { height, options },\n getGenerationByHeightOperationSpec\n );\n }\n\n /**\n * Get an account by public key\n * @param pubkey The public key of the account\n * @param options The options parameters.\n */\n getAccountByPubkey(\n pubkey: string,\n options?: GetAccountByPubkeyOptionalParams\n ): Promise<GetAccountByPubkeyResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getAccountByPubkeyOperationSpec\n );\n }\n\n /**\n * Get an account by public key after the opening key block of the generation at height\n * @param pubkey The public key of the account\n * @param height The height\n * @param options The options parameters.\n */\n getAccountByPubkeyAndHeight(\n pubkey: string,\n height: number,\n options?: GetAccountByPubkeyAndHeightOptionalParams\n ): Promise<GetAccountByPubkeyAndHeightResponse> {\n return this.sendOperationRequest(\n { pubkey, height, options },\n getAccountByPubkeyAndHeightOperationSpec\n );\n }\n\n /**\n * Get an account by public key after the block indicated by hash. Can be either a micro block or a\n * keyblock hash\n * @param pubkey The public key of the account\n * @param hash The hash of the block - either a keyblock or a microblock\n * @param options The options parameters.\n */\n getAccountByPubkeyAndHash(\n pubkey: string,\n hash: string,\n options?: GetAccountByPubkeyAndHashOptionalParams\n ): Promise<GetAccountByPubkeyAndHashResponse> {\n return this.sendOperationRequest(\n { pubkey, hash, options },\n getAccountByPubkeyAndHashOperationSpec\n );\n }\n\n /**\n * Get pending account transactions by public key\n * @param pubkey The public key of the account\n * @param options The options parameters.\n */\n getPendingAccountTransactionsByPubkey(\n pubkey: string,\n options?: GetPendingAccountTransactionsByPubkeyOptionalParams\n ): Promise<GetPendingAccountTransactionsByPubkeyResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getPendingAccountTransactionsByPubkeyOperationSpec\n );\n }\n\n /**\n * Get an account's next nonce; This is computed according to whatever is the current account nonce and\n * what transactions are currently present in the transaction pool\n * @param pubkey The public key of the account\n * @param options The options parameters.\n */\n getAccountNextNonce(\n pubkey: string,\n options?: GetAccountNextNonceOptionalParams\n ): Promise<GetAccountNextNonceResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getAccountNextNonceOperationSpec\n );\n }\n\n /**\n * Dry-run transactions on top of a given block. Supports all TXs except GAMetaTx, PayingForTx and\n * OffchainTx. The maximum gas limit of all calls is capped. The maximum gas limit per request is a\n * global node setting. Since DryRunCallReq object do not have a mandatory gas field, if not set a\n * default value of 1000000 is being used instead.\n * @param body transactions\n * @param options The options parameters.\n */\n protectedDryRunTxs(\n body: DryRunInput,\n options?: ProtectedDryRunTxsOptionalParams\n ): Promise<ProtectedDryRunTxsResponse> {\n return this.sendOperationRequest(\n { body, options },\n protectedDryRunTxsOperationSpec\n );\n }\n\n /**\n * Get a transaction by hash\n * @param hash The hash of the transaction\n * @param options The options parameters.\n */\n getTransactionByHash(\n hash: string,\n options?: GetTransactionByHashOptionalParams\n ): Promise<GetTransactionByHashResponse> {\n return this.sendOperationRequest(\n { hash, options },\n getTransactionByHashOperationSpec\n );\n }\n\n /**\n * @param hash The hash of the transaction\n * @param options The options parameters.\n */\n getTransactionInfoByHash(\n hash: string,\n options?: GetTransactionInfoByHashOptionalParams\n ): Promise<GetTransactionInfoByHashResponse> {\n return this.sendOperationRequest(\n { hash, options },\n getTransactionInfoByHashOperationSpec\n );\n }\n\n /**\n * Post a new transaction\n * @param body The new transaction\n * @param options The options parameters.\n */\n postTransaction(\n body: EncodedTx,\n options?: PostTransactionOptionalParams\n ): Promise<PostTransactionResponse> {\n return this.sendOperationRequest(\n { body, options },\n postTransactionOperationSpec\n );\n }\n\n /**\n * Get a contract by pubkey\n * @param pubkey Contract pubkey to get proof for\n * @param options The options parameters.\n */\n getContract(\n pubkey: string,\n options?: GetContractOptionalParams\n ): Promise<GetContractResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getContractOperationSpec\n );\n }\n\n /**\n * Get contract code by pubkey\n * @param pubkey Contract pubkey to get proof for\n * @param options The options parameters.\n */\n getContractCode(\n pubkey: string,\n options?: GetContractCodeOptionalParams\n ): Promise<GetContractCodeResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getContractCodeOperationSpec\n );\n }\n\n /**\n * Get a proof of inclusion for a contract\n * @param pubkey Contract pubkey to get proof for\n * @param options The options parameters.\n */\n getContractPoI(\n pubkey: string,\n options?: GetContractPoIOptionalParams\n ): Promise<GetContractPoIResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getContractPoIOperationSpec\n );\n }\n\n /**\n * Get an oracle by public key\n * @param pubkey The public key of the oracle\n * @param options The options parameters.\n */\n getOracleByPubkey(\n pubkey: string,\n options?: GetOracleByPubkeyOptionalParams\n ): Promise<GetOracleByPubkeyResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getOracleByPubkeyOperationSpec\n );\n }\n\n /**\n * Get oracle queries by public key\n * @param pubkey The public key of the oracle\n * @param options The options parameters.\n */\n getOracleQueriesByPubkey(\n pubkey: string,\n options?: GetOracleQueriesByPubkeyOptionalParams\n ): Promise<GetOracleQueriesByPubkeyResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getOracleQueriesByPubkeyOperationSpec\n );\n }\n\n /**\n * Get an oracle query by public key and query ID\n * @param pubkey The public key of the oracle\n * @param queryId The ID of the query\n * @param options The options parameters.\n */\n getOracleQueryByPubkeyAndQueryId(\n pubkey: string,\n queryId: string,\n options?: GetOracleQueryByPubkeyAndQueryIdOptionalParams\n ): Promise<GetOracleQueryByPubkeyAndQueryIdResponse> {\n return this.sendOperationRequest(\n { pubkey, queryId, options },\n getOracleQueryByPubkeyAndQueryIdOperationSpec\n );\n }\n\n /**\n * Get name entry from naming system\n * @param name The name key of the name entry\n * @param options The options parameters.\n */\n getNameEntryByName(\n name: string,\n options?: GetNameEntryByNameOptionalParams\n ): Promise<GetNameEntryByNameResponse> {\n return this.sendOperationRequest(\n { name, options },\n getNameEntryByNameOperationSpec\n );\n }\n\n /**\n * Get channel by public key\n * @param pubkey The pubkey of the channel\n * @param options The options parameters.\n */\n getChannelByPubkey(\n pubkey: string,\n options?: GetChannelByPubkeyOptionalParams\n ): Promise<GetChannelByPubkeyResponse> {\n return this.sendOperationRequest(\n { pubkey, options },\n getChannelByPubkeyOperationSpec\n );\n }\n\n /**\n * Get peer public key\n * @param options The options parameters.\n */\n getPeerPubkey(\n options?: GetPeerPubkeyOptionalParams\n ): Promise<GetPeerPubkeyResponse> {\n return this.sendOperationRequest({ options }, getPeerPubkeyOperationSpec);\n }\n\n /**\n * Get the status of a node\n * @param options The options parameters.\n */\n getStatus(options?: GetStatusOptionalParams): Promise<GetStatusResponse> {\n return this.sendOperationRequest({ options }, getStatusOperationSpec);\n }\n\n /**\n * Get oldest keyblock hashes counting from genesis including orphans\n * @param options The options parameters.\n */\n getChainEnds(\n options?: GetChainEndsOptionalParams\n ): Promise<GetChainEndsResponse> {\n return this.sendOperationRequest({ options }, getChainEndsOperationSpec);\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getTopHeaderOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/headers/top\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Header\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getCurrentKeyBlockOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/key-blocks/current\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.KeyBlock\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getCurrentKeyBlockHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/key-blocks/current/hash\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.HashResponse\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getCurrentKeyBlockHeightOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/key-blocks/current/height\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.HeightResponse\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getPendingKeyBlockOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/key-blocks/pending\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.KeyBlock\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getKeyBlockByHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/key-blocks/hash/{hash}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.KeyBlock\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getKeyBlockByHeightOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/key-blocks/height/{height}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.KeyBlock\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.height],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getMicroBlockHeaderByHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/micro-blocks/hash/{hash}/header\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.MicroBlockHeader\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getMicroBlockTransactionsByHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/micro-blocks/hash/{hash}/transactions\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SignedTxs\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getMicroBlockTransactionByHashAndIndexOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/micro-blocks/hash/{hash}/transactions/index/{index}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SignedTx\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash, Parameters.index],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getMicroBlockTransactionsCountByHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/micro-blocks/hash/{hash}/transactions/count\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.CountResponse\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getCurrentGenerationOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/generations/current\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Generation\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getGenerationByHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/generations/hash/{hash}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Generation\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getGenerationByHeightOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/generations/height/{height}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Generation\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.height],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getAccountByPubkeyOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/accounts/{pubkey}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Account\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getAccountByPubkeyAndHeightOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/accounts/{pubkey}/height/{height}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Account\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.height, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getAccountByPubkeyAndHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/accounts/{pubkey}/hash/{hash}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Account\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getPendingAccountTransactionsByPubkeyOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/accounts/{pubkey}/transactions/pending\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SignedTxs\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getAccountNextNonceOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/accounts/{pubkey}/next-nonce\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.NextNonceResponse\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString, Parameters.strategy],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst protectedDryRunTxsOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/dry-run\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.DryRunResults\n },\n 403: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n requestBody: Parameters.body,\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept, Parameters.contentType],\n mediaType: \"json\",\n serializer\n};\nconst getTransactionByHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/transactions/{hash}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SignedTx\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getTransactionInfoByHashOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/transactions/{hash}/info\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.TxInfoObject\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.hash],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst postTransactionOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/transactions\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.PostTxResponse\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n requestBody: Parameters.body1,\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept, Parameters.contentType],\n mediaType: \"json\",\n serializer\n};\nconst getContractOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/contracts/{pubkey}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.ContractObject\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getContractCodeOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/contracts/{pubkey}/code\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.ByteCode\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getContractPoIOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/contracts/{pubkey}/poi\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.PoI\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getOracleByPubkeyOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/oracles/{pubkey}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.RegisteredOracle\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getOracleQueriesByPubkeyOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/oracles/{pubkey}/queries\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.OracleQueries\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [\n Parameters.intAsString,\n Parameters.fromParam,\n Parameters.limit,\n Parameters.typeParam\n ],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getOracleQueryByPubkeyAndQueryIdOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/oracles/{pubkey}/queries/{query-id}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.OracleQuery\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey, Parameters.queryId],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getNameEntryByNameOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/names/{name}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.NameEntry\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.name],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getChannelByPubkeyOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/channels/{pubkey}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Channel\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n },\n 404: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host, Parameters.pubkey],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getPeerPubkeyOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/peers/pubkey\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.PeerPubKey\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getStatusOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/status\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.Status\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getChainEndsOperationSpec: coreClient.OperationSpec = {\n path: \"/v3/status/chain-ends\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: {\n type: { name: \"Sequence\", element: { type: { name: \"String\" } } }\n }\n }\n },\n queryParameters: [Parameters.intAsString],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\n","// eslint-disable-next-line max-classes-per-file\nimport BigNumber from 'bignumber.js';\nimport { OperationArguments, OperationSpec } from '@azure/core-client';\nimport {\n genRequestQueuesPolicy, genCombineGetRequestsPolicy, genErrorFormatterPolicy,\n genVersionCheckPolicy,\n} from './utils/autorest';\nimport { Node as NodeApi, NodeOptionalParams, ErrorModel } from './apis/node';\nimport { mapObject } from './utils/other';\nimport { Encoded } from './utils/encoder';\nimport { MissingParamError } from './utils/errors';\n\n/**\n * Obtain networkId from account or node\n */\nexport async function getNetworkId({ networkId }: { networkId?: string } = {}): Promise<string> {\n const res = networkId ?? this.networkId ?? (await this.api?.getStatus())?.networkId;\n if (res != null) return res;\n throw new MissingParamError('networkId is not provided');\n}\n\nconst bigIntPropertyNames = [\n 'balance', 'queryFee', 'fee', 'amount', 'nameFee', 'channelAmount',\n 'initiatorAmount', 'responderAmount', 'channelReserve', 'initiatorAmountFinal',\n 'responderAmountFinal', 'gasPrice', 'deposit',\n] as const;\n\nconst numberPropertyNames = [\n 'time', 'gas', 'gasUsed', 'nameSalt',\n 'nonce', 'nextNonce', 'height', 'blockHeight', 'top', 'topBlockHeight',\n 'ttl', 'nameTtl', 'clientTtl',\n 'inbound', 'outbound', 'peerCount', 'pendingTransactionsCount', 'effectiveAtHeight',\n 'version', 'solutions', 'round',\n] as const;\n\nclass NodeTransformed extends NodeApi {\n async sendOperationRequest(\n operationArguments: OperationArguments,\n operationSpec: OperationSpec,\n ): Promise<any> {\n const args = mapObject(\n operationArguments,\n ([key, value]) => [key, this.#encodeArg(value)],\n ) as OperationArguments;\n return this.#decodeRes(await super.sendOperationRequest(args, operationSpec));\n }\n\n #mapData(data: any, transform: {\n bigInt: (v: any) => any;\n number: (v: any) => any;\n }): unknown {\n if (Array.isArray(data)) return data.map((d) => this.#mapData(d, transform));\n if (data != null && typeof data === 'object') {\n return mapObject(data, ([key, value]) => {\n if (value == null) return [key, value];\n if (bigIntPropertyNames.some((k) => k === key)) return [key, transform.bigInt(value)];\n if (numberPropertyNames.some((k) => k === key)) return [key, transform.number(value)];\n return [key, this.#mapData(value, transform)];\n });\n }\n return data;\n }\n\n #encodeArg(data: any): any {\n return this.#mapData(data, {\n bigInt: (value) => {\n if (value instanceof BigNumber) return value.toFixed();\n return value.toString();\n },\n number: (value) => value.toString(),\n });\n }\n\n #decodeRes(data: any): any {\n return this.#mapData(data, {\n bigInt: (value) => BigInt(value),\n number: (value) => +value,\n });\n }\n}\n\ntype BigIntPropertyNames = typeof bigIntPropertyNames[number];\ntype NumberPropertyNames = typeof numberPropertyNames[number];\ntype PreserveOptional<NewType, OrigType> =\n OrigType extends undefined ? NewType | undefined : NewType;\nexport type TransformNodeType<Type> =\n Type extends (...args: infer Args) => infer Ret\n ? (...args: TransformNodeType<Args>) => TransformNodeType<Ret>\n : Type extends [infer Item, ...infer Rest]\n ? [TransformNodeType<Item>, ...TransformNodeType<Rest>]\n : Type extends Array<infer Item>\n ? Array<TransformNodeType<Item>>\n : Type extends Promise<infer T>\n ? Promise<TransformNodeType<T>>\n : Type extends { [P in any]: any }\n ? {\n [Property in keyof Type]:\n Property extends BigIntPropertyNames\n ? PreserveOptional<bigint, Type[Property]>\n : Property extends NumberPropertyNames\n ? PreserveOptional<number, Type[Property]>\n : Property extends 'txHash'\n ? PreserveOptional<Encoded.TxHash, Type[Property]>\n : TransformNodeType<Type[Property]>\n }\n : Type;\ntype NodeTransformedApi = new (...args: ConstructorParameters<typeof NodeApi>) => {\n [Name in keyof InstanceType<typeof NodeApi>]:\n Name extends 'pipeline' | 'sendRequest' | 'sendOperationRequest'\n ? NodeApi[Name] : TransformNodeType<NodeApi[Name]>\n};\n\nexport interface NodeInfo {\n url: string;\n nodeNetworkId: string;\n version: string;\n consensusProtocolVersion: number;\n}\n\nexport default class Node extends (NodeTransformed as unknown as NodeTransformedApi) {\n url: string;\n\n /**\n * @param url - Url for node API\n * @param options - Options\n * @param options.ignoreVersion - Don't check node version\n */\n constructor(\n url: string,\n { ignoreVersion = false, ...options }: NodeOptionalParams & { ignoreVersion?: boolean } = {},\n ) {\n // eslint-disable-next-line constructor-super\n super(url, {\n allowInsecureConnection: true,\n additionalPolicies: [\n genRequestQueuesPolicy(),\n genCombineGetRequestsPolicy(),\n genErrorFormatterPolicy((body: ErrorModel) => ` ${body.reason}`),\n ],\n ...options,\n });\n this.url = url;\n if (!ignoreVersion) {\n const versionPromise = this.getStatus().then(({ nodeVersion }) => nodeVersion);\n this.pipeline.addPolicy(\n genVersionCheckPolicy('node', '/v3/status', versionPromise, '6.2.0', '7.0.0'),\n );\n }\n this.intAsString = true;\n }\n\n async getNodeInfo(): Promise<NodeInfo> {\n const {\n nodeVersion: version,\n networkId: nodeNetworkId,\n protocols,\n topBlockHeight,\n } = await this.getStatus();\n const consensusProtocolVersion = protocols\n .filter(({ effectiveAtHeight }) => topBlockHeight >= effectiveAtHeight)\n .reduce(\n (acc, p) => (p.effectiveAtHeight > acc.effectiveAtHeight ? p : acc),\n { effectiveAtHeight: -1, version: 0 },\n )\n .version;\n return {\n url: this.url,\n nodeNetworkId,\n version,\n consensusProtocolVersion,\n };\n }\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport { messageToHash, verifyMessage as verifyMessageCrypto, hash } from '../utils/crypto';\nimport { buildTx } from '../tx/builder';\nimport { decode, Encoded } from '../utils/encoder';\nimport { Tag } from '../tx/builder/constants';\nimport { getNetworkId } from '../Node';\nimport { concatBuffers } from '../utils/other';\nimport type { createMetaTx } from '../contract/ga';\n\n/**\n * Check is provided object looks like an instance of AccountBase\n * @param acc - Object to check\n */\nexport const isAccountBase = (acc: AccountBase | any): boolean => (\n !['sign', 'address', 'signTransaction', 'signMessage'].some((f) => typeof acc[f] !== 'function')\n);\n\n/**\n * Account is one of the three basic building blocks of an\n * {@link AeSdk} and provides access to a signing key pair.\n */\nexport default abstract class AccountBase {\n networkId?: string;\n\n /**\n * @param options - Options\n * @param options.networkId - Using for signing transactions\n */\n constructor({ networkId }: { networkId?: string } = {}) {\n this.networkId ??= networkId;\n }\n\n /**\n * Sign encoded transaction\n * @param tx - Transaction to sign\n * @param opt - Options\n * @param opt.innerTx - Sign as inner transaction for PayingFor\n * @returns Signed transaction\n */\n async signTransaction(\n tx: Encoded.Transaction,\n { innerTx, networkId, ...options }: {\n innerTx?: boolean;\n networkId?: string;\n authData?: Parameters<typeof createMetaTx>[1];\n authFun?: Parameters<typeof createMetaTx>[2];\n } & Omit<Partial<Parameters<typeof createMetaTx>[3]>, 'onAccount'> = {},\n ): Promise<Encoded.Transaction> {\n const prefixes = [await this.getNetworkId({ networkId })];\n if (innerTx === true) prefixes.push('inner_tx');\n const rlpBinaryTx = decode(tx);\n const txWithNetworkId = concatBuffers([Buffer.from(prefixes.join('-')), hash(rlpBinaryTx)]);\n\n const signatures = [await this.sign(txWithNetworkId, options)];\n return buildTx({ encodedTx: rlpBinaryTx, signatures }, Tag.SignedTx).tx;\n }\n\n /**\n * Get network Id\n * @returns Network Id\n */\n readonly getNetworkId = getNetworkId;\n\n /**\n * Sign message\n * @param message - Message to sign\n * @param opt - Options\n * @returns Signature as hex string of Uint8Array\n */\n async signMessage(\n message: string,\n { returnHex = false, ...options }: { returnHex?: boolean } = {},\n ): Promise<string | Uint8Array> {\n const sig = await this.sign(messageToHash(message), options);\n return returnHex ? Buffer.from(sig).toString('hex') : sig;\n }\n\n /**\n * Verify message\n * @param message - Message to verify\n * @param signature - Signature\n * @param options - Options\n */\n async verifyMessage(\n message: string,\n signature: string | Uint8Array,\n options?: object,\n ): Promise<boolean> {\n return verifyMessageCrypto(\n message,\n typeof signature === 'string' ? Buffer.from(signature, 'hex') : signature,\n decode(await this.address(options)),\n );\n }\n\n /**\n * Sign data blob\n * @param data - Data blob to sign\n * @param options - Options\n * @returns Signed data blob\n */\n abstract sign(data: string | Uint8Array, options?: any): Promise<Uint8Array>;\n\n /**\n * Obtain account address\n * @returns Public account address\n */\n abstract address(opt?: object): Promise<Encoded.AccountAddress>;\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2018 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport AccountBase from './Base';\nimport { sign, isValidKeypair } from '../utils/crypto';\nimport { isHex } from '../utils/string';\nimport { ArgumentError, InvalidKeypairError, MissingParamError } from '../utils/errors';\nimport { decode, Encoded } from '../utils/encoder';\nimport { createMetaTx } from '../contract/ga';\n\nconst secrets = new WeakMap();\n\nexport interface Keypair {\n publicKey: Encoded.AccountAddress;\n secretKey: string | Uint8Array;\n}\n\n/**\n * In-memory account class\n */\nexport default class AccountMemory extends AccountBase {\n isGa: boolean;\n\n /**\n * @param options - Options\n * @param options.keypair - Key pair to use\n * @param options.keypair.publicKey - Public key\n * @param options.keypair.secretKey - Private key\n * @param options.gaId - Address of generalized account\n */\n constructor(\n { keypair, gaId, ...options }: { keypair?: Keypair; gaId?: Encoded.AccountAddress }\n & ConstructorParameters<typeof AccountBase>[0],\n ) {\n super(options);\n\n this.isGa = gaId != null;\n if (this.isGa && gaId != null) {\n decode(gaId);\n secrets.set(this, { publicKey: gaId });\n return;\n }\n\n if (keypair == null) throw new MissingParamError('Either gaId or keypair is required');\n\n if (\n !Buffer.isBuffer(keypair.secretKey)\n && typeof keypair.secretKey === 'string' && !isHex(keypair.secretKey)\n ) throw new InvalidKeypairError('Secret key must be hex string or Buffer');\n const secretKey = typeof keypair.secretKey === 'string'\n ? Buffer.from(keypair.secretKey, 'hex')\n : keypair.secretKey;\n if (!isValidKeypair(secretKey, decode(keypair.publicKey))) {\n throw new InvalidKeypairError('Invalid Key Pair');\n }\n\n secrets.set(this, {\n secretKey,\n publicKey: keypair.publicKey,\n });\n }\n\n async sign(data: string | Uint8Array): Promise<Uint8Array> {\n if (this.isGa) throw new InvalidKeypairError('You are trying to sign data using generalized account without keypair');\n return sign(data, secrets.get(this).secretKey);\n }\n\n async signTransaction(\n tx: Encoded.Transaction,\n options: Parameters<AccountBase['signTransaction']>[1] = {},\n ): Promise<Encoded.Transaction> {\n if (!this.isGa || options.innerTx === true) return super.signTransaction(tx, options);\n const {\n authData, authFun, onCompiler, onNode,\n } = options;\n if (authFun == null || authData == null || onCompiler == null || onNode == null) {\n throw new ArgumentError('authData, authFun, onCompiler, onNode', 'provided', null);\n }\n return createMetaTx(tx, authData, authFun, { onCompiler, onNode, onAccount: this });\n }\n\n async address(): Promise<Encoded.AccountAddress> {\n return secrets.get(this).publicKey;\n }\n}\n","import * as coreClient from \"@azure/core-client\";\n\nexport const Contract: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Contract\",\n modelProperties: {\n code: {\n serializedName: \"code\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n options: {\n serializedName: \"options\",\n type: {\n name: \"Composite\",\n className: \"CompileOpts\"\n }\n }\n }\n }\n};\n\nexport const CompileOpts: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CompileOpts\",\n modelProperties: {\n backend: {\n serializedName: \"backend\",\n type: {\n name: \"String\"\n }\n },\n fileSystem: {\n serializedName: \"file_system\",\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n },\n srcFile: {\n serializedName: \"src_file\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const Aci: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Aci\",\n modelProperties: {\n encodedAci: {\n serializedName: \"encoded_aci\",\n required: true,\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n },\n externalEncodedAci: {\n serializedName: \"external_encoded_aci\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n }\n }\n },\n interface: {\n serializedName: \"interface\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const CompilerError: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CompilerError\",\n modelProperties: {\n context: {\n serializedName: \"context\",\n type: {\n name: \"String\"\n }\n },\n message: {\n serializedName: \"message\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n pos: {\n serializedName: \"pos\",\n type: {\n name: \"Composite\",\n className: \"ErrorPos\"\n }\n },\n type: {\n serializedName: \"type\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ErrorPos: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ErrorPos\",\n modelProperties: {\n col: {\n serializedName: \"col\",\n required: true,\n type: {\n name: \"Number\"\n }\n },\n file: {\n serializedName: \"file\",\n type: {\n name: \"String\"\n }\n },\n line: {\n serializedName: \"line\",\n required: true,\n type: {\n name: \"Number\"\n }\n }\n }\n }\n};\n\nexport const ErrorModel: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ErrorModel\",\n modelProperties: {\n reason: {\n serializedName: \"reason\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const APIVersion: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"APIVersion\",\n modelProperties: {\n apiVersion: {\n serializedName: \"api-version\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ByteCode: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ByteCode\",\n modelProperties: {\n bytecode: {\n serializedName: \"bytecode\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ByteCodeInput: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ByteCodeInput\",\n modelProperties: {\n bytecode: {\n serializedName: \"bytecode\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const CompilerVersion: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"CompilerVersion\",\n modelProperties: {\n version: {\n serializedName: \"version\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const SophiaCallResultInput: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"SophiaCallResultInput\",\n modelProperties: {\n callResult: {\n serializedName: \"call-result\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callValue: {\n serializedName: \"call-value\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n function: {\n serializedName: \"function\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n options: {\n serializedName: \"options\",\n type: {\n name: \"Composite\",\n className: \"CompileOpts\"\n }\n },\n source: {\n serializedName: \"source\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const BytecodeCallResultInput: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"BytecodeCallResultInput\",\n modelProperties: {\n backend: {\n serializedName: \"backend\",\n type: {\n name: \"String\"\n }\n },\n bytecode: {\n serializedName: \"bytecode\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callResult: {\n serializedName: \"call-result\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n callValue: {\n serializedName: \"call-value\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n function: {\n serializedName: \"function\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const DecodedCallresult: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DecodedCallresult\",\n modelProperties: {\n function: {\n serializedName: \"function\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n result: {\n serializedName: \"result\",\n required: true,\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n }\n }\n }\n};\n\nexport const DecodeCalldataBytecode: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DecodeCalldataBytecode\",\n modelProperties: {\n backend: {\n serializedName: \"backend\",\n type: {\n name: \"String\"\n }\n },\n bytecode: {\n serializedName: \"bytecode\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n calldata: {\n serializedName: \"calldata\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const DecodedCalldata: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DecodedCalldata\",\n modelProperties: {\n arguments: {\n serializedName: \"arguments\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n }\n }\n },\n function: {\n serializedName: \"function\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const DecodeCalldataSource: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"DecodeCalldataSource\",\n modelProperties: {\n calldata: {\n serializedName: \"calldata\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n function: {\n serializedName: \"function\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n options: {\n serializedName: \"options\",\n type: {\n name: \"Composite\",\n className: \"CompileOpts\"\n }\n },\n source: {\n serializedName: \"source\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const SophiaBinaryData: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"SophiaBinaryData\",\n modelProperties: {\n data: {\n serializedName: \"data\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n sophiaType: {\n serializedName: \"sophia-type\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const SophiaJsonData: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"SophiaJsonData\",\n modelProperties: {\n data: {\n serializedName: \"data\",\n required: true,\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"any\" } }\n }\n }\n }\n }\n};\n\nexport const FunctionCallInput: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"FunctionCallInput\",\n modelProperties: {\n arguments: {\n serializedName: \"arguments\",\n required: true,\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n function: {\n serializedName: \"function\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n options: {\n serializedName: \"options\",\n type: {\n name: \"Composite\",\n className: \"CompileOpts\"\n }\n },\n source: {\n serializedName: \"source\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const Calldata: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"Calldata\",\n modelProperties: {\n calldata: {\n serializedName: \"calldata\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const FateAssembler: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"FateAssembler\",\n modelProperties: {\n fateAssembler: {\n serializedName: \"fate-assembler\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nexport const ValidateByteCodeInput: coreClient.CompositeMapper = {\n type: {\n name: \"Composite\",\n className: \"ValidateByteCodeInput\",\n modelProperties: {\n bytecode: {\n serializedName: \"bytecode\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n options: {\n serializedName: \"options\",\n type: {\n name: \"Composite\",\n className: \"CompileOpts\"\n }\n },\n source: {\n serializedName: \"source\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n","import { OperationParameter, OperationURLParameter } from \"@azure/core-client\";\nimport {\n Contract as ContractMapper,\n ByteCodeInput as ByteCodeInputMapper,\n SophiaCallResultInput as SophiaCallResultInputMapper,\n BytecodeCallResultInput as BytecodeCallResultInputMapper,\n DecodeCalldataBytecode as DecodeCalldataBytecodeMapper,\n DecodeCalldataSource as DecodeCalldataSourceMapper,\n SophiaBinaryData as SophiaBinaryDataMapper,\n FunctionCallInput as FunctionCallInputMapper,\n ValidateByteCodeInput as ValidateByteCodeInputMapper\n} from \"../models/mappers\";\n\nexport const contentType: OperationParameter = {\n parameterPath: [\"options\", \"contentType\"],\n mapper: {\n defaultValue: \"application/json\",\n isConstant: true,\n serializedName: \"Content-Type\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const body: OperationParameter = {\n parameterPath: \"body\",\n mapper: ContractMapper\n};\n\nexport const accept: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue: \"application/json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const $host: OperationURLParameter = {\n parameterPath: \"$host\",\n mapper: {\n serializedName: \"$host\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n skipEncoding: true\n};\n\nexport const body1: OperationParameter = {\n parameterPath: \"body\",\n mapper: ByteCodeInputMapper\n};\n\nexport const body2: OperationParameter = {\n parameterPath: \"body\",\n mapper: SophiaCallResultInputMapper\n};\n\nexport const body3: OperationParameter = {\n parameterPath: \"body\",\n mapper: BytecodeCallResultInputMapper\n};\n\nexport const body4: OperationParameter = {\n parameterPath: \"body\",\n mapper: DecodeCalldataBytecodeMapper\n};\n\nexport const body5: OperationParameter = {\n parameterPath: \"body\",\n mapper: DecodeCalldataSourceMapper\n};\n\nexport const body6: OperationParameter = {\n parameterPath: \"body\",\n mapper: SophiaBinaryDataMapper\n};\n\nexport const body7: OperationParameter = {\n parameterPath: \"body\",\n mapper: FunctionCallInputMapper\n};\n\nexport const body8: OperationParameter = {\n parameterPath: \"body\",\n mapper: ValidateByteCodeInputMapper\n};\n","import * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport * as Parameters from \"./models/parameters\";\nimport * as Mappers from \"./models/mappers\";\nimport {\n CompilerOptionalParams,\n Contract,\n GenerateACIOptionalParams,\n GenerateACIResponse,\n ApiOptionalParams,\n ApiResponse,\n APIVersionOptionalParams,\n APIVersionResponse,\n CompileContractOptionalParams,\n CompileContractResponse,\n ByteCodeInput,\n GetCompilerVersionOptionalParams,\n GetCompilerVersionResponse,\n SophiaCallResultInput,\n DecodeCallResultOptionalParams,\n DecodeCallResultResponse,\n BytecodeCallResultInput,\n DecodeCallResultBytecodeOptionalParams,\n DecodeCallResultBytecodeResponse,\n DecodeCalldataBytecode,\n DecodeCalldataBytecodeOptionalParams,\n DecodeCalldataBytecodeResponse,\n DecodeCalldataSource,\n DecodeCalldataSourceOptionalParams,\n DecodeCalldataSourceResponse,\n SophiaBinaryData,\n DecodeDataOptionalParams,\n DecodeDataResponse,\n FunctionCallInput,\n EncodeCalldataOptionalParams,\n EncodeCalldataResponse,\n GetFateAssemblerCodeOptionalParams,\n GetFateAssemblerCodeResponse,\n ValidateByteCodeInput,\n ValidateByteCodeOptionalParams,\n VersionOptionalParams,\n VersionResponse\n} from \"./models\";\n\nexport class Compiler extends coreClient.ServiceClient {\n $host: string;\n\n /**\n * Initializes a new instance of the Compiler class.\n * @param $host server parameter\n * @param options The parameter options\n */\n constructor($host: string, options?: CompilerOptionalParams) {\n if ($host === undefined) {\n throw new Error(\"'$host' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: CompilerOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-compiler/1.0.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n baseUri: options.endpoint ?? options.baseUri ?? \"{$host}\"\n };\n super(optionsWithDefaults);\n\n if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();\n const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(\n (pipelinePolicy) =>\n pipelinePolicy.name ===\n coreRestPipeline.bearerTokenAuthenticationPolicyName\n );\n if (!bearerTokenAuthenticationPolicyFound) {\n this.pipeline.removePolicy({\n name: coreRestPipeline.bearerTokenAuthenticationPolicyName\n });\n this.pipeline.addPolicy(\n coreRestPipeline.bearerTokenAuthenticationPolicy({\n scopes: `${optionsWithDefaults.baseUri}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge:\n coreClient.authorizeRequestOnClaimChallenge\n }\n })\n );\n }\n }\n // Parameter assignments\n this.$host = $host;\n }\n\n /**\n * Generate an Aeternity Contract Interface (ACI) for contract\n * @param body contract code\n * @param options The options parameters.\n */\n generateACI(\n body: Contract,\n options?: GenerateACIOptionalParams\n ): Promise<GenerateACIResponse> {\n return this.sendOperationRequest(\n { body, options },\n generateACIOperationSpec\n );\n }\n\n /**\n * Get the Api description\n * @param options The options parameters.\n */\n api(options?: ApiOptionalParams): Promise<ApiResponse> {\n return this.sendOperationRequest({ options }, apiOperationSpec);\n }\n\n /**\n * Get the version of the API\n * @param options The options parameters.\n */\n aPIVersion(options?: APIVersionOptionalParams): Promise<APIVersionResponse> {\n return this.sendOperationRequest({ options }, aPIVersionOperationSpec);\n }\n\n /**\n * Compile a sophia contract from source and return byte code\n * @param body contract code\n * @param options The options parameters.\n */\n compileContract(\n body: Contract,\n options?: CompileContractOptionalParams\n ): Promise<CompileContractResponse> {\n return this.sendOperationRequest(\n { body, options },\n compileContractOperationSpec\n );\n }\n\n /**\n * Extract compiler version from bytecode\n * @param body contract byte array\n * @param options The options parameters.\n */\n getCompilerVersion(\n body: ByteCodeInput,\n options?: GetCompilerVersionOptionalParams\n ): Promise<GetCompilerVersionResponse> {\n return this.sendOperationRequest(\n { body, options },\n getCompilerVersionOperationSpec\n );\n }\n\n /**\n * Decode the result of contract call\n * @param body Binary data in Sophia ABI format\n * @param options The options parameters.\n */\n decodeCallResult(\n body: SophiaCallResultInput,\n options?: DecodeCallResultOptionalParams\n ): Promise<DecodeCallResultResponse> {\n return this.sendOperationRequest(\n { body, options },\n decodeCallResultOperationSpec\n );\n }\n\n /**\n * Decode the result of contract call from Bytecode\n * @param body Call result + compiled contract\n * @param options The options parameters.\n */\n decodeCallResultBytecode(\n body: BytecodeCallResultInput,\n options?: DecodeCallResultBytecodeOptionalParams\n ): Promise<DecodeCallResultBytecodeResponse> {\n return this.sendOperationRequest(\n { body, options },\n decodeCallResultBytecodeOperationSpec\n );\n }\n\n /**\n * Identify function name and arguments in Calldata for a compiled contract\n * @param body Calldata + compiled contract\n * @param options The options parameters.\n */\n decodeCalldataBytecode(\n body: DecodeCalldataBytecode,\n options?: DecodeCalldataBytecodeOptionalParams\n ): Promise<DecodeCalldataBytecodeResponse> {\n return this.sendOperationRequest(\n { body, options },\n decodeCalldataBytecodeOperationSpec\n );\n }\n\n /**\n * Identify function name and arguments in Calldata for a (partial) contract\n * @param body Calldata + contract (stub) code\n * @param options The options parameters.\n */\n decodeCalldataSource(\n body: DecodeCalldataSource,\n options?: DecodeCalldataSourceOptionalParams\n ): Promise<DecodeCalldataSourceResponse> {\n return this.sendOperationRequest(\n { body, options },\n decodeCalldataSourceOperationSpec\n );\n }\n\n /**\n * Decode data as retuned by a contract call. - Legacy decoding\n * @param body Binary data in Sophia ABI format\n * @param options The options parameters.\n */\n decodeData(\n body: SophiaBinaryData,\n options?: DecodeDataOptionalParams\n ): Promise<DecodeDataResponse> {\n return this.sendOperationRequest(\n { body, options },\n decodeDataOperationSpec\n );\n }\n\n /**\n * Encode Sophia function call according to sophia ABI.\n * @param body Sophia function call - contract code + function name + arguments\n * @param options The options parameters.\n */\n encodeCalldata(\n body: FunctionCallInput,\n options?: EncodeCalldataOptionalParams\n ): Promise<EncodeCalldataResponse> {\n return this.sendOperationRequest(\n { body, options },\n encodeCalldataOperationSpec\n );\n }\n\n /**\n * Get FATE assembler code from bytecode\n * @param body contract byte array\n * @param options The options parameters.\n */\n getFateAssemblerCode(\n body: ByteCodeInput,\n options?: GetFateAssemblerCodeOptionalParams\n ): Promise<GetFateAssemblerCodeResponse> {\n return this.sendOperationRequest(\n { body, options },\n getFateAssemblerCodeOperationSpec\n );\n }\n\n /**\n * Verify that an encoded byte array is the result of compiling a given contract\n * @param body contract byte array and source code\n * @param options The options parameters.\n */\n validateByteCode(\n body: ValidateByteCodeInput,\n options?: ValidateByteCodeOptionalParams\n ): Promise<void> {\n return this.sendOperationRequest(\n { body, options },\n validateByteCodeOperationSpec\n );\n }\n\n /**\n * Get the version of the underlying Sophia compiler version\n * @param options The options parameters.\n */\n version(options?: VersionOptionalParams): Promise<VersionResponse> {\n return this.sendOperationRequest({ options }, versionOperationSpec);\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst generateACIOperationSpec: coreClient.OperationSpec = {\n path: \"/aci\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.Aci\n },\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } }\n }\n },\n isError: true\n }\n },\n requestBody: Parameters.body,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst apiOperationSpec: coreClient.OperationSpec = {\n path: \"/api\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: {\n type: { name: \"Dictionary\", value: { type: { name: \"any\" } } }\n }\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst aPIVersionOperationSpec: coreClient.OperationSpec = {\n path: \"/api-version\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.APIVersion\n },\n 500: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst compileContractOperationSpec: coreClient.OperationSpec = {\n path: \"/compile\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.ByteCode\n },\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } }\n }\n },\n isError: true\n }\n },\n requestBody: Parameters.body,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst getCompilerVersionOperationSpec: coreClient.OperationSpec = {\n path: \"/compiler-version\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.CompilerVersion\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n requestBody: Parameters.body1,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst decodeCallResultOperationSpec: coreClient.OperationSpec = {\n path: \"/decode-call-result\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: { type: { name: \"any\" } }\n },\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } }\n }\n },\n isError: true\n }\n },\n requestBody: Parameters.body2,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst decodeCallResultBytecodeOperationSpec: coreClient.OperationSpec = {\n path: \"/decode-call-result/bytecode\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.DecodedCallresult\n },\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } }\n }\n },\n isError: true\n }\n },\n requestBody: Parameters.body3,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst decodeCalldataBytecodeOperationSpec: coreClient.OperationSpec = {\n path: \"/decode-calldata/bytecode\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.DecodedCalldata\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n requestBody: Parameters.body4,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst decodeCalldataSourceOperationSpec: coreClient.OperationSpec = {\n path: \"/decode-calldata/source\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.DecodedCalldata\n },\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } }\n }\n },\n isError: true\n }\n },\n requestBody: Parameters.body5,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst decodeDataOperationSpec: coreClient.OperationSpec = {\n path: \"/decode-data\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.SophiaJsonData\n },\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } }\n }\n },\n isError: true\n }\n },\n requestBody: Parameters.body6,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst encodeCalldataOperationSpec: coreClient.OperationSpec = {\n path: \"/encode-calldata\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.Calldata\n },\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } }\n }\n },\n isError: true\n }\n },\n requestBody: Parameters.body7,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst getFateAssemblerCodeOperationSpec: coreClient.OperationSpec = {\n path: \"/fate-assembler\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.FateAssembler\n },\n 400: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n requestBody: Parameters.body1,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst validateByteCodeOperationSpec: coreClient.OperationSpec = {\n path: \"/validate-byte-code\",\n httpMethod: \"POST\",\n responses: {\n 200: {},\n 400: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: { type: { name: \"Composite\", className: \"CompilerError\" } }\n }\n },\n isError: true\n }\n },\n requestBody: Parameters.body8,\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst versionOperationSpec: coreClient.OperationSpec = {\n path: \"/version\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.CompilerVersion\n },\n 500: {\n bodyMapper: Mappers.ErrorModel,\n isError: true\n }\n },\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport { Compiler as CompilerApi, ErrorModel, CompilerError } from '../apis/compiler';\nimport { genErrorFormatterPolicy, genVersionCheckPolicy } from '../utils/autorest';\n\ntype GeneralCompilerError = ErrorModel & {\n info?: object;\n parameter?: string;\n};\n\n/**\n * Contract Compiler\n *\n * This class include api call's related to contract compiler functionality.\n * @category contract\n * @example Compiler('COMPILER_URL')\n */\nexport default class Compiler extends CompilerApi {\n /**\n * @param compilerUrl - Url for compiler API\n * @param options - Options\n * @param options.ignoreVersion - Don't check compiler version\n */\n constructor(compilerUrl: string, { ignoreVersion }: { ignoreVersion?: boolean } = {}) {\n super(compilerUrl, {\n allowInsecureConnection: true,\n additionalPolicies: [\n genErrorFormatterPolicy((body: GeneralCompilerError | CompilerError[]) => {\n let message = '';\n if ('reason' in body) {\n message += ` ${body.reason\n }${body.parameter != null ? ` in ${body.parameter}` : ''\n // TODO: revising after improving documentation https://github.com/aeternity/aesophia_http/issues/78\n }${body.info != null ? ` (${JSON.stringify(body.info)})` : ''}`;\n }\n if (Array.isArray(body)) {\n message += `\\n${body\n .map((e) => `${e.type}:${e.pos.line}:${e.pos.col}: ${e.message}${e.context != null ? `(${e.context})` : ''}`)\n .map((e) => e.trim()) // TODO: remove after fixing https://github.com/aeternity/aesophia_http/issues/80\n .join('\\n')}`;\n }\n return message;\n }),\n ],\n });\n if (ignoreVersion !== true) {\n const versionPromise = this.aPIVersion().then(({ apiVersion }) => apiVersion);\n this.pipeline.addPolicy(\n genVersionCheckPolicy('compiler', '/api-version', versionPromise, '6.1.0', '7.0.0'),\n );\n }\n }\n}\n","import * as chainMethods from './chain';\nimport * as txMethods from './tx';\nimport * as aensMethods from './aens';\nimport * as spendMethods from './spend';\nimport * as oracleMethods from './oracle';\nimport * as contractMethods from './contract/methods';\nimport * as contractGaMethods from './contract/ga';\nimport * as deprecatedMethods from './deprecated/methods';\nimport { _buildTx } from './tx';\nimport { mapObject } from './utils/other';\nimport Node, { getNetworkId } from './Node';\nimport { AE_AMOUNT_FORMATS } from './utils/amount-formatter';\nimport { AMOUNT } from './tx/builder/schema';\nimport { Tag } from './tx/builder/constants';\nimport MemoryAccount, { Keypair } from './account/Memory';\nimport AccountBase, { isAccountBase } from './account/Base';\nimport {\n CompilerError,\n DuplicateNodeError,\n NodeNotFoundError,\n NotImplementedError,\n TypeError,\n} from './utils/errors';\nimport { Encoded } from './utils/encoder';\nimport Compiler from './contract/Compiler';\n\nexport type Account = Keypair | AccountBase | any;\n\ntype NodeInfo = Awaited<ReturnType<Node['getNodeInfo']>> & { name: string };\n\nfunction getValueOrErrorProxy<Value extends object>(valueCb: () => Value): Value {\n try {\n return valueCb();\n } catch (error) {\n return new Proxy(\n {},\n Object.fromEntries(['get', 'set', 'has'].map((name) => [name, () => { throw error; }])),\n ) as Value;\n }\n}\n\n/**\n * Basic AeSdk class\n *\n * AeSdkBase objects are the composition of:\n * - chain methods\n * - tx methods\n * - aens methods\n * - spend methods\n * - oracle methods\n * - contract methods\n * - contract ga methods\n * Only by providing the joint functionality of them, most more advanced\n * operations, i.e. the ones with actual use value on the chain, become\n * available.\n */\nclass AeSdkBase {\n _options: {\n denomination: AE_AMOUNT_FORMATS;\n amount: number;\n [key: string]: any;\n } = { denomination: AE_AMOUNT_FORMATS.AETTOS, amount: AMOUNT };\n\n pool: Map<string, Node> = new Map();\n\n selectedNodeName?: string;\n\n compilerApi: Compiler;\n\n /**\n * @param options - Options\n * @param options.nodes - Array of nodes\n * @param options.compilerUrl - Url for compiler API\n * @param options.ignoreVersion - Don't check node or compiler version\n */\n constructor(\n {\n nodes = [], compilerUrl, ignoreVersion = false, ...options\n }:\n {\n nodes?: Array<{ name: string; instance: Node }>;\n compilerUrl?: string;\n ignoreVersion?: boolean;\n [key: string]: any; // TODO: consider combining all possible options instead\n } = {},\n ) {\n Object.assign(this._options, options);\n\n nodes.forEach(({ name, instance }, i) => this.addNode(name, instance, i === 0));\n\n if (compilerUrl == null) {\n this.compilerApi = getValueOrErrorProxy(() => {\n throw new CompilerError('You can\\'t use Compiler API. Compiler is not ready!');\n });\n } else this.setCompilerUrl(compilerUrl, { ignoreVersion });\n }\n\n setCompilerUrl(\n compilerUrl: string,\n { ignoreVersion = false }: { ignoreVersion?: boolean } = {},\n ): void {\n this.compilerApi = new Compiler(compilerUrl, { ignoreVersion });\n }\n\n get api(): Node {\n this.ensureNodeConnected();\n return this.pool.get(this.selectedNodeName) as Node;\n }\n\n /**\n * Add Node\n * @param name - Node name\n * @param node - Node instance\n * @param select - Select this node as current\n * @example\n * ```js\n * // add and select new node with name 'testNode'\n * aeSdkBase.addNode('testNode', new Node({ url }), true)\n * ```\n */\n addNode(name: string, node: Node, select = false): void {\n if (this.pool.has(name)) throw new DuplicateNodeError(name);\n\n this.pool.set(name, node);\n if (select || this.selectedNodeName == null) {\n this.selectNode(name);\n }\n }\n\n /**\n * Select Node\n * @param name - Node name\n * @example\n * nodePool.selectNode('testNode')\n */\n selectNode(name: string): void {\n if (!this.pool.has(name)) throw new NodeNotFoundError(`Node with name ${name} not in pool`);\n this.selectedNodeName = name;\n }\n\n /**\n * Get NetworkId of current Node\n * @example\n * nodePool.getNetworkId()\n */\n readonly getNetworkId = getNetworkId;\n\n /**\n * Check if you have selected node\n * @example\n * nodePool.isNodeConnected()\n */\n isNodeConnected(): this is AeSdkBase & { selectedNodeName: string } {\n return this.selectedNodeName != null;\n }\n\n protected ensureNodeConnected(): asserts this is AeSdkBase & { selectedNodeName: string } {\n if (!this.isNodeConnected()) {\n throw new NodeNotFoundError('You can\\'t use Node API. Node is not connected or not defined!');\n }\n }\n\n /**\n * Get information about node\n * @example\n * ```js\n * nodePool.getNodeInfo() // { name, version, networkId, protocol, ... }\n * ```\n */\n async getNodeInfo(): Promise<NodeInfo> {\n this.ensureNodeConnected();\n return {\n name: this.selectedNodeName,\n ...await this.api.getNodeInfo(),\n };\n }\n\n /**\n * Get array of available nodes\n * @example\n * nodePool.getNodesInPool()\n */\n async getNodesInPool(): Promise<NodeInfo[]> {\n return Promise.all(\n Array.from(this.pool.entries()).map(async ([name, node]) => ({\n name,\n ...await node.getNodeInfo(),\n })),\n );\n }\n\n // eslint-disable-next-line class-methods-use-this\n addresses(): Encoded.AccountAddress[] {\n return [];\n }\n\n async address({ onAccount }: { onAccount?: Account } = {}): Promise<Encoded.AccountAddress> {\n return this._resolveAccount(onAccount).address();\n }\n\n async sign(\n data: string | Uint8Array,\n { onAccount, ...options }: { onAccount?: Account } = {},\n ): Promise<Uint8Array> {\n return this._resolveAccount(onAccount).sign(data, options);\n }\n\n async signTransaction(\n tx: Encoded.Transaction,\n { onAccount, ...options }: { onAccount?: Account } & Parameters<AccountBase['signTransaction']>[1] = {},\n ): Promise<Encoded.Transaction> {\n return this._resolveAccount(onAccount)\n .signTransaction(tx, { ...options, networkId: await this.getNetworkId(options) });\n }\n\n async signMessage(\n message: string,\n { onAccount, ...options }: { onAccount?: Account } & Parameters<AccountBase['signMessage']>[1] = {},\n ): Promise<string | Uint8Array> {\n return this._resolveAccount(onAccount).signMessage(message, options);\n }\n\n async verifyMessage(\n message: string,\n signature: string | Uint8Array,\n { onAccount, ...options }: { onAccount?: Account } & Parameters<AccountBase['verifyMessage']>[2] = {},\n ): Promise<boolean> {\n return this._resolveAccount(onAccount).verifyMessage(message, signature, options);\n }\n\n /**\n * Resolves an account\n * @param account - ak-address, instance of AccountBase, or keypair\n */\n // eslint-disable-next-line class-methods-use-this\n _resolveAccount(account?: Account): AccountBase {\n switch (account !== null && typeof account) {\n case 'string':\n throw new NotImplementedError('Address in AccountResolver');\n case 'object':\n return isAccountBase(account) ? account : new MemoryAccount({ keypair: account });\n default:\n throw new TypeError(\n 'Account should be an address (ak-prefixed string), '\n + `keypair, or instance of AccountBase, got ${String(account)} instead`,\n );\n }\n }\n\n _getOptions(): {\n onNode: Node;\n onAccount: AccountBase;\n onCompiler: Compiler;\n } {\n return {\n ...this._options,\n onNode: getValueOrErrorProxy(() => this.api),\n onAccount: getValueOrErrorProxy(() => this._resolveAccount()),\n onCompiler: getValueOrErrorProxy(() => this.compilerApi),\n };\n }\n\n async buildTx<TxType extends Tag>(\n txType: TxType,\n options: Omit<Parameters<typeof _buildTx<TxType>>[1], 'onNode'> & { onNode?: Node },\n ): Promise<Encoded.Transaction> {\n // @ts-expect-error TODO: need to figure out what's wrong here\n return _buildTx<TxType>(txType, {\n ...this._getOptions(),\n ...options,\n });\n }\n}\n\nconst { _buildTx: _, ...txMethodsOther } = txMethods;\nconst { InvalidTxError: _2, ...chainMethodsOther } = chainMethods;\n\nconst methods = {\n ...chainMethodsOther,\n ...txMethodsOther,\n ...aensMethods,\n ...spendMethods,\n ...oracleMethods,\n ...contractMethods,\n ...contractGaMethods,\n ...deprecatedMethods,\n} as const;\n\ntype RequiredKeys<T> = {\n [K in keyof T]-?: {} extends Pick<T, K> ? never : K\n}[keyof T];\n\ntype OptionalIfNotRequired<T extends [any]> = RequiredKeys<T[0]> extends never ? T | [] : T;\n\ntype MakeOptional<Args extends any[]> = Args extends [infer Head, ...infer Tail]\n ? Tail extends []\n ? Head extends object\n ? OptionalIfNotRequired<[Omit<Head, 'onNode' | 'onCompiler' | 'onAccount'>\n & {\n onNode?: Node;\n onCompiler?: Compiler;\n onAccount?: AccountBase | Encoded.AccountAddress | Keypair;\n }]>\n : [Head]\n : [Head, ...MakeOptional<Tail>]\n : never;\n\ntype TransformMethods <Methods extends { [key: string]: Function }> =\n {\n [Name in keyof Methods]:\n Methods[Name] extends (...args: infer Args) => infer Ret\n ? (...args: MakeOptional<Args>) => Ret\n : never\n };\n\ninterface AeSdkBaseMethods extends TransformMethods<typeof methods> {}\n\nObject.assign(AeSdkBase.prototype, mapObject<Function, Function>(\n methods,\n ([name, handler]) => [\n name,\n function methodWrapper(...args: any[]) {\n const instanceOptions = this._getOptions();\n const lastArg = args[args.length - 1];\n if (lastArg != null && typeof lastArg === 'object' && lastArg.constructor === Object) {\n args[args.length - 1] = {\n ...instanceOptions,\n ...lastArg,\n ...lastArg.onAccount != null && { onAccount: this._resolveAccount(lastArg.onAccount) },\n };\n } else args.push(instanceOptions);\n return handler(...args);\n },\n ],\n));\n\nexport default AeSdkBase as new (options?: ConstructorParameters<typeof AeSdkBase>[0]) =>\nAeSdkBase & AeSdkBaseMethods;\n","import AeSdkBase, { Account } from './AeSdkBase';\nimport AccountBase from './account/Base';\nimport { decode, Encoded } from './utils/encoder';\nimport { UnavailableAccountError } from './utils/errors';\n\nexport default class AeSdk extends AeSdkBase {\n accounts: { [key: Encoded.AccountAddress]: AccountBase } = {};\n\n selectedAddress?: Encoded.AccountAddress;\n\n _resolveAccount(\n account: Account | Encoded.AccountAddress = this.selectedAddress,\n ): AccountBase {\n if (typeof account === 'string') {\n const address = account as Encoded.AccountAddress;\n decode(address);\n if (this.accounts[address] == null) throw new UnavailableAccountError(account);\n account = this.accounts[address];\n }\n return super._resolveAccount(account);\n }\n\n /**\n * Get accounts addresses\n * @example addresses()\n */\n addresses(): Encoded.AccountAddress[] {\n return Object.keys(this.accounts) as Encoded.AccountAddress[];\n }\n\n /**\n * Add specific account\n * @param account - Account instance\n * @param options - Options\n * @param options.select - Select account\n * @example addAccount(account)\n */\n async addAccount(account: AccountBase, { select }: { select?: boolean } = {}): Promise<void> {\n const address = await account.address();\n this.accounts[address] = account;\n if (select === true) this.selectAccount(address);\n }\n\n /**\n * Remove specific account\n * @param address - Address of account to remove\n * @example removeAccount(address)\n */\n removeAccount(address: Encoded.AccountAddress): void {\n if (this.accounts[address] == null) {\n console.warn(`removeAccount: Account for ${address} not available`);\n return;\n }\n delete this.accounts[address]; // eslint-disable-line @typescript-eslint/no-dynamic-delete\n if (this.selectedAddress === address) delete this.selectedAddress;\n }\n\n /**\n * Select specific account\n * @param address - Address of account to select\n * @example selectAccount('ak_xxxxxxxx')\n */\n selectAccount(address: Encoded.AccountAddress): void {\n decode(address);\n if (this.accounts[address] == null) throw new UnavailableAccountError(address);\n this.selectedAddress = address;\n }\n}\n","// eslint-disable-next-line max-classes-per-file\nimport { Encoded } from '../utils/encoder';\nimport { BaseError, InternalError } from '../utils/errors';\n\n/**\n * @category aepp wallet communication\n */\nexport const enum MESSAGE_DIRECTION {\n to_waellet = 'to_waellet',\n to_aepp = 'to_aepp',\n}\n\n/**\n * @category aepp wallet communication\n */\nexport const enum WALLET_TYPE {\n window = 'window',\n extension = 'extension',\n}\n\n/**\n * @category aepp wallet communication\n */\nexport const enum SUBSCRIPTION_TYPES {\n subscribe = 'subscribe',\n unsubscribe = 'unsubscribe',\n}\n\n/**\n * @category aepp wallet communication\n */\nexport const enum METHODS {\n readyToConnect = 'connection.announcePresence',\n updateAddress = 'address.update',\n address = 'address.get',\n connect = 'connection.open',\n sign = 'transaction.sign',\n signMessage = 'message.sign',\n subscribeAddress = 'address.subscribe',\n updateNetwork = 'networkId.update',\n closeConnection = 'connection.close',\n}\n\n/**\n * @category aepp wallet communication\n */\nexport const enum RPC_STATUS {\n CONNECTED = 'CONNECTED',\n DISCONNECTED = 'DISCONNECTED',\n WAITING_FOR_CONNECTION_REQUEST = 'WAITING_FOR_CONNECTION_REQUEST',\n}\n\ninterface RpcErrorAsJson {\n code: number;\n message: string;\n data?: any;\n}\n\nconst rpcErrors: Array<(new (data?: any) => RpcError) & { code: number }> = [];\n\n/**\n * @category exception\n */\nexport abstract class RpcError extends BaseError {\n static code: number;\n\n code: number;\n\n data?: any;\n\n toJSON(): RpcErrorAsJson {\n return {\n code: this.code,\n message: this.message,\n data: this.data,\n };\n }\n\n static deserialize(json: RpcErrorAsJson): RpcError {\n const RpcErr = rpcErrors.find((cl) => cl.code === json.code);\n if (RpcErr == null) throw new InternalError(`Can't find RpcError with code: ${json.code}`);\n return new RpcErr(json.data);\n }\n}\n\n/**\n * @category exception\n */\nexport class RpcInvalidTransactionError extends RpcError {\n static code = 2;\n\n code = 2;\n\n constructor(data?: any) {\n super('Invalid transaction');\n this.data = data;\n this.name = 'RpcInvalidTransactionError';\n }\n}\nrpcErrors.push(RpcInvalidTransactionError);\n\n/**\n * @category exception\n */\nexport class RpcBroadcastError extends RpcError {\n static code = 3;\n\n code = 3;\n\n constructor(data?: any) {\n super('Broadcast failed');\n this.data = data;\n this.name = 'RpcBroadcastError';\n }\n}\nrpcErrors.push(RpcBroadcastError);\n\n/**\n * @category exception\n */\nexport class RpcRejectedByUserError extends RpcError {\n static code = 4;\n\n code = 4;\n\n constructor(data?: any) {\n super('Operation rejected by user');\n this.data = data;\n this.name = 'RpcRejectedByUserError';\n }\n}\nrpcErrors.push(RpcRejectedByUserError);\n\n/**\n * @category exception\n */\nexport class RpcUnsupportedProtocolError extends RpcError {\n static code = 5;\n\n code = 5;\n\n constructor() {\n super('Unsupported Protocol Version');\n this.name = 'RpcUnsupportedProtocolError';\n }\n}\nrpcErrors.push(RpcUnsupportedProtocolError);\n\n/**\n * @category exception\n */\nexport class RpcConnectionDenyError extends RpcError {\n static code = 9;\n\n code = 9;\n\n constructor(data?: any) {\n super('Wallet deny your connection request');\n this.data = data;\n this.name = 'RpcConnectionDenyError';\n }\n}\nrpcErrors.push(RpcConnectionDenyError);\n\n/**\n * @category exception\n */\nexport class RpcNotAuthorizeError extends RpcError {\n static code = 10;\n\n code = 10;\n\n constructor() {\n super('You are not connected to the wallet');\n this.name = 'RpcNotAuthorizeError';\n }\n}\nrpcErrors.push(RpcNotAuthorizeError);\n\n/**\n * @category exception\n */\nexport class RpcPermissionDenyError extends RpcError {\n static code = 11;\n\n code = 11;\n\n constructor(address: Encoded.AccountAddress) {\n super(`You are not subscribed for account ${address}`);\n this.data = address;\n this.name = 'RpcPermissionDenyError';\n }\n}\nrpcErrors.push(RpcPermissionDenyError);\n\n/**\n * @category exception\n */\nexport class RpcInternalError extends RpcError {\n static code = 12;\n\n code = 12;\n\n constructor() {\n super('The peer failed to execute your request due to unknown error');\n this.name = 'RpcInternalError';\n }\n}\nrpcErrors.push(RpcInternalError);\n\n/**\n * @category exception\n */\nexport class RpcMethodNotFoundError extends RpcError {\n static code = -32601;\n\n code = -32601;\n\n constructor() {\n super('Method not found');\n this.name = 'RpcMethodNotFoundError';\n }\n}\nrpcErrors.push(RpcMethodNotFoundError);\n","import AccountBase from './Base';\nimport { METHODS } from '../aepp-wallet-communication/schema';\nimport { NotImplementedError } from '../utils/errors';\nimport { Encoded } from '../utils/encoder';\n\n/**\n * Account provided by wallet\n * @param params - Params\n * @param params.rpcClient - RpcClient instance\n * @param params.address - RPC account address\n * @returns AccountRpc instance\n */\nexport default class AccountRpc extends AccountBase {\n _rpcClient: any;\n\n _address: Encoded.AccountAddress;\n\n constructor(\n { rpcClient, address, ...options }: { rpcClient: any; address: Encoded.AccountAddress }\n & ConstructorParameters<typeof AccountBase>[0],\n ) {\n super(options);\n this._rpcClient = rpcClient;\n this._address = address;\n }\n\n // eslint-disable-next-line class-methods-use-this\n async sign(): Promise<Uint8Array> {\n throw new NotImplementedError('RAW signing using wallet');\n }\n\n async address(): Promise<Encoded.AccountAddress> {\n return this._address;\n }\n\n /**\n * @returns Signed transaction\n */\n async signTransaction(\n tx: Encoded.Transaction,\n { innerTx, networkId }: Parameters<AccountBase['signTransaction']>[1] = {},\n ): Promise<Encoded.Transaction> {\n if (innerTx != null) throw new NotImplementedError('innerTx option in AccountRpc');\n const res = await this._rpcClient.request(METHODS.sign, {\n onAccount: this._address,\n tx,\n returnSigned: true,\n /**\n * @deprecated Wallet provided networkId will be used (current network)\n * required to maintain backward compatibility with wallets using SDK v11.0.1 and below\n * @see {@link https://github.com/aeternity/aepp-sdk-js/commit/153fd89a52c4eab39fcd659b356b36d32129c1ba}\n */\n networkId,\n });\n return res.signedTransaction;\n }\n\n /**\n * @returns Signed message\n */\n async signMessage(\n message: string,\n { returnHex = false }: Parameters<AccountBase['signMessage']>[1] = {},\n ): Promise<string | Uint8Array> {\n const { signature } = await this._rpcClient\n .request(METHODS.signMessage, { onAccount: this._address, message });\n return returnHex ? signature : Buffer.from(signature, 'hex');\n }\n}\n","export default function _classExtractFieldDescriptor(receiver, privateMap, action) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to \" + action + \" private field on non-instance\");\n }\n\n return privateMap.get(receiver);\n}","import classApplyDescriptorGet from \"./classApplyDescriptorGet.js\";\nimport classExtractFieldDescriptor from \"./classExtractFieldDescriptor.js\";\nexport default function _classPrivateFieldGet(receiver, privateMap) {\n var descriptor = classExtractFieldDescriptor(receiver, privateMap, \"get\");\n return classApplyDescriptorGet(receiver, descriptor);\n}","export default function _classApplyDescriptorGet(receiver, descriptor) {\n if (descriptor.get) {\n return descriptor.get.call(receiver);\n }\n\n return descriptor.value;\n}","import classApplyDescriptorSet from \"./classApplyDescriptorSet.js\";\nimport classExtractFieldDescriptor from \"./classExtractFieldDescriptor.js\";\nexport default function _classPrivateFieldSet(receiver, privateMap, value) {\n var descriptor = classExtractFieldDescriptor(receiver, privateMap, \"set\");\n classApplyDescriptorSet(receiver, descriptor, value);\n return value;\n}","export default function _classApplyDescriptorSet(receiver, descriptor, value) {\n if (descriptor.set) {\n descriptor.set.call(receiver, value);\n } else {\n if (!descriptor.writable) {\n throw new TypeError(\"attempted to set read only private field\");\n }\n\n descriptor.value = value;\n }\n}","import { RpcError, RpcInternalError, RpcMethodNotFoundError } from '../schema';\nimport BrowserConnection from '../connection/Browser';\nimport { InvalidRpcMessageError, MissingCallbackError } from '../../utils/errors';\n\ninterface JsonRpcRequest {\n jsonrpc: '2.0';\n id: number;\n method: string;\n params?: any;\n}\n\ninterface JsonRpcResponse {\n jsonrpc: '2.0';\n id: number;\n method: string;\n result?: any;\n error?: {\n code: number;\n message: string;\n data?: any;\n };\n}\n\ntype RpcApiHandler = (p?: any) => any | undefined;\ntype RpcApi<Api> = { [k in keyof Api]: RpcApiHandler };\ntype WithOrigin<Api extends RpcApi<Api>> = {\n [k in keyof Api]: (p: Parameters<Api[k]>[0], origin: string) => ReturnType<Api[k]>\n};\n\n/**\n * Contain functionality for using RPC conection\n * @category aepp wallet communication\n * @param connection - Connection object\n * @param onDisconnect - Disconnect callback\n * @param methods - Object containing handlers for each request by name\n */\nexport default class RpcClient <\n RemoteApi extends RpcApi<RemoteApi>, LocalApi extends RpcApi<LocalApi>,\n> {\n connection: BrowserConnection;\n\n #callbacks = new Map<number, { resolve: (v: any) => void; reject: (e: Error) => void }>();\n\n #messageId = 0;\n\n #methods: WithOrigin<LocalApi>;\n\n constructor(\n connection: BrowserConnection,\n onDisconnect: () => void,\n methods: WithOrigin<LocalApi>,\n ) {\n this.connection = connection;\n this.#methods = methods;\n connection.connect(this.#handleMessage.bind(this), onDisconnect);\n }\n\n async #handleMessage(msg: JsonRpcRequest | JsonRpcResponse, origin: string): Promise<void> {\n if (msg?.jsonrpc !== '2.0') throw new InvalidRpcMessageError(JSON.stringify(msg));\n if ('result' in msg || 'error' in msg) {\n this.#processResponse(msg);\n return;\n }\n\n const request = msg as JsonRpcRequest;\n let result; let\n error;\n try {\n if (!(request.method in this.#methods)) throw new RpcMethodNotFoundError();\n const methodName = request.method as keyof LocalApi;\n result = await this.#methods[methodName](request.params, origin);\n } catch (e) {\n error = e instanceof RpcError ? e : new RpcInternalError();\n }\n if (request.id != null) {\n this.#sendResponse(request.id, request.method as keyof LocalApi, result, error);\n }\n }\n\n #sendRequest(\n id: number | undefined,\n method: keyof RemoteApi | keyof LocalApi,\n params?: any,\n ): void {\n this.connection.sendMessage({\n jsonrpc: '2.0',\n ...id != null ? { id } : {},\n method,\n ...params != null ? { params } : {},\n });\n }\n\n #sendResponse(\n id: number,\n method: keyof RemoteApi | keyof LocalApi, // TODO: remove as far it is not required in JSON RPC\n result?: any,\n error?: any,\n ): void {\n this.connection.sendMessage({\n jsonrpc: '2.0',\n id,\n method,\n ...error != null ? { error } : { result },\n });\n }\n\n /**\n * Make a request\n * @param name - Method name\n * @param params - Method params\n * @returns Promise which will be resolved after receiving response message\n */\n async request<Name extends keyof RemoteApi>(\n name: Name,\n params: Parameters<RemoteApi[Name]>[0],\n ): Promise<ReturnType<RemoteApi[Name]>> {\n this.#sendRequest(this.#messageId += 1, name, params);\n return new Promise((resolve, reject) => {\n this.#callbacks.set(this.#messageId, { resolve, reject });\n });\n }\n\n /**\n * Make a notification\n * @param name - Method name\n * @param params - Method params\n */\n notify<Name extends keyof RemoteApi>(name: Name, params: Parameters<RemoteApi[Name]>[0]): void {\n this.#sendRequest(undefined, name, params);\n }\n\n /**\n * Process response message\n * @param msg - Message object\n */\n #processResponse({ id, error, result }: { id: number; error?: any; result?: any }): void {\n const callbacks = this.#callbacks.get(id);\n if (callbacks == null) throw new MissingCallbackError(id);\n if (error != null) callbacks.reject(RpcError.deserialize(error));\n else callbacks.resolve(result);\n this.#callbacks.delete(id);\n }\n}\n","import AeSdkBase, { Account } from './AeSdkBase';\nimport AccountBase from './account/Base';\nimport AccountRpc from './account/Rpc';\nimport { decode, Encoded } from './utils/encoder';\nimport {\n Accounts, RPC_VERSION, WalletInfo, Network, WalletApi, AeppApi,\n} from './aepp-wallet-communication/rpc/types';\nimport RpcClient from './aepp-wallet-communication/rpc/RpcClient';\nimport { METHODS, SUBSCRIPTION_TYPES } from './aepp-wallet-communication/schema';\nimport {\n AlreadyConnectedError,\n NoWalletConnectedError,\n UnsubscribedAccountError,\n UnAuthorizedAccountError,\n RpcConnectionError,\n} from './utils/errors';\nimport Node from './Node';\nimport BrowserConnection from './aepp-wallet-communication/connection/Browser';\n\n/**\n * RPC handler for AEPP side\n * Contain functionality for wallet interaction and connect it to sdk\n * @category aepp wallet communication\n */\nexport default class AeSdkAepp extends AeSdkBase {\n name: string;\n\n onAddressChange: (a: Accounts) => void;\n\n onDisconnect: (p: any) => void;\n\n onNetworkChange: (a: Network) => void;\n\n rpcClient?: RpcClient<WalletApi, AeppApi>;\n\n _accounts?: Accounts;\n\n /**\n * @param options - Options\n * @param options.name - Aepp name\n * @param options.onAddressChange - Call-back function for update address event\n * @param options.onDisconnect - Call-back function for disconnect event\n * @param options.onNetworkChange - Call-back function for update network event\n */\n constructor({\n name,\n onAddressChange = () => {},\n onDisconnect = () => {},\n onNetworkChange = () => {},\n ...other\n }: {\n name: string;\n onAddressChange: (a: Accounts) => void;\n onDisconnect: (p: any) => void;\n onNetworkChange: (a: Network) => void;\n } & ConstructorParameters<typeof AeSdkBase>[0]) {\n super(other);\n this.onAddressChange = onAddressChange;\n this.onDisconnect = onDisconnect;\n this.onNetworkChange = onNetworkChange;\n this.name = name;\n }\n\n _resolveAccount(account: Account = this.addresses()[0]): AccountBase {\n if (typeof account === 'string') {\n const address = account as Encoded.AccountAddress;\n decode(address);\n if (!this.addresses().includes(address)) throw new UnAuthorizedAccountError(address);\n account = new AccountRpc({ rpcClient: this.rpcClient, address });\n }\n if (account == null) this._ensureAccountAccess();\n return super._resolveAccount(account);\n }\n\n addresses(): Encoded.AccountAddress[] {\n if (this._accounts == null) return [];\n const current = Object.keys(this._accounts.current)[0];\n return [\n ...current != null ? [current] : [], ...Object.keys(this._accounts.connected),\n ] as Encoded.AccountAddress[];\n }\n\n /**\n * Connect to wallet\n * @param connection - Wallet connection object\n * @param options - Options\n * @param options.connectNode - Request wallet to bind node\n * @param options.name - Node name\n * @param options.select - Select this node as current\n */\n async connectToWallet(\n connection: BrowserConnection,\n { connectNode = false, name = 'wallet-node', select = false }:\n { connectNode?: boolean; name?: string; select?: boolean } = {},\n ): Promise<WalletInfo> {\n if (this.rpcClient != null) throw new AlreadyConnectedError('You are already connected to wallet');\n let disconnectParams: any;\n const client = new RpcClient<WalletApi, AeppApi>(\n connection,\n () => {\n delete this.rpcClient;\n delete this._accounts;\n this.onDisconnect(disconnectParams);\n },\n {\n [METHODS.updateAddress]: (params) => {\n this._accounts = params;\n this.onAddressChange(params);\n },\n [METHODS.updateNetwork]: (params) => {\n const { node } = params;\n if (node != null) this.addNode(node.name, new Node(node.url), true);\n this.onNetworkChange(params);\n },\n [METHODS.closeConnection]: (params) => {\n disconnectParams = params;\n client.connection.disconnect();\n },\n [METHODS.readyToConnect]: () => {},\n },\n );\n const { node, ...walletInfo } = await client\n .request(METHODS.connect, { name: this.name, version: RPC_VERSION, connectNode });\n if (connectNode) {\n if (node == null) throw new RpcConnectionError('Missing URLs of the Node');\n this.addNode(name, new Node(node.url), select);\n }\n this.rpcClient = client;\n return walletInfo;\n }\n\n /**\n * Disconnect from wallet\n */\n disconnectWallet(): void {\n this._ensureConnected();\n this.rpcClient.notify(METHODS.closeConnection, { reason: 'bye' });\n this.rpcClient.connection.disconnect();\n }\n\n /**\n * Ask addresses from wallet\n * @returns Addresses from wallet\n */\n async askAddresses(): Promise<Encoded.AccountAddress[]> {\n this._ensureAccountAccess();\n return this.rpcClient.request(METHODS.address, undefined);\n }\n\n /**\n * Subscribe for addresses from wallet\n * @param type - Subscription type\n * @param value - Should be one of 'current' (the selected account), 'connected' (all)\n * @returns Accounts from wallet\n */\n async subscribeAddress(\n type: SUBSCRIPTION_TYPES,\n value: 'current' | 'connected',\n ): Promise<ReturnType<WalletApi[METHODS.subscribeAddress]>> {\n this._ensureConnected();\n const result = await this.rpcClient.request(METHODS.subscribeAddress, { type, value });\n this._accounts = result.address;\n return result;\n }\n\n _ensureConnected(): asserts this is AeSdkAepp & { rpcClient: NonNullable<AeSdkAepp['rpcClient']> } {\n if (this.rpcClient != null) return;\n throw new NoWalletConnectedError('You are not connected to Wallet');\n }\n\n _ensureAccountAccess(): asserts this is AeSdkAepp & { rpcClient: NonNullable<AeSdkAepp['rpcClient']> } {\n this._ensureConnected();\n if (this.addresses().length !== 0) return;\n throw new UnsubscribedAccountError();\n }\n}\n","import { send } from '../../spend';\nimport { Encoded } from '../../utils/encoder';\nimport { METHODS, SUBSCRIPTION_TYPES, WALLET_TYPE } from '../schema';\n\nexport interface WalletInfo {\n id: string;\n name: string;\n networkId: string;\n origin: string;\n type: WALLET_TYPE;\n}\n\nexport interface Accounts {\n connected: { [pub: Encoded.AccountAddress]: {} };\n current: { [pub: Encoded.AccountAddress]: {} };\n}\n\nexport interface Node {\n name: string;\n url: string;\n}\n\nexport interface Network {\n networkId: string;\n node?: Node;\n}\n\ntype Icons = Array<{ src: string; sizes?: string; type?: string; purpose?: string }>;\n\nexport const RPC_VERSION = 1;\n\nexport interface WalletApi {\n [METHODS.connect]: (\n p: { name: string; icons?: Icons; version: typeof RPC_VERSION; connectNode: boolean }\n ) => Promise<WalletInfo & { node?: Node }>;\n\n [METHODS.closeConnection]: (p: any) => void;\n\n [METHODS.subscribeAddress]: (\n p: { type: SUBSCRIPTION_TYPES; value: 'connected' | 'current' }\n ) => Promise<{ subscription: Array<'connected' | 'current'>; address: Accounts }>;\n\n [METHODS.address]: () => Promise<Encoded.AccountAddress[]>;\n\n [METHODS.sign]: ((\n p: { tx: Encoded.Transaction; onAccount: Encoded.AccountAddress; returnSigned: boolean }\n ) => Promise<{\n /**\n * @deprecated this is not a hash at all, will be removed later at the same time\n * as dropping ability to broadcast transaction by wallet\n */\n transactionHash?: Awaited<ReturnType<typeof send>>;\n signedTransaction?: Encoded.Transaction;\n }>);\n\n [METHODS.signMessage]: (\n p: { message: string; onAccount: Encoded.AccountAddress }\n ) => Promise<{ signature: string }>;\n}\n\nexport interface AeppApi {\n [METHODS.updateAddress]: (a: Accounts) => void;\n [METHODS.updateNetwork]: (a: Network) => void;\n [METHODS.readyToConnect]: (w: WalletInfo) => void;\n [METHODS.closeConnection]: (p: any) => void;\n}\n","import JsonBig from 'json-bigint';\nimport BigNumber from 'bignumber.js';\nimport { mapObject } from './other';\n\nconst jsonBig = JsonBig({ storeAsString: true });\n\nconst convertValuesToBigNumbers = (value: any): any => {\n if (typeof value === 'object' && value !== null && value.constructor === Object) {\n return mapObject(value, ([k, v]) => [k, convertValuesToBigNumbers(v)]);\n }\n if (Array.isArray(value)) {\n return value.map((item) => convertValuesToBigNumbers(item));\n }\n if (typeof value === 'string' && new BigNumber(value).toString(10) === value) {\n const bn = new BigNumber(value);\n bn.toJSON = () => bn.toString(10);\n return bn;\n }\n return value;\n};\n\nexport default {\n stringify: (...args: Parameters<typeof JsonBig['stringify']>): string => (\n jsonBig.stringify(convertValuesToBigNumbers(args[0]), ...args.slice(1))\n ),\n parse: jsonBig.parse,\n};\n","import { v4 as uuid } from '@aeternity/uuid';\nimport AeSdk from './AeSdk';\nimport { Account } from './AeSdkBase';\nimport verifyTransaction from './tx/validator';\nimport RpcClient from './aepp-wallet-communication/rpc/RpcClient';\nimport {\n METHODS, RPC_STATUS, SUBSCRIPTION_TYPES, WALLET_TYPE,\n RpcBroadcastError, RpcInvalidTransactionError,\n RpcNotAuthorizeError, RpcPermissionDenyError, RpcUnsupportedProtocolError,\n} from './aepp-wallet-communication/schema';\nimport { InternalError, UnknownRpcClientError } from './utils/errors';\nimport AccountBase from './account/Base';\nimport BrowserConnection from './aepp-wallet-communication/connection/Browser';\nimport {\n Accounts,\n AeppApi,\n Network,\n RPC_VERSION,\n WalletApi,\n WalletInfo,\n} from './aepp-wallet-communication/rpc/types';\nimport { Encoded } from './utils/encoder';\nimport jsonBig from './utils/json-big';\n\ntype RpcClientWallet = RpcClient<AeppApi, WalletApi>;\n\ntype OnConnection = (\n clientId: string, params: Omit<Parameters<WalletApi[METHODS.connect]>[0], 'version'>, origin: string\n) => void;\n\ntype OnSubscription = (\n clientId: string, params: Parameters<WalletApi[METHODS.subscribeAddress]>[0], origin: string\n) => void;\n\ntype OnSign = (\n clientId: string, params: Parameters<WalletApi[METHODS.sign]>[0], origin: string\n) => Promise<{ tx?: Encoded.Transaction; onAccount?: Account } | undefined> | Promise<void>;\n\ntype OnDisconnect = (\n clientId: string, params: Parameters<WalletApi[METHODS.closeConnection]>[0]\n) => void;\n\ntype OnAskAccounts = (\n clientId: string, params: undefined, origin: string\n) => void;\n\ntype OnMessageSign = (\n clientId: string, params: Parameters<WalletApi[METHODS.signMessage]>[0], origin: string\n) => Promise<{ onAccount?: Account } | undefined> | Promise<void>;\n\ninterface RpcClientsInfo {\n id: string;\n status: RPC_STATUS;\n connectNode: boolean;\n addressSubscription: Set<'connected' | 'current'>;\n rpc: RpcClientWallet;\n}\n\n/**\n * Contain functionality for aepp interaction and managing multiple aepps\n * @category aepp wallet communication\n */\nexport default class AeSdkWallet extends AeSdk {\n id: string;\n\n _type: WALLET_TYPE;\n\n name: string;\n\n _clients: Map<string, RpcClientsInfo>;\n\n onConnection: OnConnection;\n\n onSubscription: OnSubscription;\n\n onSign: OnSign;\n\n onDisconnect: OnDisconnect;\n\n onAskAccounts: OnAskAccounts;\n\n onMessageSign: OnMessageSign;\n\n /**\n * @param options - Options\n * @param options.name - Wallet name\n * @param options.id - Wallet id\n * @param options.type - Wallet type\n * @param options.onConnection - Call-back function for incoming AEPP connection\n * @param options.onSubscription - Call-back function for incoming AEPP account subscription\n * @param options.onSign - Call-back function for incoming AEPP sign request\n * @param options.onAskAccounts - Call-back function for incoming AEPP get address request\n * @param options.onMessageSign - Call-back function for incoming AEPP sign message request\n * @param options.onDisconnect - Call-back function for disconnect event\n */\n constructor({\n name,\n id,\n type,\n onConnection,\n onSubscription,\n onSign,\n onDisconnect,\n onAskAccounts,\n onMessageSign,\n ...options\n }: {\n id: string;\n type: WALLET_TYPE;\n name: string;\n onConnection: OnConnection;\n onSubscription: OnSubscription;\n onSign: OnSign;\n onDisconnect: OnDisconnect;\n onAskAccounts: OnAskAccounts;\n onMessageSign: OnMessageSign;\n } & ConstructorParameters<typeof AeSdk>[0]) {\n super(options);\n this.onConnection = onConnection;\n this.onSubscription = onSubscription;\n this.onSign = onSign;\n this.onDisconnect = onDisconnect;\n this.onAskAccounts = onAskAccounts;\n this.onMessageSign = onMessageSign;\n this._clients = new Map();\n this.name = name;\n this.id = id;\n this._type = type;\n }\n\n _pushAccountsToApps(): void {\n Array.from(this._clients.keys())\n .filter((clientId) => this._isRpcClientSubscribed(clientId))\n .map((clientId) => this._getClient(clientId).rpc)\n .forEach((client) => client.notify(METHODS.updateAddress, this.getAccounts()));\n }\n\n selectAccount(address: Encoded.AccountAddress): void {\n super.selectAccount(address);\n this._pushAccountsToApps();\n }\n\n async addAccount(\n account: AccountBase,\n options?: Parameters<AeSdk['addAccount']>[1],\n ): Promise<void> {\n await super.addAccount(account, options);\n this._pushAccountsToApps();\n }\n\n _getNode(): { node: Network['node'] } {\n this.ensureNodeConnected();\n return { node: { url: this.api.url, name: this.selectedNodeName } };\n }\n\n async selectNode(name: string): Promise<void> {\n super.selectNode(name);\n const networkId = await this.getNetworkId();\n Array.from(this._clients.keys())\n .filter((clientId) => this._isRpcClientConnected(clientId))\n .map((clientId) => this._getClient(clientId))\n .forEach((client) => {\n client.rpc.notify(METHODS.updateNetwork, {\n networkId,\n ...client.connectNode && this._getNode(),\n });\n });\n }\n\n _getClient(clientId: string): RpcClientsInfo {\n const client = this._clients.get(clientId);\n if (client == null) throw new UnknownRpcClientError(clientId);\n return client;\n }\n\n _isRpcClientSubscribed(clientId: string): boolean {\n return this._isRpcClientConnected(clientId)\n && this._getClient(clientId).addressSubscription.size !== 0;\n }\n\n _isRpcClientConnected(clientId: string): boolean {\n return RPC_STATUS.CONNECTED === this._getClient(clientId).status\n && this._getClient(clientId).rpc.connection.isConnected();\n }\n\n _disconnectRpcClient(clientId: string): void {\n const client = this._getClient(clientId);\n client.rpc.connection.disconnect();\n client.status = RPC_STATUS.DISCONNECTED;\n client.addressSubscription = new Set();\n }\n\n /**\n * Remove specific RpcClient by ID\n * @param id - Client ID\n */\n removeRpcClient(id: string): void {\n this._disconnectRpcClient(id);\n this._clients.delete(id);\n }\n\n /**\n * Add new client by AEPP connection\n * @param clientConnection - AEPP connection object\n * @returns Client ID\n */\n addRpcClient(clientConnection: BrowserConnection): string {\n // @TODO detect if aepp has some history based on origin????\n // if yes use this instance for connection\n const id = uuid();\n let disconnectParams: any;\n const client: RpcClientsInfo = {\n id,\n status: RPC_STATUS.WAITING_FOR_CONNECTION_REQUEST,\n addressSubscription: new Set(),\n connectNode: false,\n rpc: new RpcClient<AeppApi, WalletApi>(\n clientConnection,\n () => {\n this._clients.delete(id);\n this.onDisconnect(id, disconnectParams); // also related info\n },\n {\n [METHODS.closeConnection]: (params) => {\n disconnectParams = params;\n this._disconnectRpcClient(id);\n },\n // Store client info and prepare two fn for each client `connect` and `denyConnection`\n // which automatically prepare and send response for that client\n [METHODS.connect]: async ({\n name, version, icons, connectNode,\n }, origin) => {\n if (version !== RPC_VERSION) throw new RpcUnsupportedProtocolError();\n\n await this.onConnection(id, { name, icons, connectNode }, origin);\n client.status = RPC_STATUS.CONNECTED;\n client.connectNode = connectNode;\n return {\n ...await this.getWalletInfo(),\n ...connectNode && this._getNode(),\n };\n },\n [METHODS.subscribeAddress]: async ({ type, value }, origin) => {\n if (!this._isRpcClientConnected(id)) throw new RpcNotAuthorizeError();\n\n await this.onSubscription(id, { type, value }, origin);\n\n switch (type) {\n case SUBSCRIPTION_TYPES.subscribe:\n client.addressSubscription.add(value);\n break;\n case SUBSCRIPTION_TYPES.unsubscribe:\n client.addressSubscription.delete(value);\n break;\n default:\n throw new InternalError(`Unknown subscription type: ${type}`);\n }\n\n return {\n subscription: Array.from(client.addressSubscription),\n address: this.getAccounts(),\n };\n },\n [METHODS.address]: async (params, origin) => {\n if (!this._isRpcClientSubscribed(id)) throw new RpcNotAuthorizeError();\n await this.onAskAccounts(id, params, origin);\n return this.addresses();\n },\n [METHODS.sign]: async ({ tx, onAccount, returnSigned }, origin) => {\n if (!this._isRpcClientConnected(id)) throw new RpcNotAuthorizeError();\n onAccount ??= await this.address();\n if (!this.addresses().includes(onAccount)) {\n throw new RpcPermissionDenyError(onAccount);\n }\n\n const overrides = await this.onSign(id, { tx, returnSigned, onAccount }, origin);\n onAccount = overrides?.onAccount ?? onAccount;\n tx = overrides?.tx ?? tx;\n if (returnSigned) {\n return { signedTransaction: await this.signTransaction(tx, { onAccount }) };\n }\n try {\n return jsonBig.parse(jsonBig.stringify({\n transactionHash: await this.send(tx, { onAccount, verify: false }),\n }));\n } catch (error) {\n const validation = await verifyTransaction(tx, this.api);\n if (validation.length > 0) throw new RpcInvalidTransactionError(validation);\n throw new RpcBroadcastError(error.message);\n }\n },\n [METHODS.signMessage]: async ({ message, onAccount }, origin) => {\n if (!this._isRpcClientConnected(id)) throw new RpcNotAuthorizeError();\n onAccount ??= await this.address();\n if (!this.addresses().includes(onAccount)) {\n throw new RpcPermissionDenyError(onAccount);\n }\n\n const overrides = await this.onMessageSign(id, { message, onAccount }, origin);\n onAccount = overrides?.onAccount ?? onAccount;\n return {\n // TODO: fix signMessage return type\n signature: await this.signMessage(message, { onAccount, returnHex: true }) as\n unknown as string,\n };\n },\n },\n ),\n };\n this._clients.set(id, client);\n return id;\n }\n\n /**\n * Send shareWalletInfo message to notify AEPP about wallet\n * @param clientId - ID of RPC client send message to\n */\n async shareWalletInfo(clientId: string): Promise<void> {\n this._getClient(clientId).rpc.notify(METHODS.readyToConnect, await this.getWalletInfo());\n }\n\n /**\n * Get Wallet info object\n * @returns Object with wallet information\n */\n async getWalletInfo(): Promise<WalletInfo> {\n return {\n id: this.id,\n name: this.name,\n networkId: await this.getNetworkId(),\n origin: window.location.origin,\n type: this._type,\n };\n }\n\n /**\n * Get Wallet accounts\n * @returns Object with accounts information (\\{ connected: Object, current: Object \\})\n */\n getAccounts(): Accounts {\n return {\n current: this.selectedAddress != null ? { [this.selectedAddress]: {} } : {},\n connected: this.addresses()\n .filter((a) => a !== this.selectedAddress)\n .reduce((acc, a) => ({ ...acc, [a]: {} }), {}),\n };\n }\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2018 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\nimport { w3cwebsocket as W3CWebSocket } from 'websocket';\nimport { EventEmitter } from 'events';\nimport BigNumber from 'bignumber.js';\nimport type Channel from '.';\nimport JsonBig from '../utils/json-big';\nimport { pascalToSnake } from '../utils/string';\nimport { Encoded } from '../utils/encoder';\nimport {\n BaseError, ChannelCallError, ChannelPingTimedOutError, UnknownChannelStateError,\n} from '../utils/errors';\n\ninterface ChannelAction {\n guard: (channel: Channel, state?: ChannelFsm) => boolean;\n action: (channel: Channel, state?: ChannelFsm) => ChannelFsm;\n}\n\nexport type SignTxWithTag = (tag: string, tx: Encoded.Transaction, options?: object) => (\n Promise<Encoded.Transaction>\n);\n// TODO: SignTx shouldn't return number or null\nexport type SignTx = (tx: Encoded.Transaction, options?: object) => (\n Promise<Encoded.Transaction | number | null>\n);\n\nexport interface ChannelOptions {\n existingFsmId?: string;\n url: string;\n role: 'initiator' | 'responder';\n initiatorId: Encoded.AccountAddress;\n responderId: Encoded.AccountAddress;\n pushAmount: number;\n initiatorAmount: BigNumber;\n responderAmount: BigNumber;\n channelReserve?: BigNumber | number;\n signedTx?: string;\n ttl?: number;\n host: string;\n port: number;\n lockPeriod: number;\n existingChannelId?: string;\n offChainTx?: string;\n reconnectTx?: string;\n timeoutIdle?: number;\n timeoutFundingCreate?: number;\n timeoutFundingSign?: number;\n timeoutFundingLock?: number;\n timeoutSign?: number;\n timeoutAccept?: number;\n timeoutInitialized?: number;\n timeoutAwaitingOpen?: number;\n statePassword?: string;\n debug: boolean;\n sign: SignTxWithTag;\n offchainTx?: string;\n}\n\nexport interface ChannelHandler extends Function {\n enter?: Function;\n}\n\nexport interface ChannelState {\n signedTx: any;\n resolve: (r?: any) => void;\n reject: (e: BaseError) => void;\n sign: SignTx;\n handler?: ChannelHandler;\n onOnChainTx?: (tx: Encoded.Transaction) => void;\n onOwnWithdrawLocked?: () => void;\n onWithdrawLocked?: () => void;\n onOwnDepositLocked?: () => void;\n onDepositLocked?: () => void;\n closeTx?: string;\n}\n\nexport interface ChannelFsm {\n handler: ChannelHandler;\n state?: ChannelState | {\n resolve: Function;\n reject: Function;\n };\n}\n\nexport interface ChannelMessage {\n id?: number;\n jsonrpc: string;\n method: string;\n params: any;\n payload?: any;\n data?: any;\n error?: ChannelMessageError;\n}\n\ninterface ChannelMessageError {\n code: number;\n message: string;\n data: [{\n message: string;\n code: number;\n }];\n request: ChannelMessage;\n}\n\n// Send ping message every 10 seconds\nconst PING_TIMEOUT_MS = 10000;\n// Close connection if pong message is not received within 5 seconds\nconst PONG_TIMEOUT_MS = 5000;\n\n// TODO: move to Channel instance to avoid is-null checks and for easier debugging\nexport const options = new WeakMap<Channel, ChannelOptions>();\nexport const status = new WeakMap<Channel, string>();\nexport const state = new WeakMap<Channel, Encoded.Transaction>();\nconst fsm = new WeakMap<Channel, ChannelFsm>();\nconst websockets = new WeakMap<Channel, W3CWebSocket>();\nexport const eventEmitters = new WeakMap<Channel, EventEmitter>();\nconst messageQueue = new WeakMap<Channel, string[]>();\nconst messageQueueLocked = new WeakMap<Channel, boolean>();\nconst actionQueue = new WeakMap<Channel, ChannelAction[]>();\nconst actionQueueLocked = new WeakMap<Channel, boolean>();\nconst sequence = new WeakMap<Channel, number>();\nexport const channelId = new WeakMap<Channel, string>();\nconst rpcCallbacks = new WeakMap<Channel, Map<number, Function>>();\nconst pingTimeoutId = new WeakMap<Channel, NodeJS.Timeout>();\nconst pongTimeoutId = new WeakMap<Channel, NodeJS.Timeout>();\nexport const fsmId = new WeakMap<Channel, string>();\n\nexport function emit(channel: Channel, ...args: any[]): void {\n const [eventName, ...rest] = args;\n eventEmitters.get(channel)?.emit(eventName, ...rest);\n}\n\nfunction enterState(channel: Channel, nextState: ChannelFsm): void {\n if (nextState == null) {\n throw new UnknownChannelStateError();\n }\n fsm.set(channel, nextState);\n if (nextState?.handler?.enter != null) {\n nextState.handler.enter(channel);\n }\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n void dequeueAction(channel);\n}\n\nexport function changeStatus(channel: Channel, newStatus: string): void {\n const prevStatus = status.get(channel);\n if (newStatus !== prevStatus) {\n status.set(channel, newStatus);\n emit(channel, 'statusChanged', newStatus);\n }\n}\n\nexport function changeState(channel: Channel, newState: Encoded.Transaction): void {\n state.set(channel, newState);\n emit(channel, 'stateChanged', newState);\n}\n\nexport function send(channel: Channel, message: ChannelMessage): void {\n const debug: boolean = options.get(channel)?.debug ?? false;\n if (debug) console.log('Send message: ', message);\n\n websockets.get(channel)?.send(JsonBig.stringify(message));\n}\n\nasync function dequeueAction(channel: Channel): Promise<void> {\n const locked = actionQueueLocked.get(channel);\n const queue = actionQueue.get(channel) ?? [];\n if (Boolean(locked) || queue.length === 0) {\n return;\n }\n const singleFsm = fsm.get(channel);\n if (singleFsm == null) return;\n const index = queue.findIndex((action: ChannelAction) => action.guard(channel, singleFsm));\n if (index === -1) {\n return;\n }\n actionQueue.set(channel, queue.filter((_: ChannelAction, i: number) => index !== i));\n actionQueueLocked.set(channel, true);\n const nextState: ChannelFsm = await Promise.resolve(queue[index].action(channel, singleFsm));\n actionQueueLocked.set(channel, false);\n enterState(channel, nextState);\n}\n\nexport function enqueueAction(\n channel: Channel,\n guard: ChannelAction['guard'],\n action: ChannelAction['action'],\n): void {\n const queue = actionQueue.get(channel) ?? [];\n actionQueue.set(channel, [\n ...queue,\n { guard, action },\n ]);\n void dequeueAction(channel);\n}\n\nasync function handleMessage(channel: Channel, message: string): Promise<void> {\n const fsmState = fsm.get(channel);\n if (fsmState == null) throw new UnknownChannelStateError();\n const { handler, state: st } = fsmState;\n enterState(channel, await Promise.resolve(handler(channel, message, st)));\n}\n\nasync function dequeueMessage(channel: Channel): Promise<void> {\n const locked: boolean = messageQueueLocked.get(channel) ?? false;\n if (locked) return;\n const messages: string[] = messageQueue.get(channel) ?? [];\n if (messages.length === 0) return;\n messageQueueLocked.set(channel, true);\n while (messages.length > 0) {\n const message: string = messages.shift() ?? '';\n try {\n await handleMessage(channel, message);\n } catch (error) {\n console.error('Error handling incoming message:');\n console.error(message);\n console.error(error);\n }\n }\n messageQueueLocked.set(channel, false);\n}\n\nexport function disconnect(channel: Channel): void {\n websockets.get(channel)?.close();\n const pingTimeoutIdValue = pingTimeoutId.get(channel);\n const pongTimeoutIdValue = pongTimeoutId.get(channel);\n if (pingTimeoutIdValue != null) clearTimeout(pingTimeoutIdValue);\n if (pongTimeoutIdValue != null) clearTimeout(pongTimeoutIdValue);\n}\n\nfunction ping(channel: Channel): void {\n const pingTimeoutIdValue = pingTimeoutId.get(channel);\n const pongTimeoutIdValue = pongTimeoutId.get(channel);\n if (pingTimeoutIdValue != null) clearTimeout(pingTimeoutIdValue);\n if (pongTimeoutIdValue != null) clearTimeout(pongTimeoutIdValue);\n pingTimeoutId.set(channel, setTimeout(() => {\n send(channel, {\n jsonrpc: '2.0',\n method: 'channels.system',\n params: {\n action: 'ping',\n },\n });\n pongTimeoutId.set(channel, setTimeout(() => {\n disconnect(channel);\n emit(channel, 'error', new ChannelPingTimedOutError());\n }, PONG_TIMEOUT_MS));\n }, PING_TIMEOUT_MS));\n}\n\nfunction onMessage(channel: Channel, data: string): void {\n const message = JsonBig.parse(data);\n const debug: boolean = options.get(channel)?.debug ?? false;\n if (debug) console.log('Receive message: ', message);\n if (message.id != null) {\n const callback = rpcCallbacks.get(channel)?.get(message.id);\n try {\n callback?.(message);\n } finally {\n rpcCallbacks.get(channel)?.delete(message.id);\n }\n return;\n }\n if (message.method === 'channels.message') {\n emit(channel, 'message', message.params.data.message);\n return;\n }\n if (message.method === 'channels.system.pong') {\n if (\n (message.params.channel_id === channelId.get(channel))\n // Skip channelId check if channelId is not known yet\n || (channelId.get(channel) == null)\n ) {\n ping(channel);\n }\n return;\n }\n messageQueue.get(channel)?.push(message);\n void dequeueMessage(channel);\n}\n\nexport async function call(channel: Channel, method: string, params: any): Promise<any> {\n return new Promise((resolve, reject) => {\n const currentSequence: number = sequence.get(channel) ?? 0;\n const id = sequence.set(channel, currentSequence + 1).get(channel) ?? 1;\n rpcCallbacks.get(channel)?.set(\n id,\n (message: { result: PromiseLike<any>; error?: ChannelMessageError }) => {\n if (message.error != null) {\n const [{ message: details } = { message: '' }] = message.error.data ?? [];\n return reject(new ChannelCallError(message.error.message + details));\n }\n return resolve(message.result);\n },\n );\n send(channel, {\n jsonrpc: '2.0', method, id, params,\n });\n });\n}\n\nexport async function initialize(\n channel: Channel,\n connectionHandler: Function,\n openHandler: Function,\n { url, ...channelOptions }: ChannelOptions,\n): Promise<void> {\n options.set(channel, { url, ...channelOptions });\n fsm.set(channel, { handler: connectionHandler });\n eventEmitters.set(channel, new EventEmitter());\n sequence.set(channel, 0);\n rpcCallbacks.set(channel, new Map());\n messageQueue.set(channel, []);\n\n const wsUrl = new URL(url);\n Object.entries(channelOptions)\n .filter(([key]) => !['sign', 'debug'].includes(key))\n .forEach(([key, value]) => wsUrl.searchParams.set(pascalToSnake(key), value));\n wsUrl.searchParams.set('protocol', 'json-rpc');\n changeStatus(channel, 'connecting');\n const ws = new W3CWebSocket(wsUrl.toString());\n await new Promise<void>((resolve, reject) => {\n Object.assign(ws, {\n onerror: reject,\n onopen: async () => {\n resolve();\n changeStatus(channel, 'connected');\n if (channelOptions.reconnectTx != null) {\n enterState(channel, { handler: openHandler });\n const signedTx = (await call(channel, 'channels.get.offchain_state', {})).signed_tx;\n changeState(channel, signedTx);\n }\n ping(channel);\n },\n onclose: () => {\n changeStatus(channel, 'disconnected');\n const pingTimeoutIdValue = pingTimeoutId.get(channel);\n const pongTimeoutIdValue = pongTimeoutId.get(channel);\n if (pingTimeoutIdValue != null) clearTimeout(pingTimeoutIdValue);\n if (pongTimeoutIdValue != null) clearTimeout(pongTimeoutIdValue);\n },\n onmessage: ({ data }: { data: string }) => onMessage(channel, data),\n });\n });\n websockets.set(channel, ws);\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2018 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n/* eslint-disable consistent-return */\n/* eslint-disable default-case */\n/* eslint-disable @typescript-eslint/no-use-before-define */\nimport { generateKeyPair, encodeContractAddress } from '../utils/crypto';\nimport {\n ChannelState,\n options,\n changeStatus,\n changeState,\n call,\n send,\n emit,\n channelId,\n disconnect,\n fsmId,\n ChannelMessage,\n ChannelFsm,\n SignTx,\n} from './internal';\nimport { unpackTx, buildTx } from '../tx/builder';\nimport { encode, Encoded, Encoding } from '../utils/encoder';\nimport {\n IllegalArgumentError,\n InsufficientBalanceError,\n ChannelConnectionError,\n UnexpectedChannelMessageError,\n} from '../utils/errors';\nimport type Channel from '.';\nimport { Tag } from '../tx/builder/constants';\n\nexport async function appendSignature(\n tx: Encoded.Transaction,\n signFn: SignTx,\n): Promise<Encoded.Transaction | number | null> {\n const { signatures, encodedTx } = unpackTx(tx, Tag.SignedTx).tx;\n const result = await signFn(encode(encodedTx.rlpEncoded, Encoding.Transaction));\n if (typeof result === 'string') {\n const { tx: signedTx } = unpackTx(result, Tag.SignedTx);\n return buildTx({\n signatures: signatures.concat(signedTx.signatures),\n encodedTx: signedTx.encodedTx.rlpEncoded,\n }, Tag.SignedTx).tx;\n }\n return result;\n}\n\nfunction handleUnexpectedMessage(\n _channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm {\n state?.reject?.(Object.assign(\n new UnexpectedChannelMessageError(`Unexpected message received:\\n\\n${JSON.stringify(message)}`),\n { wsMessage: message },\n ));\n return { handler: channelOpen };\n}\n\nexport function awaitingConnection(\n channel: Channel,\n message: ChannelMessage,\n): ChannelFsm | undefined {\n if (message.method === 'channels.info') {\n const channelInfoStatus: string = message.params.data.event;\n if (['channel_accept', 'funding_created'].includes(channelInfoStatus)) {\n changeStatus(channel, {\n channel_accept: 'accepted',\n funding_created: 'halfSigned',\n }[channelInfoStatus as 'channel_accept' | 'funding_created']);\n return { handler: awaitingChannelCreateTx };\n }\n if (message.params.data.event === 'channel_reestablished') {\n return { handler: awaitingOpenConfirmation };\n }\n if (message.params.data.event === 'fsm_up') {\n fsmId.set(channel, message.params.data.fsm_id);\n return { handler: awaitingConnection };\n }\n return { handler: awaitingConnection };\n }\n if (message.method === 'channels.error') {\n emit(channel, 'error', new ChannelConnectionError(message?.payload?.message));\n return { handler: channelClosed };\n }\n}\n\nexport async function awaitingReconnection(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): Promise<ChannelFsm> {\n if (message.method === 'channels.info') {\n if (message.params.data.event === 'fsm_up') {\n fsmId.set(channel, message.params.data.fsm_id);\n changeState(channel, (await call(channel, 'channels.get.offchain_state', {})).signed_tx);\n return { handler: channelOpen };\n }\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport async function awaitingChannelCreateTx(\n channel: Channel,\n message: ChannelMessage,\n): Promise<ChannelFsm | undefined> {\n const channelOptions = options.get(channel);\n if (channelOptions != null) {\n const tag = {\n initiator: 'initiator_sign',\n responder: 'responder_sign',\n }[channelOptions.role];\n if (message.method === `channels.sign.${tag}`) {\n if (message.params.data.tx != null) {\n const signedTx = await channelOptions.sign(tag, message.params.data.tx);\n send(channel, { jsonrpc: '2.0', method: `channels.${tag}`, params: { tx: signedTx } });\n return { handler: awaitingOnChainTx };\n }\n const signedTx = await appendSignature(\n message.params.data.signed_tx,\n async (tx) => channelOptions.sign(tag, tx),\n );\n send(channel, { jsonrpc: '2.0', method: `channels.${tag}`, params: { signed_tx: signedTx } });\n return { handler: awaitingOnChainTx };\n }\n }\n}\n\nexport function awaitingOnChainTx(\n channel: Channel,\n message: ChannelMessage,\n): ChannelFsm | undefined {\n const channelOptions = options.get(channel);\n if (channelOptions != null) {\n if (message.method === 'channels.on_chain_tx') {\n if (\n message.params.data.info === 'funding_signed'\n && channelOptions.role === 'initiator'\n ) {\n return { handler: awaitingBlockInclusion };\n }\n if (\n message.params.data.info === 'funding_created'\n && channelOptions.role === 'responder'\n ) {\n return { handler: awaitingBlockInclusion };\n }\n }\n if (\n message.method === 'channels.info'\n && message.params.data.event === 'funding_signed'\n && channelOptions.role === 'initiator'\n ) {\n channelId.set(channel, message.params.channel_id);\n changeStatus(channel, 'signed');\n return { handler: awaitingOnChainTx };\n }\n }\n}\n\nexport function awaitingBlockInclusion(\n channel: Channel,\n message: ChannelMessage,\n): ChannelFsm | undefined {\n if (message.method === 'channels.info') {\n const handlers: {\n [key: string]: (channel: Channel, message: ChannelMessage) => ChannelFsm | undefined;\n } = {\n funding_created: awaitingBlockInclusion,\n own_funding_locked: awaitingBlockInclusion,\n funding_locked: awaitingOpenConfirmation,\n };\n const handler = handlers[message.params.data.event as string];\n if (handler != null) {\n return { handler };\n }\n }\n if (message.method === 'channels.on_chain_tx') {\n emit(channel, 'onChainTx', message.params.data.tx, {\n info: message.params.data.info,\n type: message.params.data.type,\n });\n return { handler: awaitingBlockInclusion };\n }\n}\n\nexport function awaitingOpenConfirmation(\n channel: Channel,\n message: ChannelMessage,\n): ChannelFsm | undefined {\n if (message.method === 'channels.info' && message.params.data.event === 'open') {\n channelId.set(channel, message.params.channel_id);\n return { handler: awaitingInitialState };\n }\n}\n\nexport function awaitingInitialState(\n channel: Channel,\n message: ChannelMessage,\n): ChannelFsm | undefined {\n if (message.method === 'channels.update') {\n changeState(channel, message.params.data.state);\n return { handler: channelOpen };\n }\n}\n\nexport async function channelOpen(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): Promise<ChannelFsm | undefined> {\n switch (message.method) {\n case 'channels.info':\n switch (message.params.data.event) {\n case 'update':\n case 'withdraw_created':\n case 'deposit_created':\n return { handler: awaitingTxSignRequest };\n case 'own_withdraw_locked':\n case 'withdraw_locked':\n case 'own_deposit_locked':\n case 'deposit_locked':\n case 'peer_disconnected':\n case 'channel_reestablished':\n case 'open':\n // TODO: Better handling of peer_disconnected event.\n //\n // We should enter intermediate state where offchain transactions\n // are blocked until channel is reestablished.\n emit(channel, message.params.data.event);\n return { handler: channelOpen };\n case 'fsm_up':\n fsmId.set(channel, message.params.data.fsm_id);\n return { handler: channelOpen };\n case 'timeout':\n case 'close_mutual':\n return { handler: channelOpen };\n case 'closing':\n changeStatus(channel, 'closing');\n return { handler: channelOpen };\n case 'closed_confirmed':\n changeStatus(channel, 'closed');\n return { handler: channelClosed };\n case 'died':\n changeStatus(channel, 'died');\n return { handler: channelClosed };\n case 'shutdown':\n return { handler: channelOpen };\n }\n break;\n case 'channels.on_chain_tx':\n emit(channel, 'onChainTx', message.params.data.tx, {\n info: message.params.data.info,\n type: message.params.data.type,\n });\n return { handler: channelOpen };\n case 'channels.leave':\n // TODO: emit event\n return { handler: channelOpen };\n case 'channels.update':\n changeState(channel, message.params.data.state);\n return { handler: channelOpen };\n case 'channels.sign.shutdown_sign_ack':\n return awaitingTxSignRequest(channel, message, state);\n }\n}\nchannelOpen.enter = (channel: Channel) => {\n changeStatus(channel, 'open');\n};\n\nexport async function awaitingOffChainTx(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): Promise<ChannelFsm> {\n if (message.method === 'channels.sign.update') {\n const { sign } = state;\n if (message.params.data.tx != null) {\n const signedTx = await sign(message.params.data.tx, { updates: message.params.data.updates });\n send(channel, { jsonrpc: '2.0', method: 'channels.update', params: { tx: signedTx } });\n return { handler: awaitingOffChainUpdate, state };\n }\n const signedTx = await appendSignature(\n message.params.data.signed_tx,\n async (tx) => sign(tx, { updates: message.params.data.updates }),\n );\n if (typeof signedTx === 'string') {\n send(channel, { jsonrpc: '2.0', method: 'channels.update', params: { signed_tx: signedTx } });\n return { handler: awaitingOffChainUpdate, state };\n }\n if (typeof signedTx === 'number') {\n send(channel, { jsonrpc: '2.0', method: 'channels.update', params: { error: signedTx } });\n return { handler: awaitingOffChainTx, state };\n }\n }\n if (message.method === 'channels.error') {\n state.reject(new ChannelConnectionError(message.data.message));\n return { handler: channelOpen };\n }\n if (message.error != null) {\n const { data } = message.error ?? { data: [] };\n if (data.find((i) => i.code === 1001) != null) {\n state.reject(new InsufficientBalanceError('Insufficient balance'));\n } else if (data.find((i) => i.code === 1002) != null) {\n state.reject(new IllegalArgumentError('Amount cannot be negative'));\n } else {\n state.reject(new ChannelConnectionError(message.error.message));\n }\n return { handler: channelOpen };\n }\n if (message.method === 'channels.conflict') {\n state.resolve({\n accepted: false,\n errorCode: message.params.data.error_code,\n errorMessage: message.params.data.error_msg,\n });\n return { handler: channelOpen };\n }\n if (message.method === 'channels.info') {\n if (message.params.data.event === 'aborted_update') {\n state.resolve({ accepted: false });\n return { handler: channelOpen };\n }\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport function awaitingOffChainUpdate(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm | undefined {\n if (message.method === 'channels.update') {\n changeState(channel, message.params.data.state);\n state.resolve({ accepted: true, signedTx: message.params.data.state });\n return { handler: channelOpen };\n }\n if (message.method === 'channels.conflict') {\n state.resolve({\n accepted: false,\n errorCode: message.params.data.error_code,\n errorMessage: message.params.data.error_msg,\n });\n return { handler: channelOpen };\n }\n if (message.method === 'channels.info') {\n if (message.params.data.event === 'aborted_update') {\n state.resolve({ accepted: false });\n return { handler: channelOpen };\n }\n }\n if (message.error != null) {\n state.reject(new ChannelConnectionError(message.error.message));\n return { handler: channelOpen };\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport async function awaitingTxSignRequest(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): Promise<ChannelFsm | undefined> {\n const [, tag] = message.method.match(/^channels\\.sign\\.([^.]+)$/) ?? [];\n const channelOptions = options.get(channel);\n if (tag != null && (channelOptions != null)) {\n if (message.params.data.tx != null) {\n const signedTx = await channelOptions.sign(tag, message.params.data.tx, {\n updates: message.params.data.updates,\n });\n if (signedTx != null) {\n send(channel, { jsonrpc: '2.0', method: `channels.${tag}`, params: { tx: signedTx } });\n return { handler: channelOpen };\n }\n } else {\n const signedTx = await appendSignature(\n message.params.data.signed_tx,\n async (tx) => channelOptions.sign(tag, tx, { updates: message.params.data.updates }),\n );\n if (typeof signedTx === 'string') {\n send(channel, { jsonrpc: '2.0', method: `channels.${tag}`, params: { signed_tx: signedTx } });\n return { handler: channelOpen };\n }\n if (typeof signedTx === 'number') {\n send(channel, { jsonrpc: '2.0', method: `channels.${tag}`, params: { error: signedTx } });\n return { handler: awaitingUpdateConflict, state };\n }\n }\n // soft-reject via competing update\n send(channel, {\n jsonrpc: '2.0',\n method: 'channels.update.new',\n params: {\n from: generateKeyPair().publicKey,\n to: generateKeyPair().publicKey,\n amount: 1,\n },\n });\n return { handler: awaitingUpdateConflict, state };\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport function awaitingUpdateConflict(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm {\n if (message.error != null) {\n return { handler: awaitingUpdateConflict, state };\n }\n if (message.method === 'channels.conflict') {\n return { handler: channelOpen };\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport async function awaitingShutdownTx(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): Promise<ChannelFsm | undefined> {\n if (message.method === 'channels.sign.shutdown_sign') {\n if (message.params.data.tx != null) {\n const signedTx = await state.sign(message.params.data.tx);\n send(channel, { jsonrpc: '2.0', method: 'channels.shutdown_sign', params: { tx: signedTx } });\n return { handler: awaitingShutdownOnChainTx, state };\n }\n const signedTx = await appendSignature(\n message.params.data.signed_tx,\n async (tx) => state.sign(tx),\n );\n send(channel, { jsonrpc: '2.0', method: 'channels.shutdown_sign', params: { signed_tx: signedTx } });\n return { handler: awaitingShutdownOnChainTx, state };\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport function awaitingShutdownOnChainTx(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm {\n if (message.method === 'channels.on_chain_tx') {\n // state.resolve(message.params.data.tx)\n return { handler: channelClosed, state };\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport function awaitingLeave(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm {\n if (message.method === 'channels.leave') {\n state.resolve({ channelId: message.params.channel_id, signedTx: message.params.data.state });\n disconnect(channel);\n return { handler: channelClosed };\n }\n if (message.method === 'channels.error') {\n state.reject(new ChannelConnectionError(message.data.message));\n return { handler: channelOpen };\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport async function awaitingWithdrawTx(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): Promise<ChannelFsm | undefined> {\n if (message.method === 'channels.sign.withdraw_tx') {\n const { sign } = state;\n if (message.params.data.tx != null) {\n const signedTx = await sign(message.params.data.tx, { updates: message.params.data.updates });\n send(channel, { jsonrpc: '2.0', method: 'channels.withdraw_tx', params: { tx: signedTx } });\n return { handler: awaitingWithdrawCompletion, state };\n }\n const signedTx = await appendSignature(\n message.params.data.signed_tx,\n async (tx) => sign(tx, { updates: message.params.data.updates }),\n );\n if (typeof signedTx === 'string') {\n send(channel, { jsonrpc: '2.0', method: 'channels.withdraw_tx', params: { signed_tx: signedTx } });\n return { handler: awaitingWithdrawCompletion, state };\n }\n if (typeof signedTx === 'number') {\n send(channel, { jsonrpc: '2.0', method: 'channels.withdraw_tx', params: { error: signedTx } });\n return { handler: awaitingWithdrawCompletion, state };\n }\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport function awaitingWithdrawCompletion(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm {\n if (message.method === 'channels.on_chain_tx') {\n state.onOnChainTx?.(message.params.data.tx);\n return { handler: awaitingWithdrawCompletion, state };\n }\n if (message.method === 'channels.info') {\n if (['own_withdraw_locked', 'withdraw_locked'].includes(message.params.data.event)) {\n const callbacks: {\n [key: string]: Function | undefined;\n } = {\n own_withdraw_locked: state.onOwnWithdrawLocked,\n withdraw_locked: state.onWithdrawLocked,\n };\n callbacks[message.params.data.event]?.();\n return { handler: awaitingWithdrawCompletion, state };\n }\n }\n if (message.method === 'channels.update') {\n changeState(channel, message.params.data.state);\n state.resolve({ accepted: true, signedTx: message.params.data.state });\n return { handler: channelOpen };\n }\n if (message.method === 'channels.conflict') {\n state.resolve({\n accepted: false,\n errorCode: message.params.data.error_code,\n errorMessage: message.params.data.error_msg,\n });\n return { handler: channelOpen };\n }\n if (message.method === 'channels.info') {\n if (message.params.data.event === 'aborted_update') {\n state.resolve({ accepted: false });\n return { handler: channelOpen };\n }\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport async function awaitingDepositTx(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): Promise<ChannelFsm | undefined> {\n if (message.method === 'channels.sign.deposit_tx') {\n const { sign } = state;\n if (message.params.data.tx != null) {\n const signedTx = await sign(\n message.params.data.tx,\n { updates: message.params.data.updates },\n );\n send(channel, { jsonrpc: '2.0', method: 'channels.deposit_tx', params: { tx: signedTx } });\n return { handler: awaitingDepositCompletion, state };\n }\n const signedTx = await appendSignature(\n message.params.data.signed_tx,\n async (tx) => sign(tx, { updates: message.params.data.updates }),\n );\n if (typeof signedTx === 'string') {\n send(channel, { jsonrpc: '2.0', method: 'channels.deposit_tx', params: { signed_tx: signedTx } });\n return { handler: awaitingDepositCompletion, state };\n }\n if (typeof signedTx === 'number') {\n send(channel, { jsonrpc: '2.0', method: 'channels.deposit_tx', params: { error: signedTx } });\n return { handler: awaitingDepositCompletion, state };\n }\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport function awaitingDepositCompletion(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm {\n if (message.method === 'channels.on_chain_tx') {\n state.onOnChainTx?.(message.params.data.tx);\n return { handler: awaitingDepositCompletion, state };\n }\n if (message.method === 'channels.info') {\n if (['own_deposit_locked', 'deposit_locked'].includes(message.params.data.event)) {\n const callbacks: {\n [key: string]: Function | undefined;\n } = {\n own_deposit_locked: state.onOwnDepositLocked,\n deposit_locked: state.onDepositLocked,\n };\n callbacks[message.params.data.event]?.();\n return { handler: awaitingDepositCompletion, state };\n }\n }\n if (message.method === 'channels.update') {\n changeState(channel, message.params.data.state);\n state.resolve({ accepted: true, signedTx: message.params.data.state });\n return { handler: channelOpen };\n }\n if (message.method === 'channels.conflict') {\n state.resolve({\n accepted: false,\n errorCode: message.params.data.error_code,\n errorMessage: message.params.data.error_msg,\n });\n return { handler: channelOpen };\n }\n if (message.method === 'channels.info') {\n if (message.params.data.event === 'aborted_update') {\n state.resolve({ accepted: false });\n return { handler: channelOpen };\n }\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport async function awaitingNewContractTx(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): Promise<ChannelFsm | undefined> {\n if (message.method === 'channels.sign.update') {\n if (message.params.data.tx != null) {\n const signedTx = await state.sign(message.params.data.tx);\n send(channel, { jsonrpc: '2.0', method: 'channels.update', params: { tx: signedTx } });\n return { handler: awaitingNewContractCompletion, state };\n }\n const signedTx = await appendSignature(\n message.params.data.signed_tx,\n async (tx) => state.sign(tx),\n );\n if (typeof signedTx === 'string') {\n send(channel, { jsonrpc: '2.0', method: 'channels.update', params: { signed_tx: signedTx } });\n return { handler: awaitingNewContractCompletion, state };\n }\n if (typeof signedTx === 'number') {\n send(channel, { jsonrpc: '2.0', method: 'channels.update', params: { error: signedTx } });\n return { handler: awaitingNewContractCompletion, state };\n }\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport function awaitingNewContractCompletion(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm {\n const channelOptions = options.get(channel);\n if (message.method === 'channels.update') {\n const { round } = unpackTx(message.params.data.state, Tag.SignedTx).tx.encodedTx.tx;\n if (channelOptions?.role != null) {\n let role: null | 'initiatorId' | 'responderId' = null;\n if (channelOptions.role === 'initiator') role = 'initiatorId';\n if (channelOptions.role === 'responder') role = 'responderId';\n if (role != null) {\n const owner = channelOptions?.[role];\n changeState(channel, message.params.data.state);\n state.resolve({\n accepted: true,\n address: encodeContractAddress(owner, round),\n signedTx: message.params.data.state,\n });\n return { handler: channelOpen };\n }\n }\n }\n if (message.method === 'channels.conflict') {\n state.resolve({\n accepted: false,\n errorCode: message.params.data.error_code,\n errorMessage: message.params.data.error_msg,\n });\n return { handler: channelOpen };\n }\n if (message.method === 'channels.info') {\n if (message.params.data.event === 'aborted_update') {\n state.resolve({ accepted: false });\n return { handler: channelOpen };\n }\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport async function awaitingCallContractUpdateTx(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): Promise<ChannelFsm | undefined> {\n if (message.method === 'channels.sign.update') {\n if (message.params.data.tx != null) {\n const signedTx = await state.sign(\n message.params.data.tx,\n { updates: message.params.data.updates },\n );\n send(channel, { jsonrpc: '2.0', method: 'channels.update', params: { tx: signedTx } });\n return { handler: awaitingCallContractCompletion, state };\n }\n const signedTx = await appendSignature(\n message.params.data.signed_tx,\n async (tx) => state.sign(tx, { updates: message.params.data.updates }),\n );\n if (typeof signedTx === 'string') {\n send(channel, { jsonrpc: '2.0', method: 'channels.update', params: { signed_tx: signedTx } });\n return { handler: awaitingCallContractCompletion, state };\n }\n if (typeof signedTx === 'number') {\n send(channel, { jsonrpc: '2.0', method: 'channels.update', params: { error: signedTx } });\n return { handler: awaitingCallContractCompletion, state };\n }\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport async function awaitingCallContractForceProgressUpdate(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): Promise<ChannelFsm | undefined> {\n if (message.method === 'channels.sign.force_progress_tx') {\n const signedTx = await appendSignature(\n message.params.data.signed_tx,\n async (tx) => state.sign(tx, { updates: message.params.data.updates }),\n );\n send(\n channel,\n { jsonrpc: '2.0', method: 'channels.force_progress_sign', params: { signed_tx: signedTx } },\n );\n return { handler: awaitingForceProgressCompletion, state };\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport function awaitingForceProgressCompletion(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm {\n if (message.method === 'channels.on_chain_tx') {\n state.onOnChainTx?.(message.params.data.tx);\n emit(channel, 'onChainTx', message.params.data.tx, {\n info: message.params.data.info,\n type: message.params.data.type,\n });\n state.resolve({ accepted: true, tx: message.params.data.tx });\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport function awaitingCallContractCompletion(\n channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm {\n if (message.method === 'channels.update') {\n changeState(channel, message.params.data.state);\n state.resolve({ accepted: true, signedTx: message.params.data.state });\n return { handler: channelOpen };\n }\n if (message.method === 'channels.conflict') {\n state.resolve({\n accepted: false,\n errorCode: message.params.data.error_code,\n errorMessage: message.params.data.error_msg,\n });\n return { handler: channelOpen };\n }\n if (message.method === 'channels.info') {\n if (message.params.data.event === 'aborted_update') {\n state.resolve({ accepted: false });\n return { handler: channelOpen };\n }\n }\n return handleUnexpectedMessage(channel, message, state);\n}\n\nexport function awaitingCallsPruned(\n _channels: Channel[],\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm {\n if (message.method === 'channels.calls_pruned.reply') {\n state.resolve();\n return { handler: channelOpen };\n }\n state.reject(new UnexpectedChannelMessageError('Unexpected message received'));\n return { handler: channelClosed };\n}\n\nexport function channelClosed(\n _channel: Channel,\n message: ChannelMessage,\n state: ChannelState,\n): ChannelFsm {\n if (state == null) return { handler: channelClosed };\n if (message.params.data.event === 'closing') return { handler: channelClosed, state };\n if (message.params.data.info === 'channel_closed') {\n state.closeTx = message.params.data.tx;\n return { handler: channelClosed, state };\n }\n if (message.params.data.event === 'closed_confirmed') {\n state.resolve(state.closeTx);\n return { handler: channelClosed };\n }\n return { handler: channelClosed, state };\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2018 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\nimport BigNumber from 'bignumber.js';\nimport { snakeToPascal } from '../utils/string';\nimport { buildTx, unpackTx } from '../tx/builder';\nimport { MIN_GAS_PRICE, Tag } from '../tx/builder/constants';\nimport * as handlers from './handlers';\nimport {\n eventEmitters,\n status as channelStatus,\n state as channelState,\n initialize,\n enqueueAction,\n send,\n channelId,\n call,\n disconnect as channelDisconnect,\n fsmId as channelFsmId,\n SignTx,\n ChannelOptions,\n ChannelState,\n} from './internal';\nimport { UnknownChannelStateError, ChannelError } from '../utils/errors';\nimport { Encoded } from '../utils/encoder';\nimport { ContractCallReturnType } from '../apis/node';\nimport { pause } from '../utils/other';\n\nfunction snakeToPascalObjKeys<Type>(obj: object): Type {\n return Object.entries(obj).reduce((result, [key, val]) => ({\n ...result,\n [snakeToPascal(key)]: val,\n }), {}) as Type;\n}\n\ntype EventCallback = (...args: any[]) => void;\n\ninterface CallContractOptions {\n amount?: number | BigNumber;\n callData?: Encoded.ContractBytearray;\n abiVersion?: number;\n contract?: Encoded.ContractAddress;\n returnValue?: any;\n gasUsed?: number | BigNumber;\n gasPrice?: number | BigNumber;\n height?: number;\n callerNonce?: number;\n log?: any;\n returnType?: ContractCallReturnType;\n}\n\ninterface Contract {\n abiVersion: number;\n active: boolean;\n deposit: number | BigNumber;\n id: string;\n ownerId: string;\n referrerIds: string[];\n vmVersion: number;\n}\n\n/**\n * Channel\n * @example\n * ```js\n * await Channel.initialize({\n * url: 'ws://localhost:3001',\n * role: 'initiator'\n * initiatorId: 'ak_Y1NRjHuoc3CGMYMvCmdHSBpJsMDR6Ra2t5zjhRcbtMeXXLpLH',\n * responderId: 'ak_V6an1xhec1xVaAhLuak7QoEbi6t7w5hEtYWp9bMKaJ19i6A9E',\n * initiatorAmount: 1e18,\n * responderAmount: 1e18,\n * pushAmount: 0,\n * channelReserve: 0,\n * ttl: 1000,\n * host: 'localhost',\n * port: 3002,\n * lockPeriod: 10,\n * async sign (tag, tx) => await account.signTransaction(tx)\n * })\n * ```\n */\nexport default class Channel {\n /**\n * @param options - Channel params\n * @param options.url - Channel url (for example: \"ws://localhost:3001\")\n * @param options.role - Participant role (\"initiator\" or \"responder\")\n * @param options.initiatorId - Initiator's public key\n * @param options.responderId - Responder's public key\n * @param options.pushAmount - Initial deposit in favour of the responder by the initiator\n * @param options.initiatorAmount - Amount of coins the initiator has committed to\n * the channel\n * @param options.responderAmount - Amount of coins the responder has committed to\n * the channel\n * @param options.channelReserve - The minimum amount both peers need to maintain\n * @param options.ttl - Minimum block height to include the channel_create_tx\n * @param options.host - Host of the responder's node\n * @param options.port - The port of the responders node\n * @param options.lockPeriod - Amount of blocks for disputing a solo close\n * @param options.existingChannelId - Existing channel id (required if reestablishing a\n * channel)\n * @param options.offchainTx - Offchain transaction (required if reestablishing\n * a channel)\n * @param options.timeoutIdle - The time waiting for a new event to be initiated\n * (default: 600000)\n * @param options.timeoutFundingCreate - The time waiting for the initiator to produce\n * the create channel transaction after the noise session had been established (default: 120000)\n * @param options.timeoutFundingSign - The time frame the other client has to sign an\n * off-chain update after our client had initiated and signed it. This applies only for double\n * signed on-chain intended updates: channel create transaction, deposit, withdrawal and etc.\n * (default: 120000)\n * @param options.timeoutFundingLock - The time frame the other client has to confirm an\n * on-chain transaction reaching maturity (passing minimum depth) after the local node has\n * detected this. This applies only for double signed on-chain intended updates: channel create\n * transaction, deposit, withdrawal and etc. (default: 360000)\n * @param options.timeoutSign - The time frame the client has to return a signed\n * off-chain update or to decline it. This applies for all off-chain updates (default: 500000)\n * @param options.timeoutAccept - The time frame the other client has to react to an\n * event. This applies for all off-chain updates that are not meant to land on-chain, as well as\n * some special cases: opening a noise connection, mutual closing acknowledgement and\n * reestablishing an existing channel (default: 120000)\n * @param options.timeoutInitialized - the time frame the responder has to accept an\n * incoming noise session. Applicable only for initiator (default: timeout_accept's value)\n * @param options.timeoutAwaitingOpen - The time frame the initiator has to start an\n * outgoing noise session to the responder's node. Applicable only for responder (default:\n * timeout_idle's value)\n * @param options.debug=false - Log websocket communication\n * @param options.sign - Function which verifies and signs transactions\n */\n static async initialize(options: ChannelOptions): Promise<Channel> {\n const channel = new Channel();\n await initialize(\n channel,\n options.existingFsmId != null ? handlers.awaitingReconnection : handlers.awaitingConnection,\n handlers.channelOpen,\n options,\n );\n return channel;\n }\n\n /**\n * Register event listener function\n *\n * Possible events:\n *\n * - \"error\"\n * - \"onChainTx\"\n * - \"ownWithdrawLocked\"\n * - \"withdrawLocked\"\n * - \"ownDepositLocked\"\n * - \"depositLocked\"\n *\n * TODO: the event list looks outdated\n *\n * @param eventName - Event name\n * @param callback - Callback function\n */\n // TODO define specific callback type depending on the event name\n on(eventName: string, callback: EventCallback): void {\n const eventEmitter = eventEmitters.get(this);\n if (eventEmitter == null) throw new UnknownChannelStateError();\n eventEmitter.on(eventName, callback);\n }\n\n /**\n * Remove event listener function\n * @param eventName - Event name\n * @param callback - Callback function\n */\n off(eventName: string, callback: EventCallback): void {\n const eventEmitter = eventEmitters.get(this);\n if (eventEmitter == null) throw new UnknownChannelStateError();\n eventEmitter.removeListener(eventName, callback);\n }\n\n /**\n * Close the connection\n */\n disconnect(): void {\n return channelDisconnect(this);\n }\n\n /**\n * Get current status\n *\n */\n status(): string {\n const status = channelStatus.get(this);\n if (status == null) throw new UnknownChannelStateError();\n return status;\n }\n\n /**\n * Get current state\n */\n async state(): Promise<ChannelState> {\n return snakeToPascalObjKeys(await call(this, 'channels.get.offchain_state', {}));\n }\n\n /**\n * Get current round\n *\n * If round cannot be determined (for example when channel has not been opened)\n * it will return `null`.\n *\n */\n round(): number | null {\n const state = channelState.get(this);\n if (state == null) {\n return null;\n }\n const { txType, tx } = unpackTx(state, Tag.SignedTx).tx.encodedTx;\n switch (txType) {\n case Tag.ChannelCreateTx:\n return 1;\n case Tag.ChannelOffChainTx:\n case Tag.ChannelWithdrawTx:\n case Tag.ChannelDepositTx:\n return tx.round;\n default:\n return null;\n }\n }\n\n /**\n * Get channel id\n *\n */\n id(): string {\n const id = channelId.get(this);\n if (id == null) throw new ChannelError('Channel is not initialized');\n return id;\n }\n\n /**\n * Get channel's fsm id\n *\n */\n fsmId(): string {\n const id = channelFsmId.get(this);\n if (id == null) throw new ChannelError('Channel is not initialized');\n return id;\n }\n\n /**\n * Trigger a transfer update\n *\n * The transfer update is moving coins from one channel account to another.\n * The update is a change to be applied on top of the latest state.\n *\n * Sender and receiver are the channel parties. Both the initiator and responder\n * can take those roles. Any public key outside the channel is considered invalid.\n *\n * @param from - Sender's public address\n * @param to - Receiver's public address\n * @param amount - Transaction amount\n * @param sign - Function which verifies and signs offchain transaction\n * @param metadata - Metadata\n\n * @example\n * ```js\n * channel.update(\n * 'ak_Y1NRjHuoc3CGMYMvCmdHSBpJsMDR6Ra2t5zjhRcbtMeXXLpLH',\n * 'ak_V6an1xhec1xVaAhLuak7QoEbi6t7w5hEtYWp9bMKaJ19i6A9E',\n * 10,\n * async (tx) => await account.signTransaction(tx)\n * ).then(({ accepted, signedTx }) =>\n * if (accepted) {\n * console.log('Update has been accepted')\n * }\n * )\n * ```\n */\n async update(\n from: Encoded.AccountAddress,\n to: Encoded.AccountAddress,\n amount: number | BigNumber,\n sign: SignTx,\n metadata: string[] = [],\n ): Promise<{\n accepted: boolean;\n signedTx?: Encoded.Transaction;\n errorCode?: number;\n errorMessage?: string;\n }> {\n return new Promise((resolve, reject) => {\n enqueueAction(\n this,\n (_channel, state) => state?.handler === handlers.channelOpen,\n (channel) => {\n send(channel, {\n jsonrpc: '2.0',\n method: 'channels.update.new',\n params: {\n from, to, amount, meta: metadata,\n },\n });\n return {\n handler: handlers.awaitingOffChainTx,\n state: {\n resolve,\n reject,\n sign,\n },\n };\n },\n );\n });\n }\n\n /**\n * Get proof of inclusion\n *\n * If a certain address of an account or a contract is not found\n * in the state tree - the response is an error.\n *\n * @param addresses - Addresses\n * @param addresses.accounts - List of account addresses to include in poi\n * @param addresses.contracts - List of contract addresses to include in poi\n * @example\n * ```js\n * channel.poi({\n * accounts: [\n * 'ak_Y1NRjHuoc3CGMYMvCmdHSBpJsMDR6Ra2t5zjhRcbtMeXXLpLH',\n * 'ak_V6an1xhec1xVaAhLuak7QoEbi6t7w5hEtYWp9bMKaJ19i6A9E'\n * ],\n * contracts: ['ct_2dCUAWYZdrWfACz3a2faJeKVTVrfDYxCQHCqAt5zM15f3u2UfA']\n * }).then(poi => console.log(poi))\n * ```\n */\n async poi(\n { accounts, contracts }: {\n accounts: Encoded.AccountAddress[];\n contracts?: Encoded.ContractAddress[];\n },\n ): Promise<Encoded.Poi> {\n return (await call(this, 'channels.get.poi', { accounts, contracts })).poi;\n }\n\n /**\n * Get balances\n *\n * The accounts param contains a list of addresses to fetch balances of.\n * Those can be either account balances or a contract ones, encoded as an account addresses.\n *\n * If a certain account address had not being found in the state tree - it is simply\n * skipped in the response.\n *\n * @param accounts - List of addresses to fetch balances from\n * @example\n * ```js\n * channel.balances([\n * 'ak_Y1NRjHuoc3CGMYMvCmdHSBpJsMDR6Ra2t5zjhRcbtMeXXLpLH',\n * 'ak_V6an1xhec1xVaAhLuak7QoEbi6t7w5hEtYWp9bMKaJ19i6A9E'\n * 'ct_2dCUAWYZdrWfACz3a2faJeKVTVrfDYxCQHCqAt5zM15f3u2UfA'\n * ]).then(balances =>\n * console.log(balances['ak_Y1NRjHuoc3CGMYMvCmdHSBpJsMDR6Ra2t5zjhRcbtMeXXLpLH'])\n * )\n * ```\n */\n async balances(\n accounts: Encoded.AccountAddress[],\n ): Promise<{ [key: Encoded.AccountAddress]: string }> {\n return Object.fromEntries(\n (await call(this, 'channels.get.balances', { accounts }))\n .map((item: {\n account: Encoded.AccountAddress;\n balance: string;\n }) => [item.account, item.balance]),\n );\n }\n\n /**\n * Leave channel\n *\n * It is possible to leave a channel and then later reestablish the channel\n * off-chain state and continue operation. When a leave method is called,\n * the channel fsm passes it on to the peer fsm, reports the current mutually\n * signed state and then terminates.\n *\n * The channel can be reestablished by instantiating another Channel instance\n * with two extra params: existingChannelId and offchainTx (returned from leave\n * method as channelId and signedTx respectively).\n *\n * @example\n * ```js\n * channel.leave().then(({ channelId, signedTx }) => {\n * console.log(channelId)\n * console.log(signedTx)\n * })\n * ```\n */\n async leave(): Promise<{ channelId: string; signedTx: Encoded.Transaction }> {\n return new Promise((resolve, reject) => {\n enqueueAction(\n this,\n (channel, state) => state?.handler === handlers.channelOpen,\n (channel) => {\n send(channel, { jsonrpc: '2.0', method: 'channels.leave', params: {} });\n return {\n handler: handlers.awaitingLeave,\n state: { resolve, reject },\n };\n },\n );\n });\n }\n\n /**\n * Trigger mutual close\n *\n * At any moment after the channel is opened, a closing procedure can be triggered.\n * This can be done by either of the parties. The process is similar to the off-chain updates.\n *\n * @param sign - Function which verifies and signs mutual close transaction\n * @example\n * ```js\n * channel.shutdown(\n * async (tx) => await account.signTransaction(tx)\n * ).then(tx => console.log('on_chain_tx', tx))\n * ```\n */\n async shutdown(sign: Function): Promise<Encoded.Transaction> {\n return new Promise((resolve, reject) => {\n enqueueAction(\n this,\n (_channel, state) => state?.handler === handlers.channelOpen,\n (channel) => {\n send(channel, { jsonrpc: '2.0', method: 'channels.shutdown', params: {} });\n return {\n handler: handlers.awaitingShutdownTx,\n state: {\n sign,\n resolve,\n reject,\n },\n };\n },\n );\n });\n }\n\n /**\n * Withdraw coins from the channel\n *\n * After the channel had been opened any of the participants can initiate a withdrawal.\n * The process closely resembles the update. The most notable difference is that the\n * transaction has been co-signed: it is channel_withdraw_tx and after the procedure\n * is finished - it is being posted on-chain.\n *\n * Any of the participants can initiate a withdrawal. The only requirements are:\n *\n * - Channel is already opened\n * - No off-chain update/deposit/withdrawal is currently being performed\n * - Channel is not being closed or in a solo closing state\n * - The withdrawal amount must be equal to or greater than zero, and cannot exceed\n * the available balance on the channel (minus the channel_reserve)\n *\n * After the other party had signed the withdraw transaction, the transaction is posted\n * on-chain and onOnChainTx callback is called with on-chain transaction as first argument.\n * After computing transaction hash it can be tracked on the chain: entering the mempool,\n * block inclusion and a number of confirmations.\n *\n * After the minimum_depth block confirmations onOwnWithdrawLocked callback is called\n * (without any arguments).\n *\n * When the other party had confirmed that the block height needed is reached\n * onWithdrawLocked callback is called (without any arguments).\n *\n * @param amount - Amount of coins to withdraw\n * @param sign - Function which verifies and signs withdraw transaction\n * @param callbacks - Callbacks\n * @param callbacks.onOnChainTx - Called when withdraw transaction has been posted\n * on chain\n * @param callbacks.onOwnWithdrawLocked\n * @param callbacks.onWithdrawLocked\n * @example\n * ```js\n * channel.withdraw(\n * 100,\n * async (tx) => await account.signTransaction(tx),\n * { onOnChainTx: (tx) => console.log('on_chain_tx', tx) }\n * ).then(({ accepted, signedTx }) => {\n * if (accepted) {\n * console.log('Withdrawal has been accepted')\n * } else {\n * console.log('Withdrawal has been rejected')\n * }\n * })\n * ```\n */\n async withdraw(\n amount: number | BigNumber,\n sign: SignTx,\n { onOnChainTx, onOwnWithdrawLocked, onWithdrawLocked }:\n Pick<ChannelState, 'onOnChainTx' | 'onOwnWithdrawLocked' | 'onWithdrawLocked'> = {},\n ): Promise<{ accepted: boolean; signedTx: Encoded.Transaction }> {\n return new Promise((resolve, reject) => {\n enqueueAction(\n this,\n (_channel, state) => state?.handler === handlers.channelOpen,\n (channel) => {\n send(channel, { jsonrpc: '2.0', method: 'channels.withdraw', params: { amount } });\n return {\n handler: handlers.awaitingWithdrawTx,\n state: {\n sign,\n resolve,\n reject,\n onOnChainTx,\n onOwnWithdrawLocked,\n onWithdrawLocked,\n },\n };\n },\n );\n });\n }\n\n /**\n * Deposit coins into the channel\n *\n * After the channel had been opened any of the participants can initiate a deposit.\n * The process closely resembles the update. The most notable difference is that the\n * transaction has been co-signed: it is channel_deposit_tx and after the procedure\n * is finished - it is being posted on-chain.\n *\n * Any of the participants can initiate a deposit. The only requirements are:\n *\n * - Channel is already opened\n * - No off-chain update/deposit/withdrawal is currently being performed\n * - Channel is not being closed or in a solo closing state\n * - The deposit amount must be equal to or greater than zero, and cannot exceed\n * the available balance on the channel (minus the channel_reserve)\n *\n * After the other party had signed the deposit transaction, the transaction is posted\n * on-chain and onOnChainTx callback is called with on-chain transaction as first argument.\n * After computing transaction hash it can be tracked on the chain: entering the mempool,\n * block inclusion and a number of confirmations.\n *\n * After the minimum_depth block confirmations onOwnDepositLocked callback is called\n * (without any arguments).\n *\n * When the other party had confirmed that the block height needed is reached\n * onDepositLocked callback is called (without any arguments).\n *\n * @param amount - Amount of coins to deposit\n * @param sign - Function which verifies and signs deposit transaction\n * @param callbacks - Callbacks\n * @param callbacks.onOnChainTx - Called when deposit transaction has been posted\n * on chain\n * @param callbacks.onOwnDepositLocked\n * @param callbacks.onDepositLocked\n * @example\n * ```js\n * channel.deposit(\n * 100,\n * async (tx) => await account.signTransaction(tx),\n * { onOnChainTx: (tx) => console.log('on_chain_tx', tx) }\n * ).then(({ accepted, state }) => {\n * if (accepted) {\n * console.log('Deposit has been accepted')\n * console.log('The new state is:', state)\n * } else {\n * console.log('Deposit has been rejected')\n * }\n * })\n * ```\n */\n async deposit(\n amount: number | BigNumber,\n sign: SignTx,\n { onOnChainTx, onOwnDepositLocked, onDepositLocked }:\n Pick<ChannelState, 'onOnChainTx' | 'onOwnDepositLocked' | 'onDepositLocked'> = {},\n ): Promise<{ accepted: boolean; state: ChannelState }> {\n return new Promise((resolve, reject) => {\n enqueueAction(\n this,\n (_channel, state) => state?.handler === handlers.channelOpen,\n (channel) => {\n send(channel, { jsonrpc: '2.0', method: 'channels.deposit', params: { amount } });\n return {\n handler: handlers.awaitingDepositTx,\n state: {\n sign,\n resolve,\n reject,\n onOnChainTx,\n onOwnDepositLocked,\n onDepositLocked,\n },\n };\n },\n );\n });\n }\n\n /**\n * Trigger create contract update\n *\n * The create contract update is creating a contract inside the channel's internal state tree.\n * The update is a change to be applied on top of the latest state.\n *\n * That would create a contract with the poster being the owner of it. Poster commits initially\n * a deposit amount of coins to the new contract.\n *\n * @param options - Options\n * @param options.code - Api encoded compiled AEVM byte code\n * @param options.callData - Api encoded compiled AEVM call data for the code\n * @param options.deposit - Initial amount the owner of the contract commits to it\n * @param options.vmVersion - Version of the Virtual Machine\n * @param options.abiVersion - Version of the Application Binary Interface\n * @param sign - Function which verifies and signs create contract transaction\n * @example\n * ```js\n * channel.createContract({\n * code: 'cb_HKtpipK4aCgYb17wZ...',\n * callData: 'cb_1111111111111111...',\n * deposit: 10,\n * vmVersion: 3,\n * abiVersion: 1\n * }).then(({ accepted, signedTx, address }) => {\n * if (accepted) {\n * console.log('New contract has been created')\n * console.log('Contract address:', address)\n * } else {\n * console.log('New contract has been rejected')\n * }\n * })\n * ```\n */\n async createContract(\n {\n code, callData, deposit, vmVersion, abiVersion,\n }: {\n code: Encoded.ContractBytearray;\n callData: Encoded.ContractBytearray;\n deposit: number | BigNumber;\n vmVersion: number;\n abiVersion: number;\n },\n sign: SignTx,\n ): Promise<{\n accepted: boolean; signedTx: Encoded.Transaction; address: Encoded.ContractAddress;\n }> {\n return new Promise((resolve, reject) => {\n enqueueAction(\n this,\n (_channel, state) => state?.handler === handlers.channelOpen,\n (channel) => {\n send(channel, {\n jsonrpc: '2.0',\n method: 'channels.update.new_contract',\n params: {\n code,\n call_data: callData,\n deposit,\n vm_version: vmVersion,\n abi_version: abiVersion,\n },\n });\n return {\n handler: handlers.awaitingNewContractTx,\n state: {\n sign,\n resolve,\n reject,\n },\n };\n },\n );\n });\n }\n\n /**\n * Trigger call a contract update\n *\n * The call contract update is calling a preexisting contract inside the channel's\n * internal state tree. The update is a change to be applied on top of the latest state.\n *\n * That would call a contract with the poster being the caller of it. Poster commits\n * an amount of coins to the contract.\n *\n * The call would also create a call object inside the channel state tree. It contains\n * the result of the contract call.\n *\n * It is worth mentioning that the gas is not consumed, because this is an off-chain\n * contract call. It would be consumed if it were an on-chain one. This could happen\n * if a call with a similar computation amount is to be forced on-chain.\n *\n * @param options - Options\n * @param options.amount - Amount the caller of the contract commits to it\n * @param options.callData - ABI encoded compiled AEVM call data for the code\n * @param options.contract - Address of the contract to call\n * @param options.abiVersion - Version of the ABI\n * @param sign - Function which verifies and signs contract call transaction\n * @example\n * ```js\n * channel.callContract({\n * contract: 'ct_9sRA9AVE4BYTAkh5RNfJYmwQe1NZ4MErasQLXZkFWG43TPBqa',\n * callData: 'cb_1111111111111111...',\n * amount: 0,\n * abiVersion: 1\n * }).then(({ accepted, signedTx }) => {\n * if (accepted) {\n * console.log('Contract called succesfully')\n * } else {\n * console.log('Contract call has been rejected')\n * }\n * })\n * ```\n */\n async callContract(\n {\n amount, callData, contract, abiVersion,\n }: CallContractOptions,\n sign: SignTx,\n ): Promise<{ accepted: boolean; signedTx: Encoded.Transaction }> {\n return new Promise((resolve, reject) => {\n enqueueAction(\n this,\n (_channel, state) => state?.handler === handlers.channelOpen,\n (channel) => {\n send(channel, {\n jsonrpc: '2.0',\n method: 'channels.update.call_contract',\n params: {\n amount,\n call_data: callData,\n contract_id: contract,\n abi_version: abiVersion,\n },\n });\n return {\n handler: handlers.awaitingCallContractUpdateTx,\n state: { resolve, reject, sign },\n };\n },\n );\n });\n }\n\n /**\n * Trigger a force progress contract call\n * This call is going on-chain\n * @param options - Options\n * @param options.amount - Amount the caller of the contract commits to it\n * @param options.callData - ABI encoded compiled AEVM call data for the code\n * @param options.contract - Address of the contract to call\n * @param options.abiVersion - Version of the ABI\n * @param options.gasPrice=1000000000]\n * @param options.gasLimit=1000000]\n * @param sign - Function which verifies and signs contract force progress transaction\n * @param callbacks - Callbacks\n * @example\n * ```js\n * channel.forceProgress({\n * contract: 'ct_9sRA9AVE4BYTAkh5RNfJYmwQe1NZ4MErasQLXZkFWG43TPBqa',\n * callData: 'cb_1111111111111111...',\n * amount: 0,\n * abiVersion: 1,\n * gasPrice: 1000005554\n * }).then(({ accepted, signedTx }) => {\n * if (accepted) {\n * console.log('Contract force progress call successful')\n * } else {\n * console.log('Contract force progress call has been rejected')\n * }\n * })\n * ```\n */\n async forceProgress(\n {\n amount, callData, contract, abiVersion, gasLimit = 1000000, gasPrice = MIN_GAS_PRICE,\n }: {\n amount: number;\n callData: Encoded.ContractBytearray;\n contract: Encoded.ContractAddress;\n abiVersion: number;\n gasLimit?: number;\n gasPrice?: number;\n },\n sign: SignTx,\n { onOnChainTx }: Pick<ChannelState, 'onOnChainTx'> = {},\n ): Promise<{\n accepted: boolean;\n signedTx: Encoded.Transaction;\n tx: Encoded.Transaction | Uint8Array;\n }> {\n return new Promise((resolve, reject) => {\n enqueueAction(\n this,\n (_channel, state) => state?.handler === handlers.channelOpen,\n (channel) => {\n send(channel, {\n jsonrpc: '2.0',\n method: 'channels.force_progress',\n params: {\n amount,\n call_data: callData,\n contract_id: contract,\n abi_version: abiVersion,\n gas_price: gasPrice,\n gas: gasLimit,\n },\n });\n return {\n handler: handlers.awaitingCallContractForceProgressUpdate,\n state: {\n resolve, reject, sign, onOnChainTx,\n },\n };\n },\n );\n });\n }\n\n /**\n * Call contract using dry-run\n *\n * In order to get the result of a potential contract call, one might need to\n * dry-run a contract call. It takes the exact same arguments as a call would\n * and returns the call object.\n *\n * The call is executed in the channel's state, but it does not impact the state\n * whatsoever. It uses as an environment the latest channel's state and the current\n * top of the blockchain as seen by the node.\n *\n * @param options - Options\n * @param options.amount - Amount the caller of the contract commits to it\n * @param options.callData - ABI encoded compiled AEVM call data for the code\n * @param options.contract - Address of the contract to call\n * @param options.abiVersion - Version of the ABI\n * @example\n * ```js\n * channel.callContractStatic({\n * contract: 'ct_9sRA9AVE4BYTAkh5RNfJYmwQe1NZ4MErasQLXZkFWG43TPBqa',\n * callData: 'cb_1111111111111111...',\n * amount: 0,\n * abiVersion: 1\n * }).then(({ returnValue, gasUsed }) => {\n * console.log('Returned value:', returnValue)\n * console.log('Gas used:', gasUsed)\n * })\n * ```\n */\n async callContractStatic(\n {\n amount, callData, contract, abiVersion,\n }: {\n amount: number;\n callData: Encoded.ContractBytearray;\n contract: Encoded.ContractAddress;\n abiVersion: number;\n },\n ): Promise<CallContractOptions> {\n return snakeToPascalObjKeys(await call(this, 'channels.dry_run.call_contract', {\n amount,\n call_data: callData,\n contract_id: contract,\n abi_version: abiVersion,\n }));\n }\n\n /**\n * Get contract call result\n *\n * The combination of a caller, contract and a round of execution determines the\n * contract call. Providing an incorrect set of those results in an error response.\n *\n * @param options - Options\n * @param options.caller - Address of contract caller\n * @param options.contract - Address of the contract\n * @param options.round - Round when contract was called\n * @example\n * ```js\n * channel.getContractCall({\n * caller: 'ak_Y1NRjHuoc3CGMYMvCmdHSBpJsMDR6Ra2t5zjhRcbtMeXXLpLH',\n * contract: 'ct_9sRA9AVE4BYTAkh5RNfJYmwQe1NZ4MErasQLXZkFWG43TPBqa',\n * round: 3\n * }).then(({ returnType, returnValue }) => {\n * if (returnType === 'ok') console.log(returnValue)\n * })\n * ```\n */\n async getContractCall(\n { caller, contract, round }: {\n caller: Encoded.AccountAddress;\n contract: Encoded.ContractAddress;\n round: number;\n },\n ): Promise<{\n returnType: ContractCallReturnType;\n returnValue: string;\n gasPrice: number | BigNumber;\n gasUsed: number | BigNumber;\n height: number;\n log: string;\n }> {\n return snakeToPascalObjKeys(\n await call(this, 'channels.get.contract_call', {\n caller_id: caller,\n contract_id: contract,\n round,\n }),\n );\n }\n\n /**\n * Get the latest contract state\n *\n * @param contract - Address of the contract\n * @example\n * ```js\n * channel.getContractState(\n * 'ct_9sRA9AVE4BYTAkh5RNfJYmwQe1NZ4MErasQLXZkFWG43TPBqa'\n * ).then(({ contract }) => {\n * console.log('deposit:', contract.deposit)\n * })\n * ```\n */\n async getContractState(\n contract: Encoded.ContractAddress,\n ): Promise<{ contract: Contract; contractState: object }> {\n const result = await call(this, 'channels.get.contract', { pubkey: contract });\n return snakeToPascalObjKeys({\n ...result,\n contract: snakeToPascalObjKeys(result.contract),\n });\n }\n\n /**\n * Clean up all locally stored contract calls\n *\n * Contract calls are kept locally in order for the participant to be able to look them up.\n * They consume memory and in order for the participant to free it - one can prune all messages.\n * This cleans up all locally stored contract calls and those will no longer be available for\n * fetching and inspection.\n */\n async cleanContractCalls(): Promise<void> {\n return new Promise((resolve, reject) => {\n enqueueAction(\n this,\n (_channel, state) => state?.handler === handlers.channelOpen,\n (channel) => {\n send(channel, {\n jsonrpc: '2.0',\n method: 'channels.clean_contract_calls',\n params: {},\n });\n return {\n handler: handlers.awaitingCallsPruned,\n state: { resolve, reject },\n };\n },\n );\n });\n }\n\n /**\n * Send generic message\n *\n * If message is an object it will be serialized into JSON string\n * before sending.\n *\n * If there is ongoing update that has not yet been finished the message\n * will be sent after that update is finalized.\n *\n * @param message - Message\n * @param recipient - Address of the recipient\n * @example\n * ```js\n * channel.sendMessage(\n * 'hello world',\n * 'ak_Y1NRjHuoc3CGMYMvCmdHSBpJsMDR6Ra2t5zjhRcbtMeXXLpLH'\n * )\n * ```\n */\n async sendMessage(\n message: string | object,\n recipient: Encoded.AccountAddress,\n ): Promise<void> {\n const info = typeof message === 'object' ? JSON.stringify(message) : message;\n if (this.status() === 'connecting') {\n await new Promise<void>((resolve) => {\n const onStatusChanged = (status: string): void => {\n if (status === 'connecting') return;\n resolve();\n this.off('statusChanged', onStatusChanged);\n };\n this.on('statusChanged', onStatusChanged);\n });\n // For some reason we can't immediately send a message when connection is\n // established. Thus we wait 500ms which seems to work.\n await pause(500);\n }\n send(this, {\n jsonrpc: '2.0',\n method: 'channels.message',\n params: { info, to: recipient },\n });\n }\n\n static async reconnect(options: ChannelOptions, txParams: any): Promise<Channel> {\n const { sign } = options;\n\n return Channel.initialize({\n ...options,\n reconnectTx: await sign('reconnect', buildTx(txParams, Tag.ChannelClientReconnectTx).tx),\n });\n }\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\nimport BrowserConnection from './connection/Browser';\n\n/**\n * Browser connection proxy\n * Provide functionality to easily forward messages from one connection to another and back\n * @category aepp wallet communication\n * @param con1 - first connection\n * @param con2 - second connection\n * @returns a function to stop proxying\n */\nexport default (con1: BrowserConnection, con2: BrowserConnection): () => void => {\n con1.connect((msg: any) => con2.sendMessage(msg), () => con2.disconnect());\n con2.connect((msg: any) => con1.sendMessage(msg), () => con1.disconnect());\n\n return () => {\n con1.disconnect();\n con2.disconnect();\n };\n};\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\nimport { AlreadyConnectedError, NoWalletConnectedError } from '../../utils/errors';\n\n/**\n * Browser connection base interface\n * @category aepp wallet communication\n */\nexport default abstract class BrowserConnection {\n debug: boolean;\n\n protected constructor({ debug = false }: { debug?: boolean }) {\n this.debug = debug;\n }\n\n /**\n * Connect\n * @param onMessage - Message handler\n * @param onDisconnect - trigger when runtime connection in closed\n */\n connect(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onMessage: (message: any, origin: string, source: any) => void,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onDisconnect: () => void,\n ): void {\n if (this.isConnected()) throw new AlreadyConnectedError('You already connected');\n }\n\n /**\n * Disconnect\n */\n disconnect(): void {\n if (!this.isConnected()) throw new NoWalletConnectedError('You dont have connection. Please connect before');\n }\n\n /**\n * Receive message\n */\n protected receiveMessage(message: any): void {\n if (this.debug) console.log('Receive message:', message);\n }\n\n /**\n * Send message\n */\n sendMessage(message: any): void {\n if (this.debug) console.log('Send message:', message);\n }\n\n /**\n * Check if connected\n * @returns Is connected\n */\n abstract isConnected(): boolean;\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\nimport BrowserConnection from './Browser';\nimport { MESSAGE_DIRECTION } from '../schema';\nimport { InternalError, RpcConnectionError } from '../../utils/errors';\n\nexport type ImplPostMessage = Pick<Window, 'addEventListener' | 'removeEventListener' | 'postMessage'>;\n\n/**\n * Browser window Post Message connector module\n * @category aepp wallet communication\n */\nexport default class BrowserWindowMessageConnection extends BrowserConnection {\n origin?: string;\n\n sendDirection?: MESSAGE_DIRECTION;\n\n receiveDirection: MESSAGE_DIRECTION;\n\n listener?: (this: Window, ev: MessageEvent<any>) => void;\n\n #onDisconnect?: () => void;\n\n #target?: ImplPostMessage;\n\n #self: ImplPostMessage;\n\n /**\n * @param options - Options\n * @param options.target Target window for message\n * @param options.self Host window for message\n * @param options.origin Origin of receiver\n * @param options.sendDirection Wrapping messages into additional struct\n * `({ type: 'to_aepp' || 'to_waellet', data })`\n * Used for handling messages between content script and page\n * @param options.receiveDirection Unwrapping messages from additional struct\n */\n constructor({\n target,\n self = window,\n origin,\n sendDirection,\n receiveDirection = MESSAGE_DIRECTION.to_aepp,\n ...options\n }: {\n target?: ImplPostMessage;\n self?: ImplPostMessage;\n origin?: string;\n sendDirection?: MESSAGE_DIRECTION;\n receiveDirection?: MESSAGE_DIRECTION;\n debug?: boolean;\n } = {}) {\n super(options);\n this.#target = target;\n this.#self = self;\n this.origin = origin;\n this.sendDirection = sendDirection;\n this.receiveDirection = receiveDirection;\n }\n\n isConnected(): boolean {\n return this.listener != null;\n }\n\n connect(\n onMessage: (message: any, origin: string, source: MessageEventSource | null) => void,\n onDisconnect: () => void,\n ): void {\n super.connect(onMessage, onDisconnect);\n this.listener = (message: MessageEvent<any>) => {\n // TODO: strict validate origin and source instead of checking message structure\n if (\n typeof message.data !== 'object'\n || (message.data.jsonrpc ?? message.data.data?.jsonrpc) !== '2.0'\n ) return;\n if (this.origin != null && this.origin !== message.origin) return;\n if (this.#target != null && this.#target !== message.source) return;\n this.receiveMessage(message);\n let { data } = message;\n if (data.type != null) {\n if (message.data.type !== this.receiveDirection) return;\n data = data.data;\n }\n onMessage(data, message.origin, message.source);\n };\n this.#self.addEventListener('message', this.listener);\n this.#onDisconnect = onDisconnect;\n }\n\n disconnect(): void {\n super.disconnect();\n if (this.listener == null || this.#onDisconnect == null) {\n throw new InternalError('Expected to not happen, required for TS');\n }\n this.#self.removeEventListener('message', this.listener);\n delete this.listener;\n this.#onDisconnect();\n this.#onDisconnect = undefined;\n }\n\n sendMessage(msg: any): void {\n if (this.#target == null) throw new RpcConnectionError('Can\\'t send messages without target');\n const message = this.sendDirection != null ? { type: this.sendDirection, data: msg } : msg;\n super.sendMessage(message);\n this.#target.postMessage(message, this.origin ?? '*');\n }\n}\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\nimport BrowserConnection from './connection/Browser';\nimport BrowserWindowMessageConnection from './connection/BrowserWindowMessage';\nimport { MESSAGE_DIRECTION, METHODS } from './schema';\nimport { UnsupportedPlatformError } from '../utils/errors';\n\ninterface Wallet {\n info: {\n id: string;\n type: string;\n origin: string;\n };\n getConnection: () => BrowserWindowMessageConnection;\n}\ninterface Wallets { [key: string]: Wallet }\n\n/**\n * A function to detect available wallets\n * @category aepp wallet communication\n * @param connection - connection to use to detect wallets\n * @param onDetected - call-back function which trigger on new wallet\n * @returns a function to stop scanning\n */\nexport default (\n connection: BrowserConnection,\n onDetected: ({ wallets, newWallet }: { wallets: Wallets; newWallet?: Wallet }) => void,\n): () => void => {\n if (window == null) throw new UnsupportedPlatformError('Window object not found, you can run wallet detector only in browser');\n const wallets: Wallets = {};\n\n connection.connect((\n { method, params }: { method: string; params: Wallet['info'] },\n origin: string,\n source: Window,\n ) => {\n if (method !== METHODS.readyToConnect || wallets[params.id] != null) return;\n\n const wallet = {\n info: params,\n getConnection() {\n const isExtension = params.type === 'extension';\n return new BrowserWindowMessageConnection({\n sendDirection: isExtension ? MESSAGE_DIRECTION.to_waellet : undefined,\n receiveDirection: isExtension ? MESSAGE_DIRECTION.to_aepp : undefined,\n target: source,\n origin: isExtension ? window.origin : params.origin,\n });\n },\n };\n wallets[wallet.info.id] = wallet;\n onDetected({ wallets, newWallet: wallet });\n }, () => {});\n if (Object.keys(wallets).length > 0) onDetected({ wallets });\n\n return () => connection.disconnect();\n};\n","/*\n * ISC License (ISC)\n * Copyright (c) 2022 aeternity developers\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\nimport { Runtime } from 'webextension-polyfill';\nimport BrowserConnection from './Browser';\n\n/**\n * BrowserRuntimeConnection\n * Handle browser runtime communication\n * @category aepp wallet communication\n */\nexport default class BrowserRuntimeConnection extends BrowserConnection {\n port: Runtime.Port;\n\n constructor({ port, ...options }: { port: Runtime.Port; debug: boolean }) {\n super(options);\n this.port = port;\n }\n\n disconnect(): void {\n super.disconnect();\n this.port.disconnect();\n }\n\n connect(\n onMessage: (message: any, origin: string, source: Runtime.Port) => void,\n onDisconnect: () => void,\n ): void {\n super.connect(onMessage, onDisconnect);\n this.port.onMessage.addListener((message, port) => {\n this.receiveMessage(message);\n onMessage(message, port.name, port);\n });\n this.port.onDisconnect.addListener(onDisconnect);\n }\n\n sendMessage(message: any): void {\n super.sendMessage(message);\n this.port.postMessage(message);\n }\n\n isConnected(): boolean {\n return this.port.onMessage.hasListeners();\n }\n}\n"],"names":["root","factory","exports","module","require","define","amd","self","__WEBPACK_EXTERNAL_MODULE__9408__","__WEBPACK_EXTERNAL_MODULE__5192__","__WEBPACK_EXTERNAL_MODULE__3485__","__WEBPACK_EXTERNAL_MODULE__3783__","__WEBPACK_EXTERNAL_MODULE__79__","__WEBPACK_EXTERNAL_MODULE__7480__","__WEBPACK_EXTERNAL_MODULE__3983__","__WEBPACK_EXTERNAL_MODULE__7289__","__WEBPACK_EXTERNAL_MODULE__9882__","__WEBPACK_EXTERNAL_MODULE__1986__","__WEBPACK_EXTERNAL_MODULE__8236__","__WEBPACK_EXTERNAL_MODULE__7946__","__WEBPACK_EXTERNAL_MODULE__4711__","__WEBPACK_EXTERNAL_MODULE__5039__","__WEBPACK_EXTERNAL_MODULE__2716__","__WEBPACK_EXTERNAL_MODULE__8079__","__WEBPACK_EXTERNAL_MODULE__3735__","util","ADD64AA","v","a","b","o0","o1","ADD64AC","b0","b1","B2B_GET32","arr","i","B2B_G","c","d","ix","iy","x0","m","x1","y0","y1","xor0","xor1","BLAKE2B_IV32","Uint32Array","SIGMA82","Uint8Array","map","x","blake2bCompress","ctx","last","h","t","parameterBlock","blake2bInit","outlen","key","salt","personal","Error","length","fill","set","blake2bUpdate","input","blake2bFinal","out","blake2b","normalizeInput","blake2bHex","output","toHex","uint32ToHex","val","toString","substring","ret","TextEncoder","encode","bytes","Array","prototype","call","n","join","debugPrint","label","size","msg","toUpperCase","console","log","testSpeed","hashFn","N","M","startMs","Date","getTime","genMs","hashHex","hashMs","ms","Math","round","parent","entryVirtual","includes","isPrototypeOf","arrayMethod","stringMethod","ArrayPrototype","StringPrototype","String","it","own","Object","defineProperty","desc","sham","isCallable","tryToString","$TypeError","TypeError","argument","isObject","$String","toIndexedObject","toAbsoluteIndex","lengthOfArrayLike","createMethod","IS_INCLUDES","$this","el","fromIndex","value","O","index","indexOf","uncurryThis","stringSlice","slice","TO_STRING_TAG_SUPPORT","classofRaw","TO_STRING_TAG","wellKnownSymbol","$Object","CORRECT_ARGUMENTS","arguments","tag","result","undefined","error","tryGet","callee","MATCH","METHOD_NAME","regexp","error1","error2","DESCRIPTORS","definePropertyModule","createPropertyDescriptor","object","f","bitmap","enumerable","configurable","writable","global","fails","get","document","EXISTS","createElement","getBuiltIn","match","version","userAgent","process","Deno","versions","v8","split","path","CONSTRUCTOR","apply","getOwnPropertyDescriptor","isForced","bind","createNonEnumerableProperty","hasOwn","wrapConstructor","NativeConstructor","Wrapper","this","options","source","USE_NATIVE","VIRTUAL_PROTOTYPE","sourceProperty","targetProperty","nativeProperty","resultProperty","descriptor","TARGET","target","GLOBAL","STATIC","stat","PROTO","proto","nativeSource","targetPrototype","forced","dontCallGetSet","wrap","real","exec","NATIVE_BIND","FunctionPrototype","Function","Reflect","aCallable","fn","that","test","hasOwnProperty","aFunction","variable","namespace","method","V","P","func","check","globalThis","window","g","toObject","classof","propertyIsEnumerable","replacement","feature","detection","data","normalize","POLYFILL","NATIVE","string","replace","toLowerCase","isRegExp","USE_SYMBOL_AS_UID","$Symbol","toLength","obj","ceil","floor","trunc","V8_VERSION","getOwnPropertySymbols","symbol","Symbol","IE8_DOM_DEFINE","V8_PROTOTYPE_DEFINE_BUG","anObject","toPropertyKey","$defineProperty","$getOwnPropertyDescriptor","Attributes","current","propertyIsEnumerableModule","$propertyIsEnumerable","NASHORN_BUG","pref","valueOf","defineGlobalProperty","SHARED","store","IS_PURE","push","mode","copyright","license","toIntegerOrInfinity","max","min","integer","IndexedObject","requireObjectCoercible","number","isSymbol","getMethod","ordinaryToPrimitive","TO_PRIMITIVE","exoticToPrim","toPrimitive","id","postfix","random","NATIVE_SYMBOL","iterator","shared","uid","WellKnownSymbolsStore","symbolFor","createWellKnownSymbol","withoutSetter","name","description","$","$includes","addToUnscopables","notARegExp","correctIsRegExpLogic","stringIndexOf","searchString","create","ctor","superCtor","super_","constructor","TempCtor","buffer","Buffer","copyProps","src","dst","SafeBuffer","arg","encodingOrOffset","from","alloc","allocUnsafe","allocUnsafeSlow","encoding","buf","SlowBuffer","Hash","blockSize","finalSize","_block","_finalSize","_blockSize","_len","update","enc","block","accum","offset","assigned","remainder","_update","digest","rem","bits","writeUInt32BE","lowBits","highBits","hash","_hash","inherits","K","W","Sha256","init","_w","ch","y","z","maj","sigma0","sigma1","gamma0","_a","_b","_c","_d","_e","_f","_g","_h","e","readInt32BE","j","T1","T2","H","writeInt32BE","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","definition","o","prop","r","toStringTag","bigNumber","integerValue","BigNumber","BaseError","message","super","AccountError","AensError","AeppError","ChannelError","CompilerError","ContractError","CryptographyError","NodeError","TransactionError","WalletError","ArgumentError","argumentName","requirement","argumentValue","IllegalArgumentError","ArgumentCountMismatchError","functionName","requiredCount","providedCount","InsufficientBalanceError","MissingParamError","NoSerializerFoundError","RequestTimedOutError","height","TxTimedOutError","blocks","th","UnsupportedPlatformError","UnsupportedProtocolError","NotImplementedError","UnsupportedVersionError","dependency","geVersion","ltVersion","InternalError","UnexpectedTsError","InvalidKeypairError","UnavailableAccountError","address","AensPointerContextError","nameOrId","prefix","InsufficientNameFeeError","nameFee","minNameFee","InvalidAensNameError","InvalidRpcMessageError","MissingCallbackError","UnAuthorizedAccountError","onAccount","UnknownRpcClientError","UnsubscribedAccountError","ChannelCallError","ChannelConnectionError","ChannelPingTimedOutError","UnexpectedChannelMessageError","UnknownChannelStateError","InvalidAuthDataError","BytecodeMismatchError","DuplicateContractError","InactiveContractError","contractAddress","InvalidMethodInvocationError","MissingContractAddressError","MissingContractDefError","MissingFunctionNameError","NodeInvocationError","transaction","NoSuchContractFunctionError","NotPayableFunctionError","amount","MissingEventDefinitionError","eventNameHash","eventAddress","AmbiguousEventDefinitionError","matchedEvents","InvalidChecksumError","InvalidPasswordError","MerkleTreeHashMismatchError","MissingNodeInTreeError","UnknownNodeLengthError","nodeLength","UnknownPathNibbleError","nibble","DuplicateNodeError","NodeNotFoundError","DecodeError","PayloadLengthError","DryRunError","IllegalBidFeeError","InvalidSignatureError","InvalidTxParamsError","PrefixNotFoundError","SchemaNotFoundError","schemaName","TagNotFoundError","TxNotInChainError","txHash","UnknownTxError","UnsupportedABIversionError","UnsupportedVMversionError","AlreadyConnectedError","NoWalletConnectedError","RpcConnectionError","AE_AMOUNT_FORMATS","DENOMINATION_MAGNITUDE","AE","MILI_AE","MICRO_AE","NANO_AE","PICO_AE","FEMTO_AE","AETTOS","formatAmount","denomination","targetDenomination","isNaN","Number","isInteger","shiftedBy","toFixed","toAe","toAettos","isHex","str","bigNumberToByteArray","hexString","toBytes","big","str2buf","isBase64","bytesToHex","hexToBytes","s","pause","async","Promise","resolve","setTimeout","duration","mapObject","fromEntries","entries","concatBuffers","concat","list","totalLength","isKeyOfObject","Encoding","sha256hash","base64Types","ContractBytearray","ContractStoreKey","ContractStoreValue","Transaction","OracleQuery","OracleResponse","State","Poi","StateTrees","CallStateTree","Bytearray","base58Types","KeyBlockHash","MicroBlockHash","BlockPofHash","BlockTxHash","BlockStateHash","Channel","ContractAddress","TxHash","OracleAddress","OracleQueryId","AccountAddress","Signature","Commitment","PeerPubkey","Name","byteSizeForType","ensureValidLength","type","reqLen","getChecksum","payload","addChecksum","getPayload","equals","base64","decode","base58","bs58Encode","bs58Decode","parseType","maybeType","base64Type","find","base58Type","encodedPayload","extra","encoder","getAddressFromPriv","secret","secretBuffer","nacl","publicKey","isAddressValid","genSalt","MAX_SAFE_INTEGER","encodeUnsigned","binary","findIndex","encodeContractAddress","owner","nonce","generateKeyPairFromSecret","generateKeyPair","raw","keyPair","publicBuffer","secretKey","sign","privateKey","verify","signature","publicKeyBuffer","messageToHash","p","varuintEncode","signMessage","verifyMessage","isValidKeypair","NAME_TTL","NAME_MAX_TTL","NAME_MAX_CLIENT_TTL","CLIENT_TTL","MIN_GAS_PRICE","NAME_FEE_MULTIPLIER","NAME_FEE_BID_INCREMENT","NAME_BID_TIMEOUT_BLOCKS","NAME_MAX_LENGTH_FEE","NAME_BID_MAX_LENGTH","NAME_BID_RANGES","times","Tag","idTagToEncoding","writeId","hashId","item","array","idTag","readId","readUIntBE","buildContractId","ownerId","oracleQueryId","senderId","oracleId","nonceBE","_int32","formatSalt","padStart","produceNameId","commitmentHash","writeInt","readInt","buildPointers","pointers","readPointers","AENS_SUFFIX","isNameValid","endsWith","encodingToPointerKey","getDefaultPointerKey","identifier","getMinimumNameFee","nameLength","computeBidFee","startFee","increment","plus","computeAuctionEndBlock","claimHeight","isAuctionName","serialize","deserialize","uInt","serializeAettos","serializeOptional","coinAmount","getOracleRelativeTtl","params","txType","ttlKeys","OracleRegisterTx","OracleExtendTx","OracleQueryTx","OracleResponseTx","buildFee","buildTx","rlpEncoded","txObject","factor","ChannelForceProgressTx","ChannelOffChainTx","ChannelOffChainUpdateCallContract","ChannelOffChainUpdateCreateContract","ChannelOffChainUpdateDeposit","ChannelOffChainUpdateWithdraw","ChannelOffChainUpdateTransfer","ContractCreateTx","ContractCallTx","GaAttachTx","GaMetaTx","PayingForTx","TX_FEE_BASE_GAS","txSize","relativeTtl","innerTxSize","minus","TX_FEE_OTHER_GAS","tx","encodedTx","calculateMinFee","rebuildTx","previousFee","fee","eq","_value","_computingMinFee","minFee","gt","shortUInt","gasMax","_computingGasLimit","gasLimitMax","dividedBy","calculateGasLimitMax","gasLimit","field","txFields","_uInt","_shortUInt","_coinAmount","deposit","_deposit","_fee","_gasLimit","gasPrice","_gasPrice","_name","_nameFee","nameId","ORACLE_TTL_TYPES","TX_TTL","QUERY_FEE","ORACLE_TTL","delta","QUERY_TTL","RESPONSE_TTL","AMOUNT","MAX_AUTH_FUN_GAS","DRY_RUN_ACCOUNT","pub","VM_VERSIONS","ABI_VERSIONS","PROTOCOL_VERSIONS","PROTOCOL_VM_ABI","IRIS","vmVersion","FATE_2","abiVersion","FATE","SOPHIA","NO_ABI","FIELD_TYPES","BASE_TX","TX_SCHEMA","Account","SignedTx","signatures","rlpBinary","SpendTx","NamePreclaimTx","NameClaimTx","NameUpdateTx","NameTransferTx","NameRevokeTx","Contract","ctVersion","bool","ids","ContractCall","callReturnType","rawBinary","ttlType","ChannelCreateTx","ChannelCloseMutualTx","ChannelCloseSoloTx","ChannelSlashTx","ChannelDepositTx","ChannelWithdrawTx","ChannelSettleTx","stateTree","hex","ChannelSnapshotSoloTx","callStack","ChannelClientReconnectTx","TreesPoi","mptrees","Mtree","rlpBinaries","MtreeValue","ContractsMtree","CallsMtree","ChannelsMtree","NameserviceMtree","OraclesMtree","AccountsMtree","CompilerSophia","sophiaCodeTypeInfo","NodeType","MPTree","node","rlpEncode","rootHash","nodes","forEach","nodeHash","parseNode","Branch","filter","Extension","isEqual","tree","Leaf","mptHash","_key","searchFrom","deserializeField","vm","abi","unpackTx","offChainUpdates","reduce","acc","funHash","fnName","argType","outType","serializeField","validateField","prefixes","isArray","Boolean","some","validateParams","schema","excludeKeys","unpackRawTx","fieldType","assign","_params","vsn","schemas","keys","VSN","filteredSchema","valid","JSON","stringify","overrideParams","rlpDecode","objId","buildTxHash","rawTx","startsWith","buildContractIdByContractTx","contractTx","validators","getSenderAddress","verifyTransaction","parentTxTypes","account","consensusProtocolVersion","nodeNetworkId","all","getAccountByPubkey","catch","balance","then","getCurrentKeyBlockHeight","getNodeInfo","flat","_getPollInterval","_expectedMineRate","_microBlockCycle","_maxPollInterval","base","microblock","txWithNetworkId","txHashWithNetworkId","decodedPub","checkedKeys","ttl","cost","lte","validNonce","txProtocol","contractId","active","getContract","response","parsedBody","reason","InvalidTxError","validation","getHeight","onNode","poll","interval","getTransactionByHash","blockHeight","awaitHeight","currentHeight","waitForTxConfirm","confirm","newBlockHeight","sendTransaction","waitMined","__queue","postTransaction","requestOptions","customHeaders","pollResult","txData","confirmationHeight","verifyTx","getAccount","getAccountByPubkeyAndHeight","getAccountByPubkeyAndHash","getBalance","format","getCurrentGeneration","getGeneration","hashOrHeight","getGenerationByHeight","getGenerationByHash","getMicroBlockTransactions","getMicroBlockTransactionsByHash","transactions","getKeyBlock","getKeyBlockByHeight","getKeyBlockByHash","getMicroBlockHeader","getMicroBlockHeaderByHash","txDryRunRequests","Map","txDryRunHandler","rs","delete","dryRunRes","protectedDryRunTxs","top","txEvents","txs","req","accounts","Set","accountAddress","pubKey","reject","results","idx","resultPayload","txDryRun","combine","requests","timeout","getContractByteCode","getContractCode","getName","getNameEntryByName","resolveName","resolveByNode","pointer","DERIVED_KEY_FUNCTIONS","pass","memlimit_kib","mem","opslimit","time","hashLen","ArgonType","CRYPTO_FUNCTIONS","encrypt","decrypt","res","CRYPTO_DEFAULTS","secret_type","symmetric_alg","kdf","kdf_params","parallelism","plaintext","algo","deriveKey","password","kdfParams","recover","crypto","ciphertext","cipher_params","dump","opt","derivedKey","public_key","uuid","getVmVersion","supportedProtocol","protocolForTX","prepareTxParams","absoluteTtl","strategy","getAccountNextNonce","nextNonce","getCurrentKeyBlock","_buildTx","senderKey","extraParams","syncBuildTx","Ecb","aesjs","encryptKey","binaryData","hashedPasswordBytes","decryptKey","encrypted","encryptedBytes","DerivationError","ED25519_CURVE","HARDENED_OFFSET","deriveChild","chainCode","indexBuffer","I","hmac","derivePathFromKey","segments","fromString","toPathArray","segment","parentKey","getMasterKeyFromSeed","seed","derivePathFromSeed","masterKey","formatAccount","getKeyPair","generateSaveHDWalletFromSeed","walletKey","getSaveHDWalletAccounts","saveHDWallet","accountCount","_","getHdWalletAccountFromSeed","accountIdx","send","authFun","innerTx","signed","signTransaction","networkId","getStatus","spend","recipientIdOrName","recipientId","transferFunds","fraction","desiredAmount","payForTransaction","payerId","aensRevoke","accountId","aensUpdate","extendPointers","allPointers","clientTtl","nameTtl","aensTransfer","aensQuery","nameEntry","freeze","aensClaim","claimTx","nameSalt","nameInter","aensPreclaim","commitmentId","preclaimTx","opts","aensBid","getContractInstance","onCompiler","bytecode","aci","_aci","fileSystem","validateBytecode","otherOptions","generateACI","code","instance","encodedAci","contract","calldata","Calldata","externalEncodedAci","deployInfo","callStatic","_options","_fn","decodeEvents","_events","methods","onChanBytecode","validateByteCode","compile","compileContract","handleCallError","returnType","returnValue","decodeFateString","sendAndProcess","callInfo","getTransactionInfoByHash","getFunctionACI","functions","payable","getContractNameByEvent","nameHash","contractAddressToName","addressToName","event","variant","events","eventName","BigInt","calcHash","_estimateGas","gasUsed","deploy","callData","fnACI","callerId","txOpt","callObj","dryRunOther","decodedResult","returns","decodedEvents","omitUnknown","topics","contractName","decoded","decodeEvent","args","aciArgs","stateful","genHandler","pop","delegateSignatureCommon","createAensDelegationSignature","createOracleDelegationSignature","queryId","pollForQueries","onQuery","knownQueryIds","checkNewQueries","queries","getOracleQueriesByPubkey","oracleQueries","has","add","stopped","pollForQueryResponse","getOracleQueryByPubkeyAndQueryId","responseBuffer","getQueryObject","record","decodedQuery","query","decodedResponse","respond","respondToQuery","pollForResponse","postQueryToOracle","queryFee","getOracleByPubkey","oracleQueryTx","queryTtlType","queryTtlValue","responseTtlType","responseTtlValue","extendOracleTtl","oracleExtendTx","oracleTtlType","oracleTtlValue","getOracleObject","oracleRespondTx","pollQueries","postQuery","extendOracle","getQuery","handler","lastArg","registerOracle","queryFormat","responseFormat","oracleRegisterTx","isGA","createGeneralizedAccount","authFnName","gaContractId","createMetaTx","rawTransaction","authData","wrapInEmptySignedTx","authCallData","wrappedTx","gaId","metaTxRlp","buildAuthTxHash","signUsingGA","createSalt","calculateMinFeeInternal","GAS_MAX","TX_TYPE","ID_TAG","commitment","oracle","channel","PREFIX_ID_TAG","ak","nm","cm","ok","ct","ID_TAG_PREFIX","POINTER_KEY_BY_PREFIX","_defineProperty","genRequestQueuesPolicy","requestQueues","policy","request","next","headers","getResponse","position","genCombineGetRequestsPolicy","pendingGetRequests","url","body","genErrorFormatterPolicy","getMessage","RestError","bodyAsText","parse","URL","pathname","genVersionCheckPolicy","ignorePath","versionPromise","getComponents","versionComponents","geComponents","ltComponents","componentsToNumber","components","reverse","vNumber","geNumber","ltNumber","semverSatisfies","Header","className","modelProperties","serializedName","required","prevHash","prevKeyHash","stateHash","miner","beneficiary","pow","constraints","MinItems","MaxItems","element","info","pofHash","txsHash","ErrorModel","KeyBlock","HashResponse","HeightResponse","MicroBlockHeader","SignedTxs","blockHash","Tx","uberParent","polymorphicDiscriminator","clientName","initiatorId","initiatorAmount","responderId","responderAmount","channelReserve","lockPeriod","delegateIds","channelId","fromId","toId","offchainTrees","initiatorAmountFinal","responderAmountFinal","poi","initiatorDelegateIds","responderDelegateIds","oracleTtl","queryTtl","responseTtl","gas","Pattern","RegExp","allowedValues","Delegates","initiator","responder","OffChainUpdate","op","RelativeTTL","defaultValue","isConstant","Ttl","NamePointer","CountResponse","count","Generation","keyBlock","microBlocks","kind","NextNonceResponse","DryRunInput","DryRunAccount","DryRunInputItem","callReq","DryRunCallReq","caller","context","DryRunCallContext","DryRunResults","DryRunResult","ContractCallObject","callerNonce","Event","TxInfoObject","gaInfo","txInfo","GAObject","innerObject","EncodedTx","PostTxResponse","ContractObject","referrerIds","ByteCode","PoI","RegisteredOracle","OracleQueries","senderNonce","NameEntry","channelAmount","soloRound","lockedUntil","PeerPubKey","pubkey","Status","genesisKeyBlockHash","solutions","difficulty","syncing","syncProgress","InclusiveMaximum","InclusiveMinimum","listening","protocols","nodeVersion","nodeRevision","peerCount","peerConnections","pendingTransactionsCount","peerPubkey","topKeyBlockHash","topBlockHeight","Protocol","effectiveAtHeight","PeerConnections","inbound","outbound","OracleRespondTx","CommitmentId","NameHash","ChannelSetDelegatesTx","PubKey","PeerDetails","host","port","firstSeen","lastSeen","genesisHash","topHash","topDifficulty","nodeVendor","nodeOs","Peers","peers","blocked","PeerCount","connected","available","PeerCountConnected","PeerCountAvailable","verified","unverified","UnsignedTx","TokenSupply","contracts","contractOracles","locked","oracles","pendingRewards","total","GAAttachTx","GAMetaTx","CheckTxInPoolResponse","status","OffChainTransfer","to","OffChainWithdrawal","OffChainDeposit","OffChainNewContract","OffChainCallContract","CreateContractUnsignedTx","discriminators","accept","parameterPath","mapper","$host","skipEncoding","intAsString","contentType","DryRunInputMapper","body1","EncodedTxMapper","Node","coreClient","packageDetails","userAgentPrefix","userAgentOptions","optionsWithDefaults","requestContentType","baseUri","endpoint","pipeline","getOrderedPolicies","pipelinePolicy","coreRestPipeline","removePolicy","addPolicy","scopes","challengeCallbacks","authorizeRequestOnChallenge","getTopHeader","sendOperationRequest","getTopHeaderOperationSpec","getCurrentKeyBlockOperationSpec","getCurrentKeyBlockHash","getCurrentKeyBlockHashOperationSpec","getCurrentKeyBlockHeightOperationSpec","getPendingKeyBlock","getPendingKeyBlockOperationSpec","getKeyBlockByHashOperationSpec","getKeyBlockByHeightOperationSpec","getMicroBlockHeaderByHashOperationSpec","getMicroBlockTransactionsByHashOperationSpec","getMicroBlockTransactionByHashAndIndex","getMicroBlockTransactionByHashAndIndexOperationSpec","getMicroBlockTransactionsCountByHash","getMicroBlockTransactionsCountByHashOperationSpec","getCurrentGenerationOperationSpec","getGenerationByHashOperationSpec","getGenerationByHeightOperationSpec","getAccountByPubkeyOperationSpec","getAccountByPubkeyAndHeightOperationSpec","getAccountByPubkeyAndHashOperationSpec","getPendingAccountTransactionsByPubkey","getPendingAccountTransactionsByPubkeyOperationSpec","getAccountNextNonceOperationSpec","protectedDryRunTxsOperationSpec","getTransactionByHashOperationSpec","getTransactionInfoByHashOperationSpec","postTransactionOperationSpec","getContractOperationSpec","getContractCodeOperationSpec","getContractPoI","getContractPoIOperationSpec","getOracleByPubkeyOperationSpec","getOracleQueriesByPubkeyOperationSpec","getOracleQueryByPubkeyAndQueryIdOperationSpec","getNameEntryByNameOperationSpec","getChannelByPubkey","getChannelByPubkeyOperationSpec","getPeerPubkey","getPeerPubkeyOperationSpec","getStatusOperationSpec","getChainEnds","getChainEndsOperationSpec","serializer","Mappers","httpMethod","responses","bodyMapper","isError","queryParameters","Parameters","urlParameters","headerParameters","requestBody","mediaType","getNetworkId","api","bigIntPropertyNames","numberPropertyNames","NodeTransformed","NodeApi","operationArguments","operationSpec","transform","k","bigInt","ignoreVersion","allowInsecureConnection","additionalPolicies","AccountBase","rlpBinaryTx","returnHex","sig","verifyMessageCrypto","secrets","WeakMap","AccountMemory","keypair","isGa","isBuffer","CompileOpts","backend","srcFile","Aci","interface","pos","ErrorPos","col","file","line","APIVersion","apiVersion","ByteCodeInput","CompilerVersion","SophiaCallResultInput","callResult","callValue","function","BytecodeCallResultInput","DecodedCallresult","DecodeCalldataBytecode","DecodedCalldata","DecodeCalldataSource","SophiaBinaryData","sophiaType","SophiaJsonData","FunctionCallInput","FateAssembler","fateAssembler","ValidateByteCodeInput","ContractMapper","ByteCodeInputMapper","body2","SophiaCallResultInputMapper","body3","BytecodeCallResultInputMapper","body4","DecodeCalldataBytecodeMapper","body5","DecodeCalldataSourceMapper","body6","SophiaBinaryDataMapper","body7","FunctionCallInputMapper","body8","ValidateByteCodeInputMapper","Compiler","generateACIOperationSpec","apiOperationSpec","aPIVersion","aPIVersionOperationSpec","compileContractOperationSpec","getCompilerVersion","getCompilerVersionOperationSpec","decodeCallResult","decodeCallResultOperationSpec","decodeCallResultBytecode","decodeCallResultBytecodeOperationSpec","decodeCalldataBytecode","decodeCalldataBytecodeOperationSpec","decodeCalldataSource","decodeCalldataSourceOperationSpec","decodeData","decodeDataOperationSpec","encodeCalldata","encodeCalldataOperationSpec","getFateAssemblerCode","getFateAssemblerCodeOperationSpec","validateByteCodeOperationSpec","versionOperationSpec","CompilerApi","compilerUrl","parameter","trim","getValueOrErrorProxy","valueCb","Proxy","AeSdkBase","addNode","compilerApi","setCompilerUrl","ensureNodeConnected","pool","selectedNodeName","select","selectNode","isNodeConnected","addresses","_resolveAccount","MemoryAccount","_getOptions","txMethodsOther","txMethods","_2","chainMethodsOther","chainMethods","aensMethods","spendMethods","oracleMethods","contractMethods","contractGaMethods","deprecatedMethods","instanceOptions","AeSdk","selectedAddress","selectAccount","removeAccount","warn","MESSAGE_DIRECTION","WALLET_TYPE","SUBSCRIPTION_TYPES","METHODS","RPC_STATUS","rpcErrors","RpcError","toJSON","json","RpcErr","cl","RpcInvalidTransactionError","RpcBroadcastError","RpcRejectedByUserError","RpcUnsupportedProtocolError","RpcConnectionDenyError","RpcNotAuthorizeError","RpcPermissionDenyError","RpcInternalError","RpcMethodNotFoundError","AccountRpc","rpcClient","_rpcClient","_address","returnSigned","signedTransaction","_classExtractFieldDescriptor","receiver","privateMap","action","_classPrivateFieldGet","_classPrivateFieldSet","RpcClient","connection","onDisconnect","connect","notify","origin","jsonrpc","methodName","sendMessage","callbacks","AeSdkAepp","onAddressChange","onNetworkChange","other","_ensureAccountAccess","_accounts","disconnectParams","connectNode","client","updateAddress","updateNetwork","closeConnection","disconnect","readyToConnect","walletInfo","disconnectWallet","_ensureConnected","subscribeAddress","jsonBig","JsonBig","storeAsString","convertValuesToBigNumbers","bn","AeSdkWallet","onConnection","onSubscription","onSign","onAskAccounts","onMessageSign","_clients","_type","_pushAccountsToApps","clientId","_isRpcClientSubscribed","_getClient","rpc","getAccounts","addAccount","_getNode","_isRpcClientConnected","addressSubscription","CONNECTED","isConnected","_disconnectRpcClient","DISCONNECTED","removeRpcClient","addRpcClient","clientConnection","WAITING_FOR_CONNECTION_REQUEST","icons","getWalletInfo","subscribe","unsubscribe","subscription","overrides","transactionHash","location","state","fsm","websockets","eventEmitters","messageQueue","messageQueueLocked","actionQueue","actionQueueLocked","sequence","rpcCallbacks","pingTimeoutId","pongTimeoutId","fsmId","emit","rest","enterState","nextState","enter","dequeueAction","changeStatus","newStatus","changeState","newState","debug","queue","singleFsm","guard","enqueueAction","handleMessage","fsmState","st","close","pingTimeoutIdValue","pongTimeoutIdValue","clearTimeout","ping","currentSequence","details","initialize","connectionHandler","openHandler","channelOptions","EventEmitter","wsUrl","searchParams","ws","W3CWebSocket","onerror","onopen","reconnectTx","signedTx","signed_tx","onclose","onmessage","messages","shift","dequeueMessage","channel_id","callback","onMessage","appendSignature","signFn","handleUnexpectedMessage","_channel","wsMessage","channelOpen","awaitingConnection","channelInfoStatus","channel_accept","funding_created","awaitingChannelCreateTx","awaitingOpenConfirmation","fsm_id","channelClosed","awaitingReconnection","role","awaitingOnChainTx","awaitingBlockInclusion","own_funding_locked","funding_locked","awaitingInitialState","awaitingTxSignRequest","awaitingOffChainTx","updates","awaitingOffChainUpdate","accepted","errorCode","error_code","errorMessage","error_msg","awaitingUpdateConflict","awaitingShutdownTx","awaitingShutdownOnChainTx","awaitingLeave","awaitingWithdrawTx","awaitingWithdrawCompletion","onOnChainTx","own_withdraw_locked","onOwnWithdrawLocked","withdraw_locked","onWithdrawLocked","awaitingDepositTx","awaitingDepositCompletion","own_deposit_locked","onOwnDepositLocked","deposit_locked","onDepositLocked","awaitingNewContractTx","awaitingNewContractCompletion","awaitingCallContractUpdateTx","awaitingCallContractCompletion","awaitingCallContractForceProgressUpdate","awaitingForceProgressCompletion","awaitingCallsPruned","_channels","closeTx","snakeToPascalObjKeys","existingFsmId","handlers","on","eventEmitter","off","removeListener","channelDisconnect","channelStatus","channelState","channelFsmId","metadata","meta","call_data","vm_version","abi_version","contract_id","gas_price","caller_id","recipient","onStatusChanged","txParams","con1","con2","BrowserConnection","receiveMessage","BrowserWindowMessageConnection","sendDirection","receiveDirection","to_aepp","listener","addEventListener","removeEventListener","postMessage","onDetected","wallets","wallet","getConnection","isExtension","to_waellet","newWallet","BrowserRuntimeConnection","addListener","hasListeners"],"sourceRoot":""}