@sentio/sdk-bundle 4.0.1-rc.5 → 4.1.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{0x1-BoDxh-YB.js → 0x1-BZ1q0D5w.js} +4 -4
- package/dist/{0x1-BoDxh-YB.js.map → 0x1-BZ1q0D5w.js.map} +1 -1
- package/dist/aptos/builtin/0x1.js +1 -1
- package/dist/aptos/builtin/0x3.js +2 -2
- package/dist/aptos/builtin/0x4.js +2 -2
- package/dist/aptos/builtin/index.js +1 -1
- package/dist/aptos/ext/index.js +2 -2
- package/dist/aptos/index.js +2 -2
- package/dist/{aptos-C3JyHHc4.js → aptos-5tjCEQ6p.js} +5 -5
- package/dist/{aptos-C3JyHHc4.js.map → aptos-5tjCEQ6p.js.map} +1 -1
- package/dist/{coin-CpgkWpcD.js → coin-BXFrwxRE.js} +3 -3
- package/dist/{coin-CpgkWpcD.js.map → coin-BXFrwxRE.js.map} +1 -1
- package/dist/{coin-D4FF2o2d.js → coin-DbknVApK.js} +3 -3
- package/dist/{coin-D4FF2o2d.js.map → coin-DbknVApK.js.map} +1 -1
- package/dist/core/index.js +1 -1
- package/dist/{core-DqBhY_Wc.js → core-CPC-6jsb.js} +357 -6
- package/dist/core-CPC-6jsb.js.map +1 -0
- package/dist/{decode-worker-C83IoThX.js → decode-worker-BZuZO3Ef.js} +2 -2
- package/dist/{decode-worker-C83IoThX.js.map → decode-worker-BZuZO3Ef.js.map} +1 -1
- package/dist/eth/abi-decoder/decode-worker.js +1 -1
- package/dist/eth/builtin/eacaggregatorproxy.js +1 -1
- package/dist/eth/builtin/erc1155.js +3 -3
- package/dist/eth/builtin/erc20.js +1 -1
- package/dist/eth/builtin/erc721.js +1 -1
- package/dist/eth/builtin/index.js +1 -1
- package/dist/eth/builtin/weth9.js +3 -3
- package/dist/eth/index.js +2 -2
- package/dist/fuel/index.js +1 -1
- package/dist/{fuel-CdpD5h55.js → fuel-DLmNPUq9.js} +3 -3
- package/dist/{fuel-CdpD5h55.js.map → fuel-DLmNPUq9.js.map} +1 -1
- package/dist/{handler-register-BIK3feXq.js → handler-register-DkEYbBGE.js} +2 -2
- package/dist/{handler-register-BIK3feXq.js.map → handler-register-DkEYbBGE.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/iota/builtin/0x1.js +3 -3
- package/dist/iota/builtin/0x2.js +3 -3
- package/dist/iota/builtin/0x3.js +3 -3
- package/dist/iota/ext/index.js +1 -1
- package/dist/iota/index.js +3 -3
- package/dist/move/index.js +1 -1
- package/dist/{move-BVvdKH2Q.js → move-Ce6GumtF.js} +2 -2
- package/dist/{move-BVvdKH2Q.js.map → move-Ce6GumtF.js.map} +1 -1
- package/dist/solana/builtin/index.js +1 -1
- package/dist/solana/index.js +1 -1
- package/dist/{solana-DNjOwr5Y.js → solana-DY7xsNa5.js} +2 -2
- package/dist/{solana-DNjOwr5Y.js.map → solana-DY7xsNa5.js.map} +1 -1
- package/dist/store/index.js +1 -1
- package/dist/sui/builtin/0x1.js +1 -1
- package/dist/sui/builtin/0x2.js +4 -4
- package/dist/sui/builtin/0x3.js +4 -4
- package/dist/sui/builtin/index.js +1 -1
- package/dist/sui/ext/index.js +1 -1
- package/dist/sui/index.js +3 -3
- package/dist/{sui-Hqx2uWI-.js → sui-CcreC9Mj.js} +6 -6
- package/dist/{sui-Hqx2uWI-.js.map → sui-CcreC9Mj.js.map} +1 -1
- package/dist/testing/index.js +8 -8
- package/dist/utils/index.js +1 -1
- package/dist/{utils-Dloybvj_.js → utils-B26ewwB8.js} +3005 -2120
- package/dist/utils-B26ewwB8.js.map +1 -0
- package/package.json +2 -2
- package/dist/core-DqBhY_Wc.js.map +0 -1
- package/dist/utils-Dloybvj_.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils-B26ewwB8.js","names":["LEGACY_REQUIRED","makeWriteOptions","__asyncValues","__await","__asyncGenerator","__asyncDelegator","message","#listeners","#cancelled","#url","#body","#bodyType","#method","#headers","#creds","#gzip","#allowInsecure","#timeout","#preflight","#process","#retry","#getUrlFunc","#throttle","#send","getTime","#signal","#statusCode","#statusMessage","#request","#error","allowNull","sha256","_0n","_1n","_2n","_0n","_1n","_2n","_3n","gcd","_0n","_1n","ut","_1n","ut.concatBytes","ut.bytesToHex","ut.bytesToNumberBE","mod.mod","mod.invert","ut.numberToBytesBE","ut.hexToBytes","mod.getMinHashLength","mod.mapHashToField","ut.bitMask","ut.createHmacDrbg","hash","concatBytes","#privateKey","BN_0","BN_2","inspect","sha256","#type","#to","#nonce","#gasLimit","#gasPrice","#maxPriorityFeePerGas","#maxFeePerGas","#data","#value","#chainId","#sig","#accessList","#auths","#maxFeePerBlobGas","#blobVersionedHashes","#blobs","#kzg","#blobWrapperVersion","#getSerialized","BN_0","#types","#fullTypes","#encoderCache","#getEncoder","inspect","#url","#processFunc","#name","#chainId","#plugins","#supports2544","#resolver","#fetch","#getResolver","copy","#provider","#poller","#interval","#blockNumber","#poll","#running","#tag","#lastBlock","#filter","#hash","stall","getTag","copy","defaultOptions","#options","#anyNetwork","#networkPromise","#lastBlockNumber","#performCache","#subs","#plugins","#pausedState","#destroyed","#nextTimer","#timers","#disableCcipRead","#requestRate","#requestTimes","#perform","#getDelay","#getBlock","#call","#checkNetwork","#getAccountValue","#hasSub","#getSub","#provider","#filterIdPromise","#poller","#poll","#running","#network","#hault","#teardown","#event","#drainTimer","#payloads","#options","#nextId","#network","#pendingDetectNetwork","#notReady","#scheduleDrain","#pollingInterval","#connect","sha3","#queue","EventEmitter","#carryoverIntervalCount","#isIntervalIgnored","#intervalCap","#interval","#queue","#queueClass","#isPaused","#setupRateLimitTracking","#doesIntervalAllowAnother","#intervalCount","#doesConcurrentAllowAnother","#pending","#concurrency","#tryToStartAnother","#onInterval","#initializeIntervalIfNeeded","#timeoutId","#isIntervalPaused","#intervalId","#intervalEnd","#lastExecutionTime","#createIntervalTimeout","#onResumeInterval","#clearIntervalTimer","#clearTimeoutTimer","#scheduleRateLimitUpdate","#processQueue","#throwOnAbort","#idAssigner","#runningTasks","#next","#updateRateLimitState","#onEvent","#rateLimitFlushScheduled","#rateLimitedInInterval","#constructing","#perf","#starts","#ttls","#sizes","#keyMap","#keyList","#valList","#next","#prev","#head","#tail","#free","#isBackgroundFetch","#backgroundFetch","#moveToTail","#indexes","#rindexes","#isStale","#max","#maxSize","#calculatedSize","#size","#fetchMethod","#memoMethod","#dispose","#onInsert","#disposeAfter","#hasFetchMethod","#disposed","#hasDispose","#hasOnInsert","#hasDisposeAfter","#initializeSizeTracking","#initializeTTLTracking","#setItemTTL","#delete","#updateItemAge","#statusTTL","#removeItemSize","#requireSize","#addItemSize","#evict","#isValidIndex","#connect","#clear","#performCache","#retryCache","_abi","_abi","_abi","_abi","_abi","templateContract","mockField","mockApprovalLog","EthChainId","mockTransferLog","templateContract","mockField","mockApprovalLog","EthChainId","mockOwnershipTransferredLog","mockTransferLog","templateContract","mockField","EthChainId","EthChainId","EthChainId","http","http"],"sources":["../../../node_modules/.pnpm/@bufbuild+protobuf@2.12.0/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/extension.js","../../../node_modules/.pnpm/@bufbuild+protobuf@2.12.0/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/any_pb.js","../../../node_modules/.pnpm/@bufbuild+protobuf@2.12.0/node_modules/@bufbuild/protobuf/dist/esm/to-binary.js","../../../node_modules/.pnpm/@bufbuild+protobuf@2.12.0/node_modules/@bufbuild/protobuf/dist/esm/wkt/any.js","../../../node_modules/.pnpm/@bufbuild+protobuf@2.12.0/node_modules/@bufbuild/protobuf/dist/esm/extensions.js","../../../node_modules/.pnpm/@bufbuild+protobuf@2.12.0/node_modules/@bufbuild/protobuf/dist/esm/to-json.js","../../../node_modules/.pnpm/@bufbuild+protobuf@2.12.0/node_modules/@bufbuild/protobuf/dist/esm/from-json.js","../../../node_modules/.pnpm/@connectrpc+connect@2.1.2_@bufbuild+protobuf@2.12.0/node_modules/@connectrpc/connect/dist/esm/any-client.js","../../../node_modules/.pnpm/@connectrpc+connect@2.1.2_@bufbuild+protobuf@2.12.0/node_modules/@connectrpc/connect/dist/esm/protocol/async-iterable.js","../../../node_modules/.pnpm/@connectrpc+connect@2.1.2_@bufbuild+protobuf@2.12.0/node_modules/@connectrpc/connect/dist/esm/promise-client.js","../../../node_modules/.pnpm/@connectrpc+connect@2.1.2_@bufbuild+protobuf@2.12.0/node_modules/@connectrpc/connect/dist/esm/context-values.js","../src/utils/block.ts","../src/utils/conversion.ts","../../../node_modules/.pnpm/ethers@6.17.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ethers/lib.esm/utils/base58.js","../../../node_modules/.pnpm/ethers@6.17.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ethers/lib.esm/utils/base64.js","../../../node_modules/.pnpm/ethers@6.17.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ethers/lib.esm/utils/geturl.js","../../../node_modules/.pnpm/ethers@6.17.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ethers/lib.esm/utils/fetch.js","../../../node_modules/.pnpm/ethers@6.17.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ethers/lib.esm/utils/rlp-decode.js","../../../node_modules/.pnpm/ethers@6.17.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ethers/lib.esm/utils/rlp-encode.js","../src/eth/context.ts","../../../node_modules/.pnpm/ethers@6.17.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ethers/lib.esm/crypto/sha2.js","../../../node_modules/.pnpm/@noble+hashes@1.3.2/node_modules/@noble/hashes/esm/_sha2.js","../../../node_modules/.pnpm/@noble+hashes@1.3.2/node_modules/@noble/hashes/esm/sha256.js","../../../node_modules/.pnpm/@noble+curves@1.2.0/node_modules/@noble/curves/esm/abstract/utils.js","../../../node_modules/.pnpm/@noble+curves@1.2.0/node_modules/@noble/curves/esm/abstract/modular.js","../../../node_modules/.pnpm/@noble+curves@1.2.0/node_modules/@noble/curves/esm/abstract/curve.js","../../../node_modules/.pnpm/@noble+curves@1.2.0/node_modules/@noble/curves/esm/abstract/weierstrass.js","../../../node_modules/.pnpm/@noble+hashes@1.3.2/node_modules/@noble/hashes/esm/hmac.js","../../../node_modules/.pnpm/@noble+curves@1.2.0/node_modules/@noble/curves/esm/_shortw_utils.js","../../../node_modules/.pnpm/@noble+curves@1.2.0/node_modules/@noble/curves/esm/secp256k1.js","../../../node_modules/.pnpm/ethers@6.17.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ethers/lib.esm/constants/addresses.js","../../../node_modules/.pnpm/ethers@6.17.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ethers/lib.esm/crypto/signing-key.js","../../../node_modules/.pnpm/ethers@6.17.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ethers/lib.esm/address/contract-address.js","../../../node_modules/.pnpm/@adraffy+ens-normalize@1.11.1/node_modules/@adraffy/ens-normalize/dist/index.mjs","../../../node_modules/.pnpm/ethers@6.17.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ethers/lib.esm/hash/namehash.js","../../../node_modules/.pnpm/ethers@6.17.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ethers/lib.esm/transaction/authorization.js","../../../node_modules/.pnpm/ethers@6.17.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ethers/lib.esm/transaction/address.js","../../../node_modules/.pnpm/ethers@6.17.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ethers/lib.esm/transaction/transaction.js","../../../node_modules/.pnpm/ethers@6.17.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ethers/lib.esm/hash/typed-data.js","../../../node_modules/.pnpm/ethers@6.17.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ethers/lib.esm/abi/bytes32.js","../../../node_modules/.pnpm/ethers@6.17.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ethers/lib.esm/providers/plugins-network.js","../../../node_modules/.pnpm/ethers@6.17.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ethers/lib.esm/providers/network.js","../../../node_modules/.pnpm/ethers@6.17.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ethers/lib.esm/providers/ens-resolver.js","../../../node_modules/.pnpm/ethers@6.17.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ethers/lib.esm/providers/format.js","../../../node_modules/.pnpm/ethers@6.17.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ethers/lib.esm/providers/subscriber-polling.js","../../../node_modules/.pnpm/ethers@6.17.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ethers/lib.esm/providers/abstract-provider.js","../../../node_modules/.pnpm/ethers@6.17.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ethers/lib.esm/providers/abstract-signer.js","../../../node_modules/.pnpm/ethers@6.17.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ethers/lib.esm/providers/subscriber-filterid.js","../../../node_modules/.pnpm/ethers@6.17.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ethers/lib.esm/providers/provider-jsonrpc.js","../../../node_modules/.pnpm/js-sha3@0.9.3/node_modules/js-sha3/src/sha3.js","../src/eth/abi-decoder/index.ts","../src/eth/base-processor.ts","../../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js","../../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.mjs","../../../node_modules/.pnpm/p-timeout@7.0.0/node_modules/p-timeout/index.js","../../../node_modules/.pnpm/p-queue@9.0.0/node_modules/p-queue/dist/lower-bound.js","../../../node_modules/.pnpm/p-queue@9.0.0/node_modules/p-queue/dist/priority-queue.js","../../../node_modules/.pnpm/p-queue@9.0.0/node_modules/p-queue/dist/index.js","../../../node_modules/.pnpm/lru-cache@11.2.1/node_modules/lru-cache/dist/esm/index.js","../src/eth/provider.ts","../src/eth/bind-options.ts","../src/eth/binds.ts","../src/eth/generic-processor.ts","../src/eth/base-processor-template.ts","../src/eth/builtin/internal/factories/EACAggregatorProxy__factory.ts","../src/eth/builtin/internal/factories/ERC1155__factory.ts","../src/eth/builtin/internal/factories/ERC20__factory.ts","../src/eth/builtin/internal/factories/ERC20Bytes__factory.ts","../src/eth/builtin/internal/factories/ERC721__factory.ts","../src/eth/builtin/internal/factories/WETH9__factory.ts","../src/eth/builtin/internal/erc721-processor.ts","../src/eth/builtin/internal/erc721-test-utils.ts","../src/eth/builtin/erc721.ts","../src/eth/account-processor-state.ts","../src/eth/account-processor.ts","../src/eth/eth-plugin.ts","../src/eth/builtin/internal/erc20-processor.ts","../src/eth/builtin/internal/erc20-test-utils.ts","../src/eth/builtin/erc20.ts","../src/eth/builtin/internal/erc20bytes-processor.ts","../src/eth/builtin/internal/erc20bytes-test-utils.ts","../src/eth/builtin/erc20bytes.ts","../src/utils/token.ts","../src/eth/builtin/internal/eacaggregatorproxy-processor.ts","../src/eth/builtin/internal/eacaggregatorproxy-test-utils.ts","../src/eth/builtin/eacaggregatorproxy.ts","../src/utils/dex-price.ts","../../../node_modules/.pnpm/@connectrpc+connect@2.1.2_@bufbuild+protobuf@2.12.0/node_modules/@connectrpc/connect/dist/esm/interceptor.js","../../../node_modules/.pnpm/@connectrpc+connect@2.1.2_@bufbuild+protobuf@2.12.0/node_modules/@connectrpc/connect/dist/esm/protocol/signals.js","../../../node_modules/.pnpm/@connectrpc+connect@2.1.2_@bufbuild+protobuf@2.12.0/node_modules/@connectrpc/connect/dist/esm/protocol/normalize.js","../../../node_modules/.pnpm/@connectrpc+connect@2.1.2_@bufbuild+protobuf@2.12.0/node_modules/@connectrpc/connect/dist/esm/protocol/run-call.js","../../../node_modules/.pnpm/@sentio+connect-gateway-es@1.0.0_@bufbuild+protobuf@2.12.0_@connectrpc+connect@2.1.2_@bufbuild+protobuf@2.12.0_/node_modules/@sentio/connect-gateway-es/dist/esm/context.js","../../../node_modules/.pnpm/@sentio+connect-gateway-es@1.0.0_@bufbuild+protobuf@2.12.0_@connectrpc+connect@2.1.2_@bufbuild+protobuf@2.12.0_/node_modules/@sentio/connect-gateway-es/dist/esm/error.js","../../../node_modules/.pnpm/@sentio+connect-gateway-es@1.0.0_@bufbuild+protobuf@2.12.0_@connectrpc+connect@2.1.2_@bufbuild+protobuf@2.12.0_/node_modules/@sentio/connect-gateway-es/dist/esm/headers.js","../../../node_modules/.pnpm/@sentio+connect-gateway-es@1.0.0_@bufbuild+protobuf@2.12.0_@connectrpc+connect@2.1.2_@bufbuild+protobuf@2.12.0_/node_modules/@sentio/connect-gateway-es/dist/esm/http-body.js","../../../node_modules/.pnpm/@sentio+connect-gateway-es@1.0.0_@bufbuild+protobuf@2.12.0_@connectrpc+connect@2.1.2_@bufbuild+protobuf@2.12.0_/node_modules/@sentio/connect-gateway-es/dist/esm/options.js","../../../node_modules/.pnpm/@sentio+connect-gateway-es@1.0.0_@bufbuild+protobuf@2.12.0_@connectrpc+connect@2.1.2_@bufbuild+protobuf@2.12.0_/node_modules/@sentio/connect-gateway-es/dist/esm/path-template.js","../../../node_modules/.pnpm/@sentio+connect-gateway-es@1.0.0_@bufbuild+protobuf@2.12.0_@connectrpc+connect@2.1.2_@bufbuild+protobuf@2.12.0_/node_modules/@sentio/connect-gateway-es/dist/esm/query-params.js","../../../node_modules/.pnpm/@sentio+connect-gateway-es@1.0.0_@bufbuild+protobuf@2.12.0_@connectrpc+connect@2.1.2_@bufbuild+protobuf@2.12.0_/node_modules/@sentio/connect-gateway-es/dist/esm/gen/google/api/http_pb.js","../../../node_modules/.pnpm/@sentio+connect-gateway-es@1.0.0_@bufbuild+protobuf@2.12.0_@connectrpc+connect@2.1.2_@bufbuild+protobuf@2.12.0_/node_modules/@sentio/connect-gateway-es/dist/esm/gen/google/api/annotations_pb.js","../../../node_modules/.pnpm/@sentio+connect-gateway-es@1.0.0_@bufbuild+protobuf@2.12.0_@connectrpc+connect@2.1.2_@bufbuild+protobuf@2.12.0_/node_modules/@sentio/connect-gateway-es/dist/esm/route.js","../../../node_modules/.pnpm/@sentio+connect-gateway-es@1.0.0_@bufbuild+protobuf@2.12.0_@connectrpc+connect@2.1.2_@bufbuild+protobuf@2.12.0_/node_modules/@sentio/connect-gateway-es/dist/esm/stream.js","../../../node_modules/.pnpm/@sentio+connect-gateway-es@1.0.0_@bufbuild+protobuf@2.12.0_@connectrpc+connect@2.1.2_@bufbuild+protobuf@2.12.0_/node_modules/@sentio/connect-gateway-es/dist/esm/transcode.js","../../../node_modules/.pnpm/@sentio+connect-gateway-es@1.0.0_@bufbuild+protobuf@2.12.0_@connectrpc+connect@2.1.2_@bufbuild+protobuf@2.12.0_/node_modules/@sentio/connect-gateway-es/dist/esm/transport.js","../../../node_modules/.pnpm/@sentio+api@2.0.3/node_modules/@sentio/api/dist/src/client.js","../../../node_modules/.pnpm/@sentio+api@2.0.3/node_modules/@sentio/api/dist/src/gen/service/price/protos/price_pb.js","../src/utils/price.ts","../src/utils/call.ts"],"sourcesContent":["// Copyright 2021-2026 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n/**\n * Hydrate an extension descriptor.\n *\n * @private\n */\nexport function extDesc(file, path, ...paths) {\n if (paths.length == 0) {\n return file.extensions[path];\n }\n const e = paths.pop(); // we checked length above\n return paths.reduce((acc, cur) => acc.nestedMessages[cur], file.messages[path]).nestedExtensions[e];\n}\n","// Copyright 2021-2026 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { fileDesc } from \"../../../../codegenv2/file.js\";\nimport { messageDesc } from \"../../../../codegenv2/message.js\";\n/**\n * Describes the file google/protobuf/any.proto.\n */\nexport const file_google_protobuf_any = /*@__PURE__*/ fileDesc(\"Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYiJgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQnYKE2NvbS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaLGdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2FueXBiogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM\");\n/**\n * Describes the message google.protobuf.Any.\n * Use `create(AnySchema)` to create a new message.\n */\nexport const AnySchema = /*@__PURE__*/ messageDesc(file_google_protobuf_any, 0);\n","// Copyright 2021-2026 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { reflect } from \"./reflect/reflect.js\";\nimport { BinaryWriter, WireType } from \"./wire/binary-encoding.js\";\nimport { ScalarType } from \"./descriptors.js\";\n// bootstrap-inject google.protobuf.FeatureSet.FieldPresence.LEGACY_REQUIRED: const $name: FeatureSet_FieldPresence.$localName = $number;\nconst LEGACY_REQUIRED = 3;\n// Default options for serializing binary data.\nconst writeDefaults = {\n writeUnknownFields: true,\n};\nfunction makeWriteOptions(options) {\n return options ? Object.assign(Object.assign({}, writeDefaults), options) : writeDefaults;\n}\nexport function toBinary(schema, message, options) {\n return writeFields(new BinaryWriter(), makeWriteOptions(options), reflect(schema, message)).finish();\n}\nfunction writeFields(writer, opts, msg) {\n var _a;\n for (const f of msg.sortedFields) {\n if (!msg.isSet(f)) {\n if (f.presence == LEGACY_REQUIRED) {\n throw new Error(`cannot encode ${f} to binary: required field not set`);\n }\n continue;\n }\n writeField(writer, opts, msg, f);\n }\n if (opts.writeUnknownFields) {\n for (const { no, wireType, data } of (_a = msg.getUnknown()) !== null && _a !== void 0 ? _a : []) {\n writer.tag(no, wireType).raw(data);\n }\n }\n return writer;\n}\n/**\n * @private\n */\nexport function writeField(writer, opts, msg, field) {\n var _a;\n switch (field.fieldKind) {\n case \"scalar\":\n case \"enum\":\n writeScalar(writer, msg.desc.typeName, field.name, (_a = field.scalar) !== null && _a !== void 0 ? _a : ScalarType.INT32, field.number, msg.get(field));\n break;\n case \"list\":\n writeListField(writer, opts, field, msg.get(field));\n break;\n case \"message\":\n writeMessageField(writer, opts, field, msg.get(field));\n break;\n case \"map\":\n for (const [key, val] of msg.get(field)) {\n writeMapEntry(writer, opts, field, key, val);\n }\n break;\n }\n}\nfunction writeScalar(writer, msgName, fieldName, scalarType, fieldNo, value) {\n writeScalarValue(writer.tag(fieldNo, writeTypeOfScalar(scalarType)), msgName, fieldName, scalarType, value);\n}\nfunction writeMessageField(writer, opts, field, message) {\n if (field.delimitedEncoding) {\n writeFields(writer.tag(field.number, WireType.StartGroup), opts, message).tag(field.number, WireType.EndGroup);\n }\n else {\n writeFields(writer.tag(field.number, WireType.LengthDelimited).fork(), opts, message).join();\n }\n}\nfunction writeListField(writer, opts, field, list) {\n var _a;\n if (field.listKind == \"message\") {\n for (const item of list) {\n writeMessageField(writer, opts, field, item);\n }\n return;\n }\n const scalarType = (_a = field.scalar) !== null && _a !== void 0 ? _a : ScalarType.INT32;\n if (field.packed) {\n if (!list.size) {\n return;\n }\n writer.tag(field.number, WireType.LengthDelimited).fork();\n for (const item of list) {\n writeScalarValue(writer, field.parent.typeName, field.name, scalarType, item);\n }\n writer.join();\n return;\n }\n for (const item of list) {\n writeScalar(writer, field.parent.typeName, field.name, scalarType, field.number, item);\n }\n}\nfunction writeMapEntry(writer, opts, field, key, value) {\n var _a;\n writer.tag(field.number, WireType.LengthDelimited).fork();\n // write key, expecting key field number = 1\n writeScalar(writer, field.parent.typeName, field.name, field.mapKey, 1, key);\n // write value, expecting value field number = 2\n switch (field.mapKind) {\n case \"scalar\":\n case \"enum\":\n writeScalar(writer, field.parent.typeName, field.name, (_a = field.scalar) !== null && _a !== void 0 ? _a : ScalarType.INT32, 2, value);\n break;\n case \"message\":\n writeFields(writer.tag(2, WireType.LengthDelimited).fork(), opts, value).join();\n break;\n }\n writer.join();\n}\nfunction writeScalarValue(writer, msgName, fieldName, type, value) {\n try {\n switch (type) {\n case ScalarType.STRING:\n writer.string(value);\n break;\n case ScalarType.BOOL:\n writer.bool(value);\n break;\n case ScalarType.DOUBLE:\n writer.double(value);\n break;\n case ScalarType.FLOAT:\n writer.float(value);\n break;\n case ScalarType.INT32:\n writer.int32(value);\n break;\n case ScalarType.INT64:\n writer.int64(value);\n break;\n case ScalarType.UINT64:\n writer.uint64(value);\n break;\n case ScalarType.FIXED64:\n writer.fixed64(value);\n break;\n case ScalarType.BYTES:\n writer.bytes(value);\n break;\n case ScalarType.FIXED32:\n writer.fixed32(value);\n break;\n case ScalarType.SFIXED32:\n writer.sfixed32(value);\n break;\n case ScalarType.SFIXED64:\n writer.sfixed64(value);\n break;\n case ScalarType.SINT64:\n writer.sint64(value);\n break;\n case ScalarType.UINT32:\n writer.uint32(value);\n break;\n case ScalarType.SINT32:\n writer.sint32(value);\n break;\n }\n }\n catch (e) {\n if (e instanceof Error) {\n throw new Error(`cannot encode field ${msgName}.${fieldName} to binary: ${e.message}`);\n }\n throw e;\n }\n}\nfunction writeTypeOfScalar(type) {\n switch (type) {\n case ScalarType.BYTES:\n case ScalarType.STRING:\n return WireType.LengthDelimited;\n case ScalarType.DOUBLE:\n case ScalarType.FIXED64:\n case ScalarType.SFIXED64:\n return WireType.Bit64;\n case ScalarType.FIXED32:\n case ScalarType.SFIXED32:\n case ScalarType.FLOAT:\n return WireType.Bit32;\n default:\n return WireType.Varint;\n }\n}\n","// Copyright 2021-2026 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { AnySchema } from \"./gen/google/protobuf/any_pb.js\";\nimport { create } from \"../create.js\";\nimport { toBinary } from \"../to-binary.js\";\nimport { fromBinary, mergeFromBinary } from \"../from-binary.js\";\nexport function anyPack(schema, message, into) {\n let ret = false;\n if (!into) {\n into = create(AnySchema);\n ret = true;\n }\n into.value = toBinary(schema, message);\n into.typeUrl = typeNameToUrl(message.$typeName);\n return ret ? into : undefined;\n}\nexport function anyIs(any, descOrTypeName) {\n if (any.typeUrl === \"\") {\n return false;\n }\n const want = typeof descOrTypeName == \"string\"\n ? descOrTypeName\n : descOrTypeName.typeName;\n const got = typeUrlToName(any.typeUrl);\n return want === got;\n}\nexport function anyUnpack(any, registryOrMessageDesc) {\n if (any.typeUrl === \"\") {\n return undefined;\n }\n const desc = registryOrMessageDesc.kind == \"message\"\n ? registryOrMessageDesc\n : registryOrMessageDesc.getMessage(typeUrlToName(any.typeUrl));\n if (!desc || !anyIs(any, desc)) {\n return undefined;\n }\n return fromBinary(desc, any.value);\n}\n/**\n * Same as anyUnpack but unpacks into the target message.\n */\nexport function anyUnpackTo(any, schema, message) {\n if (!anyIs(any, schema)) {\n return undefined;\n }\n return mergeFromBinary(schema, message, any.value);\n}\nfunction typeNameToUrl(name) {\n return `type.googleapis.com/${name}`;\n}\nfunction typeUrlToName(url) {\n const slash = url.lastIndexOf(\"/\");\n const name = slash >= 0 ? url.substring(slash + 1) : url;\n if (!name.length) {\n throw new Error(`invalid type url: ${url}`);\n }\n return name;\n}\n","// Copyright 2021-2026 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { create } from \"./create.js\";\nimport { readField } from \"./from-binary.js\";\nimport { reflect } from \"./reflect/reflect.js\";\nimport { scalarZeroValue } from \"./reflect/scalar.js\";\nimport { writeField } from \"./to-binary.js\";\nimport { BinaryReader, BinaryWriter } from \"./wire/binary-encoding.js\";\nimport { isWrapperDesc } from \"./wkt/wrappers.js\";\n/**\n * Retrieve an extension value from a message.\n *\n * The function never returns undefined. Use hasExtension() to check whether an\n * extension is set. If the extension is not set, this function returns the\n * default value (if one was specified in the protobuf source), or the zero value\n * (for example `0` for numeric types, `[]` for repeated extension fields, and\n * an empty message instance for message fields).\n *\n * Extensions are stored as unknown fields on a message. To mutate an extension\n * value, make sure to store the new value with setExtension() after mutating.\n *\n * If the extension does not extend the given message, an error is raised.\n */\nexport function getExtension(message, extension) {\n assertExtendee(extension, message);\n const ufs = filterUnknownFields(message.$unknown, extension);\n const [container, field, get] = createExtensionContainer(extension);\n for (const uf of ufs) {\n readField(container, new BinaryReader(uf.data), field, uf.wireType, {\n readUnknownFields: true,\n });\n }\n return get();\n}\n/**\n * Set an extension value on a message. If the message already has a value for\n * this extension, the value is replaced.\n *\n * If the extension does not extend the given message, an error is raised.\n */\nexport function setExtension(message, extension, value) {\n var _a;\n assertExtendee(extension, message);\n const ufs = ((_a = message.$unknown) !== null && _a !== void 0 ? _a : []).filter((uf) => uf.no !== extension.number);\n const [container, field] = createExtensionContainer(extension, value);\n const writer = new BinaryWriter();\n writeField(writer, { writeUnknownFields: true }, container, field);\n const reader = new BinaryReader(writer.finish());\n while (reader.pos < reader.len) {\n const [no, wireType] = reader.tag();\n const data = reader.skip(wireType, no);\n ufs.push({ no, wireType, data });\n }\n message.$unknown = ufs;\n}\n/**\n * Remove an extension value from a message.\n *\n * If the extension does not extend the given message, an error is raised.\n */\nexport function clearExtension(message, extension) {\n assertExtendee(extension, message);\n if (message.$unknown === undefined) {\n return;\n }\n message.$unknown = message.$unknown.filter((uf) => uf.no !== extension.number);\n}\n/**\n * Check whether an extension is set on a message.\n */\nexport function hasExtension(message, extension) {\n var _a;\n return (extension.extendee.typeName === message.$typeName &&\n !!((_a = message.$unknown) === null || _a === void 0 ? void 0 : _a.find((uf) => uf.no === extension.number)));\n}\n/**\n * Check whether an option is set on a descriptor.\n *\n * Options are extensions to the `google.protobuf.*Options` messages defined in\n * google/protobuf/descriptor.proto. This function gets the option message from\n * the descriptor, and calls hasExtension().\n */\nexport function hasOption(element, option) {\n const message = element.proto.options;\n if (!message) {\n return false;\n }\n return hasExtension(message, option);\n}\n/**\n * Retrieve an option value from a descriptor.\n *\n * Options are extensions to the `google.protobuf.*Options` messages defined in\n * google/protobuf/descriptor.proto. This function gets the option message from\n * the descriptor, and calls getExtension(). Same as getExtension(), this\n * function never returns undefined.\n */\nexport function getOption(element, option) {\n const message = element.proto.options;\n if (!message) {\n const [, , get] = createExtensionContainer(option);\n return get();\n }\n return getExtension(message, option);\n}\nfunction filterUnknownFields(unknownFields, extension) {\n if (unknownFields === undefined)\n return [];\n if (extension.fieldKind === \"enum\" || extension.fieldKind === \"scalar\") {\n // singular scalar fields do not merge, we pick the last\n for (let i = unknownFields.length - 1; i >= 0; --i) {\n if (unknownFields[i].no == extension.number) {\n return [unknownFields[i]];\n }\n }\n return [];\n }\n return unknownFields.filter((uf) => uf.no === extension.number);\n}\n/**\n * @private\n */\nexport function createExtensionContainer(extension, value) {\n const localName = extension.typeName;\n const field = Object.assign(Object.assign({}, extension), { kind: \"field\", parent: extension.extendee, localName });\n const desc = Object.assign(Object.assign({}, extension.extendee), { fields: [field], members: [field], oneofs: [] });\n const container = create(desc, value !== undefined ? { [localName]: value } : undefined);\n return [\n reflect(desc, container),\n field,\n () => {\n const value = container[localName];\n if (value === undefined) {\n // biome-ignore lint/style/noNonNullAssertion: Only message fields are undefined, rest will have a zero value.\n const desc = extension.message;\n if (isWrapperDesc(desc)) {\n return scalarZeroValue(desc.fields[0].scalar, desc.fields[0].longAsString);\n }\n return create(desc);\n }\n return value;\n },\n ];\n}\nfunction assertExtendee(extension, message) {\n if (extension.extendee.typeName != message.$typeName) {\n throw new Error(`extension ${extension.typeName} can only be applied to message ${extension.extendee.typeName}`);\n }\n}\n","// Copyright 2021-2026 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { ScalarType, } from \"./descriptors.js\";\nimport { protoCamelCase, protoSnakeCase } from \"./reflect/names.js\";\nimport { reflect } from \"./reflect/reflect.js\";\nimport { anyUnpack } from \"./wkt/index.js\";\nimport { hasCustomJsonRepresentation, isWrapperDesc } from \"./wkt/wrappers.js\";\nimport { base64Encode } from \"./wire/index.js\";\nimport { createExtensionContainer, getExtension } from \"./extensions.js\";\nimport { checkField, formatVal } from \"./reflect/reflect-check.js\";\n// bootstrap-inject google.protobuf.FeatureSet.FieldPresence.LEGACY_REQUIRED: const $name: FeatureSet_FieldPresence.$localName = $number;\nconst LEGACY_REQUIRED = 3;\n// bootstrap-inject google.protobuf.FeatureSet.FieldPresence.IMPLICIT: const $name: FeatureSet_FieldPresence.$localName = $number;\nconst IMPLICIT = 2;\n// Default options for serializing to JSON.\nconst jsonWriteDefaults = {\n alwaysEmitImplicit: false,\n enumAsInteger: false,\n useProtoFieldName: false,\n};\nfunction makeWriteOptions(options) {\n return options ? Object.assign(Object.assign({}, jsonWriteDefaults), options) : jsonWriteDefaults;\n}\n/**\n * Serialize the message to a JSON value, a JavaScript value that can be\n * passed to JSON.stringify().\n */\nexport function toJson(schema, message, options) {\n return reflectToJson(reflect(schema, message), makeWriteOptions(options));\n}\n/**\n * Serialize the message to a JSON string.\n */\nexport function toJsonString(schema, message, options) {\n var _a;\n const jsonValue = toJson(schema, message, options);\n return JSON.stringify(jsonValue, null, (_a = options === null || options === void 0 ? void 0 : options.prettySpaces) !== null && _a !== void 0 ? _a : 0);\n}\n/**\n * Serialize a single enum value to JSON.\n */\nexport function enumToJson(descEnum, value) {\n var _a;\n if (descEnum.typeName == \"google.protobuf.NullValue\") {\n return null;\n }\n const name = (_a = descEnum.value[value]) === null || _a === void 0 ? void 0 : _a.name;\n if (name === undefined) {\n throw new Error(`${value} is not a value in ${descEnum}`);\n }\n return name;\n}\nfunction reflectToJson(msg, opts) {\n var _a;\n const wktJson = tryWktToJson(msg, opts);\n if (wktJson !== undefined)\n return wktJson;\n const json = {};\n for (const f of msg.sortedFields) {\n if (!msg.isSet(f)) {\n if (f.presence == LEGACY_REQUIRED) {\n throw new Error(`cannot encode ${f} to JSON: required field not set`);\n }\n if (!opts.alwaysEmitImplicit || f.presence !== IMPLICIT) {\n // Fields with implicit presence omit zero values (e.g. empty string) by default\n continue;\n }\n }\n const jsonValue = fieldToJson(f, msg.get(f), opts);\n if (jsonValue !== undefined) {\n json[jsonName(f, opts)] = jsonValue;\n }\n }\n if (opts.registry) {\n const tagSeen = new Set();\n for (const { no } of (_a = msg.getUnknown()) !== null && _a !== void 0 ? _a : []) {\n // Same tag can appear multiple times, so we\n // keep track and skip identical ones.\n if (!tagSeen.has(no)) {\n tagSeen.add(no);\n const extension = opts.registry.getExtensionFor(msg.desc, no);\n if (!extension) {\n continue;\n }\n const value = getExtension(msg.message, extension);\n const [container, field] = createExtensionContainer(extension, value);\n const jsonValue = fieldToJson(field, container.get(field), opts);\n if (jsonValue !== undefined) {\n json[extension.jsonName] = jsonValue;\n }\n }\n }\n }\n return json;\n}\nfunction fieldToJson(f, val, opts) {\n switch (f.fieldKind) {\n case \"scalar\":\n return scalarToJson(f, val);\n case \"message\":\n return reflectToJson(val, opts);\n case \"enum\":\n return enumToJsonInternal(f.enum, val, opts.enumAsInteger);\n case \"list\":\n return listToJson(val, opts);\n case \"map\":\n return mapToJson(val, opts);\n }\n}\nfunction mapToJson(map, opts) {\n const f = map.field();\n const jsonObj = {};\n switch (f.mapKind) {\n case \"scalar\":\n for (const [entryKey, entryValue] of map) {\n jsonObj[entryKey] = scalarToJson(f, entryValue);\n }\n break;\n case \"message\":\n for (const [entryKey, entryValue] of map) {\n jsonObj[entryKey] = reflectToJson(entryValue, opts);\n }\n break;\n case \"enum\":\n for (const [entryKey, entryValue] of map) {\n jsonObj[entryKey] = enumToJsonInternal(f.enum, entryValue, opts.enumAsInteger);\n }\n break;\n }\n return opts.alwaysEmitImplicit || map.size > 0 ? jsonObj : undefined;\n}\nfunction listToJson(list, opts) {\n const f = list.field();\n const jsonArr = [];\n switch (f.listKind) {\n case \"scalar\":\n for (const item of list) {\n jsonArr.push(scalarToJson(f, item));\n }\n break;\n case \"enum\":\n for (const item of list) {\n jsonArr.push(enumToJsonInternal(f.enum, item, opts.enumAsInteger));\n }\n break;\n case \"message\":\n for (const item of list) {\n jsonArr.push(reflectToJson(item, opts));\n }\n break;\n }\n return opts.alwaysEmitImplicit || jsonArr.length > 0 ? jsonArr : undefined;\n}\nfunction enumToJsonInternal(desc, value, enumAsInteger) {\n var _a;\n if (typeof value != \"number\") {\n throw new Error(`cannot encode ${desc} to JSON: expected number, got ${formatVal(value)}`);\n }\n if (desc.typeName == \"google.protobuf.NullValue\") {\n return null;\n }\n if (enumAsInteger) {\n return value;\n }\n const val = desc.value[value];\n return (_a = val === null || val === void 0 ? void 0 : val.name) !== null && _a !== void 0 ? _a : value; // if we don't know the enum value, just return the number\n}\nfunction scalarToJson(field, value) {\n var _a, _b, _c, _d, _e, _f;\n switch (field.scalar) {\n // int32, fixed32, uint32: JSON value will be a decimal number. Either numbers or strings are accepted.\n case ScalarType.INT32:\n case ScalarType.SFIXED32:\n case ScalarType.SINT32:\n case ScalarType.FIXED32:\n case ScalarType.UINT32:\n if (typeof value != \"number\") {\n throw new Error(`cannot encode ${field} to JSON: ${(_a = checkField(field, value)) === null || _a === void 0 ? void 0 : _a.message}`);\n }\n return value;\n // float, double: JSON value will be a number or one of the special string values \"NaN\", \"Infinity\", and \"-Infinity\".\n // Either numbers or strings are accepted. Exponent notation is also accepted.\n case ScalarType.FLOAT:\n case ScalarType.DOUBLE: // eslint-disable-line no-fallthrough\n if (typeof value != \"number\") {\n throw new Error(`cannot encode ${field} to JSON: ${(_b = checkField(field, value)) === null || _b === void 0 ? void 0 : _b.message}`);\n }\n if (Number.isNaN(value))\n return \"NaN\";\n if (value === Number.POSITIVE_INFINITY)\n return \"Infinity\";\n if (value === Number.NEGATIVE_INFINITY)\n return \"-Infinity\";\n return value;\n // string:\n case ScalarType.STRING:\n if (typeof value != \"string\") {\n throw new Error(`cannot encode ${field} to JSON: ${(_c = checkField(field, value)) === null || _c === void 0 ? void 0 : _c.message}`);\n }\n return value;\n // bool:\n case ScalarType.BOOL:\n if (typeof value != \"boolean\") {\n throw new Error(`cannot encode ${field} to JSON: ${(_d = checkField(field, value)) === null || _d === void 0 ? void 0 : _d.message}`);\n }\n return value;\n // JSON value will be a decimal string. Either numbers or strings are accepted.\n case ScalarType.UINT64:\n case ScalarType.FIXED64:\n case ScalarType.INT64:\n case ScalarType.SFIXED64:\n case ScalarType.SINT64:\n if (typeof value == \"bigint\" ||\n typeof value == \"string\" ||\n (typeof value == \"number\" && Number.isInteger(value))) {\n return value.toString();\n }\n throw new Error(`cannot encode ${field} to JSON: ${(_e = checkField(field, value)) === null || _e === void 0 ? void 0 : _e.message}`);\n // bytes: JSON value will be the data encoded as a string using standard base64 encoding with paddings.\n // Either standard or URL-safe base64 encoding with/without paddings are accepted.\n case ScalarType.BYTES:\n if (value instanceof Uint8Array) {\n return base64Encode(value);\n }\n throw new Error(`cannot encode ${field} to JSON: ${(_f = checkField(field, value)) === null || _f === void 0 ? void 0 : _f.message}`);\n }\n}\nfunction jsonName(f, opts) {\n return opts.useProtoFieldName ? f.name : f.jsonName;\n}\n// returns a json value if wkt, otherwise returns undefined.\nfunction tryWktToJson(msg, opts) {\n if (!msg.desc.typeName.startsWith(\"google.protobuf.\")) {\n return undefined;\n }\n switch (msg.desc.typeName) {\n case \"google.protobuf.Any\":\n return anyToJson(msg.message, opts);\n case \"google.protobuf.Timestamp\":\n return timestampToJson(msg.message);\n case \"google.protobuf.Duration\":\n return durationToJson(msg.message);\n case \"google.protobuf.FieldMask\":\n return fieldMaskToJson(msg.message);\n case \"google.protobuf.Struct\":\n return structToJson(msg.message);\n case \"google.protobuf.Value\":\n return valueToJson(msg.message);\n case \"google.protobuf.ListValue\":\n return listValueToJson(msg.message);\n default:\n if (isWrapperDesc(msg.desc)) {\n const valueField = msg.desc.fields[0];\n return scalarToJson(valueField, msg.get(valueField));\n }\n return undefined;\n }\n}\nfunction anyToJson(val, opts) {\n if (val.typeUrl === \"\") {\n return {};\n }\n const { registry } = opts;\n let message;\n let desc;\n if (registry) {\n message = anyUnpack(val, registry);\n if (message) {\n desc = registry.getMessage(message.$typeName);\n }\n }\n if (!desc || !message) {\n throw new Error(`cannot encode message ${val.$typeName} to JSON: \"${val.typeUrl}\" is not in the type registry`);\n }\n const reflected = reflect(desc, message);\n const json = hasCustomJsonRepresentation(desc)\n ? { value: tryWktToJson(reflected, opts) }\n : reflectToJson(reflected, opts);\n json[\"@type\"] = val.typeUrl;\n return json;\n}\nfunction durationToJson(val) {\n const seconds = Number(val.seconds);\n const nanos = val.nanos;\n if (seconds > 315576000000 || seconds < -315576000000) {\n throw new Error(`cannot encode message ${val.$typeName} to JSON: value out of range`);\n }\n if ((seconds > 0 && nanos < 0) || (seconds < 0 && nanos > 0)) {\n throw new Error(`cannot encode message ${val.$typeName} to JSON: nanos sign must match seconds sign`);\n }\n let text = val.seconds.toString();\n if (nanos !== 0) {\n let nanosStr = Math.abs(nanos).toString();\n nanosStr = \"0\".repeat(9 - nanosStr.length) + nanosStr;\n if (nanosStr.substring(3) === \"000000\") {\n nanosStr = nanosStr.substring(0, 3);\n }\n else if (nanosStr.substring(6) === \"000\") {\n nanosStr = nanosStr.substring(0, 6);\n }\n text += \".\" + nanosStr;\n if (nanos < 0 && seconds == 0) {\n text = \"-\" + text;\n }\n }\n return text + \"s\";\n}\nfunction fieldMaskToJson(val) {\n return val.paths\n .map((p) => {\n if (protoSnakeCase(protoCamelCase(p)) !== p) {\n throw new Error(`cannot encode message ${val.$typeName} to JSON: lowerCamelCase of path name \"${p}\" is irreversible`);\n }\n return protoCamelCase(p);\n })\n .join(\",\");\n}\nfunction structToJson(val) {\n const json = {};\n for (const [k, v] of Object.entries(val.fields)) {\n json[k] = valueToJson(v);\n }\n return json;\n}\nfunction valueToJson(val) {\n switch (val.kind.case) {\n case \"nullValue\":\n return null;\n case \"numberValue\":\n if (!Number.isFinite(val.kind.value)) {\n throw new Error(`${val.$typeName} cannot be NaN or Infinity`);\n }\n return val.kind.value;\n case \"boolValue\":\n return val.kind.value;\n case \"stringValue\":\n return val.kind.value;\n case \"structValue\":\n return structToJson(val.kind.value);\n case \"listValue\":\n return listValueToJson(val.kind.value);\n default:\n throw new Error(`${val.$typeName} must have a value`);\n }\n}\nfunction listValueToJson(val) {\n return val.values.map(valueToJson);\n}\nfunction timestampToJson(val) {\n const ms = Number(val.seconds) * 1000;\n if (ms < Date.parse(\"0001-01-01T00:00:00Z\") ||\n ms > Date.parse(\"9999-12-31T23:59:59Z\")) {\n throw new Error(`cannot encode message ${val.$typeName} to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);\n }\n if (val.nanos < 0) {\n throw new Error(`cannot encode message ${val.$typeName} to JSON: nanos must not be negative`);\n }\n if (val.nanos > 999999999) {\n throw new Error(`cannot encode message ${val.$typeName} to JSON: nanos must not be greater than 99999999`);\n }\n let z = \"Z\";\n if (val.nanos > 0) {\n const nanosStr = (val.nanos + 1000000000).toString().substring(1);\n if (nanosStr.substring(3) === \"000000\") {\n z = \".\" + nanosStr.substring(0, 3) + \"Z\";\n }\n else if (nanosStr.substring(6) === \"000\") {\n z = \".\" + nanosStr.substring(0, 6) + \"Z\";\n }\n else {\n z = \".\" + nanosStr + \"Z\";\n }\n }\n return new Date(ms).toISOString().replace(\".000Z\", z);\n}\n","// Copyright 2021-2026 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { ScalarType, } from \"./descriptors.js\";\nimport { protoInt64 } from \"./proto-int64.js\";\nimport { create } from \"./create.js\";\nimport { reflect } from \"./reflect/reflect.js\";\nimport { FieldError, isFieldError } from \"./reflect/error.js\";\nimport { formatVal } from \"./reflect/reflect-check.js\";\nimport { protoSnakeCase } from \"./reflect/names.js\";\nimport { base64Decode } from \"./wire/base64-encoding.js\";\nimport { hasCustomJsonRepresentation, isWrapperDesc, anyPack, ListValueSchema, NullValue, StructSchema, ValueSchema, } from \"./wkt/index.js\";\nimport { createExtensionContainer, setExtension } from \"./extensions.js\";\n// Default options for parsing JSON.\nconst jsonReadDefaults = {\n ignoreUnknownFields: false,\n};\nfunction makeReadOptions(options) {\n return options ? Object.assign(Object.assign({}, jsonReadDefaults), options) : jsonReadDefaults;\n}\n/**\n * Parse a message from a JSON string.\n */\nexport function fromJsonString(schema, json, options) {\n return fromJson(schema, parseJsonString(json, schema.typeName), options);\n}\n/**\n * Parse a message from a JSON string, merging fields.\n *\n * Repeated fields are appended. Map entries are added, overwriting\n * existing keys.\n *\n * If a message field is already present, it will be merged with the\n * new data.\n */\nexport function mergeFromJsonString(schema, target, json, options) {\n return mergeFromJson(schema, target, parseJsonString(json, schema.typeName), options);\n}\n/**\n * Parse a message from a JSON value.\n */\nexport function fromJson(schema, json, options) {\n const msg = reflect(schema);\n try {\n readMessage(msg, json, makeReadOptions(options));\n }\n catch (e) {\n if (isFieldError(e)) {\n // @ts-expect-error we use the ES2022 error CTOR option \"cause\" for better stack traces\n throw new Error(`cannot decode ${e.field()} from JSON: ${e.message}`, {\n cause: e,\n });\n }\n throw e;\n }\n return msg.message;\n}\n/**\n * Parse a message from a JSON value, merging fields.\n *\n * Repeated fields are appended. Map entries are added, overwriting\n * existing keys.\n *\n * If a message field is already present, it will be merged with the\n * new data.\n */\nexport function mergeFromJson(schema, target, json, options) {\n try {\n readMessage(reflect(schema, target), json, makeReadOptions(options));\n }\n catch (e) {\n if (isFieldError(e)) {\n // @ts-expect-error we use the ES2022 error CTOR option \"cause\" for better stack traces\n throw new Error(`cannot decode ${e.field()} from JSON: ${e.message}`, {\n cause: e,\n });\n }\n throw e;\n }\n return target;\n}\n/**\n * Parses an enum value from JSON.\n */\nexport function enumFromJson(descEnum, json) {\n return readEnum(descEnum, json, false);\n}\n/**\n * Is the given value a JSON enum value?\n */\nexport function isEnumJson(descEnum, value) {\n return undefined !== descEnum.values.find((v) => v.name === value);\n}\nconst messageJsonFields = new WeakMap();\nfunction getJsonField(desc, jsonKey) {\n var _a;\n if (!messageJsonFields.has(desc)) {\n const jsonNames = new Map();\n for (const field of desc.fields) {\n jsonNames.set(field.name, field).set(field.jsonName, field);\n }\n messageJsonFields.set(desc, jsonNames);\n }\n return (_a = messageJsonFields.get(desc)) === null || _a === void 0 ? void 0 : _a.get(jsonKey);\n}\nfunction readMessage(msg, json, opts) {\n var _a;\n if (tryWktFromJson(msg, json, opts)) {\n return;\n }\n if (json == null || Array.isArray(json) || typeof json != \"object\") {\n throw new Error(`cannot decode ${msg.desc} from JSON: ${formatVal(json)}`);\n }\n const oneofSeen = new Map();\n for (const [jsonKey, jsonValue] of Object.entries(json)) {\n const field = getJsonField(msg.desc, jsonKey);\n if (field) {\n if (field.oneof) {\n if (jsonValue === null && field.fieldKind == \"scalar\") {\n // see conformance test Required.Proto3.JsonInput.OneofFieldNull{First,Second}\n continue;\n }\n const seen = oneofSeen.get(field.oneof);\n if (seen !== undefined) {\n throw new FieldError(field.oneof, `oneof set multiple times by ${seen.name} and ${field.name}`);\n }\n oneofSeen.set(field.oneof, field);\n }\n readField(msg, field, jsonValue, opts);\n }\n else {\n let extension = undefined;\n if (jsonKey.startsWith(\"[\") &&\n jsonKey.endsWith(\"]\") &&\n // biome-ignore lint/suspicious/noAssignInExpressions: no\n (extension = (_a = opts.registry) === null || _a === void 0 ? void 0 : _a.getExtension(jsonKey.substring(1, jsonKey.length - 1))) &&\n extension.extendee.typeName === msg.desc.typeName) {\n const [container, field, get] = createExtensionContainer(extension);\n readField(container, field, jsonValue, opts);\n setExtension(msg.message, extension, get());\n }\n if (!extension && !opts.ignoreUnknownFields) {\n throw new Error(`cannot decode ${msg.desc} from JSON: key \"${jsonKey}\" is unknown`);\n }\n }\n }\n}\nfunction readField(msg, field, json, opts) {\n switch (field.fieldKind) {\n case \"scalar\":\n readScalarField(msg, field, json);\n break;\n case \"enum\":\n readEnumField(msg, field, json, opts);\n break;\n case \"message\":\n readMessageField(msg, field, json, opts);\n break;\n case \"list\":\n readListField(msg.get(field), json, opts);\n break;\n case \"map\":\n readMapField(msg.get(field), json, opts);\n break;\n }\n}\nfunction readListOrMapItem(field, json, opts) {\n if (field.scalar && json !== null) {\n return scalarFromJson(field, json);\n }\n if (field.message && !isResetSentinelNullValue(field, json)) {\n const msgValue = reflect(field.message);\n readMessage(msgValue, json, opts);\n return msgValue;\n }\n if (field.enum && !isResetSentinelNullValue(field, json)) {\n return readEnum(field.enum, json, opts.ignoreUnknownFields);\n }\n throw new FieldError(field, `${field.fieldKind === \"list\" ? \"list item\" : \"map value\"} must not be null`);\n}\nfunction readMapField(map, json, opts) {\n if (json === null) {\n return;\n }\n const field = map.field();\n if (typeof json != \"object\" || Array.isArray(json)) {\n throw new FieldError(field, \"expected object, got \" + formatVal(json));\n }\n for (const [jsonMapKey, jsonMapValue] of Object.entries(json)) {\n const key = mapKeyFromJson(field.mapKey, jsonMapKey);\n const value = readListOrMapItem(field, jsonMapValue, opts);\n if (value !== tokenIgnoredUnknownEnum) {\n map.set(key, value);\n }\n }\n}\nfunction readListField(list, json, opts) {\n if (json === null) {\n return;\n }\n const field = list.field();\n if (!Array.isArray(json)) {\n throw new FieldError(field, \"expected Array, got \" + formatVal(json));\n }\n for (const jsonItem of json) {\n const value = readListOrMapItem(field, jsonItem, opts);\n if (value !== tokenIgnoredUnknownEnum) {\n list.add(value);\n }\n }\n}\nfunction readMessageField(msg, field, json, opts) {\n if (isResetSentinelNullValue(field, json)) {\n msg.clear(field);\n return;\n }\n const msgValue = msg.isSet(field) ? msg.get(field) : reflect(field.message);\n readMessage(msgValue, json, opts);\n msg.set(field, msgValue);\n}\nfunction readEnumField(msg, field, json, opts) {\n if (isResetSentinelNullValue(field, json)) {\n msg.clear(field);\n return;\n }\n const enumValue = readEnum(field.enum, json, opts.ignoreUnknownFields);\n if (enumValue !== tokenIgnoredUnknownEnum) {\n msg.set(field, enumValue);\n }\n}\nfunction readScalarField(msg, field, json) {\n if (json === null) {\n msg.clear(field);\n }\n else {\n msg.set(field, scalarFromJson(field, json));\n }\n}\n/**\n * Indicates whether a value is a sentinel for reseting a field.\n *\n * For this to be true, the value must be a JSON null and the field must not\n * permit a present, Protobuf-serializable null.\n *\n * Only message google.protobuf.Value and enum google.protobuf.NullValue fields\n * permit Protobuf-serializable nulls.\n *\n * Note that field-resetting sentinel nulls are not permitted in lists and maps.\n */\nfunction isResetSentinelNullValue(field, json) {\n var _a, _b;\n return (json === null &&\n ((_a = field.message) === null || _a === void 0 ? void 0 : _a.typeName) != \"google.protobuf.Value\" &&\n ((_b = field.enum) === null || _b === void 0 ? void 0 : _b.typeName) != \"google.protobuf.NullValue\");\n}\nconst tokenIgnoredUnknownEnum = Symbol();\nfunction readEnum(desc, json, ignoreUnknownFields) {\n if (json === null) {\n return desc.values[0].number;\n }\n switch (typeof json) {\n case \"number\":\n if (Number.isInteger(json)) {\n return json;\n }\n break;\n case \"string\":\n const value = desc.values.find((ev) => ev.name === json);\n if (value !== undefined) {\n return value.number;\n }\n if (ignoreUnknownFields) {\n return tokenIgnoredUnknownEnum;\n }\n break;\n }\n throw new Error(`cannot decode ${desc} from JSON: ${formatVal(json)}`);\n}\n/**\n * Try to parse a JSON value to a scalar value for the reflect API.\n *\n * Returns the input if the JSON value cannot be converted. Raises a FieldError\n * if conversion would be ambiguous.\n */\nfunction scalarFromJson(field, json) {\n // int64, sfixed64, sint64, fixed64, uint64: Reflect supports string and number.\n // string, bool: Supported by reflect.\n switch (field.scalar) {\n // float, double: JSON value will be a number or one of the special string values \"NaN\", \"Infinity\", and \"-Infinity\".\n // Either numbers or strings are accepted. Exponent notation is also accepted.\n case ScalarType.DOUBLE:\n case ScalarType.FLOAT:\n if (json === \"NaN\")\n return NaN;\n if (json === \"Infinity\")\n return Number.POSITIVE_INFINITY;\n if (json === \"-Infinity\")\n return Number.NEGATIVE_INFINITY;\n if (typeof json == \"number\") {\n if (Number.isNaN(json)) {\n // NaN must be encoded with string constants\n throw new FieldError(field, \"unexpected NaN number\");\n }\n if (!Number.isFinite(json)) {\n // Infinity must be encoded with string constants\n throw new FieldError(field, \"unexpected infinite number\");\n }\n break;\n }\n if (typeof json == \"string\") {\n if (json === \"\") {\n // empty string is not a number\n break;\n }\n if (json.trim().length !== json.length) {\n // extra whitespace\n break;\n }\n const float = Number(json);\n if (!Number.isFinite(float)) {\n // Infinity and NaN must be encoded with string constants\n break;\n }\n return float;\n }\n break;\n // int32, fixed32, uint32: JSON value will be a decimal number. Either numbers or strings are accepted.\n case ScalarType.INT32:\n case ScalarType.FIXED32:\n case ScalarType.SFIXED32:\n case ScalarType.SINT32:\n case ScalarType.UINT32:\n return int32FromJson(json);\n // bytes: JSON value will be the data encoded as a string using standard base64 encoding with paddings.\n // Either standard or URL-safe base64 encoding with/without paddings are accepted.\n case ScalarType.BYTES:\n if (typeof json == \"string\") {\n if (json === \"\") {\n return new Uint8Array(0);\n }\n try {\n return base64Decode(json);\n }\n catch (e) {\n const message = e instanceof Error ? e.message : String(e);\n throw new FieldError(field, message);\n }\n }\n break;\n }\n return json;\n}\n/**\n * Try to parse a JSON value to a map key for the reflect API.\n *\n * Returns the input if the JSON value cannot be converted.\n */\nfunction mapKeyFromJson(type, jsonString) {\n switch (type) {\n case ScalarType.BOOL:\n switch (jsonString) {\n case \"true\":\n return true;\n case \"false\":\n return false;\n }\n return jsonString;\n case ScalarType.INT32:\n case ScalarType.FIXED32:\n case ScalarType.UINT32:\n case ScalarType.SFIXED32:\n case ScalarType.SINT32:\n return int32FromJson(jsonString);\n default:\n return jsonString;\n }\n}\n/**\n * Try to parse a JSON value to a 32-bit integer for the reflect API.\n *\n * Returns the input if the JSON value cannot be converted.\n */\nfunction int32FromJson(json) {\n if (typeof json == \"string\") {\n if (json === \"\") {\n // empty string is not a number\n return json;\n }\n if (json.trim().length !== json.length) {\n // extra whitespace\n return json;\n }\n const num = Number(json);\n if (Number.isNaN(num)) {\n // not a number\n return json;\n }\n return num;\n }\n return json;\n}\nfunction parseJsonString(jsonString, typeName) {\n try {\n return JSON.parse(jsonString);\n }\n catch (e) {\n const message = e instanceof Error ? e.message : String(e);\n throw new Error(`cannot decode message ${typeName} from JSON: ${message}`, \n // @ts-expect-error we use the ES2022 error CTOR option \"cause\" for better stack traces\n { cause: e });\n }\n}\nfunction tryWktFromJson(msg, jsonValue, opts) {\n if (!msg.desc.typeName.startsWith(\"google.protobuf.\")) {\n return false;\n }\n switch (msg.desc.typeName) {\n case \"google.protobuf.Any\":\n anyFromJson(msg.message, jsonValue, opts);\n return true;\n case \"google.protobuf.Timestamp\":\n timestampFromJson(msg.message, jsonValue);\n return true;\n case \"google.protobuf.Duration\":\n durationFromJson(msg.message, jsonValue);\n return true;\n case \"google.protobuf.FieldMask\":\n fieldMaskFromJson(msg.message, jsonValue);\n return true;\n case \"google.protobuf.Struct\":\n structFromJson(msg.message, jsonValue);\n return true;\n case \"google.protobuf.Value\":\n valueFromJson(msg.message, jsonValue);\n return true;\n case \"google.protobuf.ListValue\":\n listValueFromJson(msg.message, jsonValue);\n return true;\n default:\n if (isWrapperDesc(msg.desc)) {\n const valueField = msg.desc.fields[0];\n if (jsonValue === null) {\n msg.clear(valueField);\n }\n else {\n msg.set(valueField, scalarFromJson(valueField, jsonValue));\n }\n return true;\n }\n return false;\n }\n}\nfunction anyFromJson(any, json, opts) {\n var _a;\n if (json === null || Array.isArray(json) || typeof json != \"object\") {\n throw new Error(`cannot decode message ${any.$typeName} from JSON: expected object but got ${formatVal(json)}`);\n }\n if (Object.keys(json).length == 0) {\n return;\n }\n const typeUrl = json[\"@type\"];\n if (typeof typeUrl != \"string\" || typeUrl == \"\") {\n throw new Error(`cannot decode message ${any.$typeName} from JSON: \"@type\" is empty`);\n }\n const typeName = typeUrl.includes(\"/\")\n ? typeUrl.substring(typeUrl.lastIndexOf(\"/\") + 1)\n : typeUrl;\n if (!typeName.length) {\n throw new Error(`cannot decode message ${any.$typeName} from JSON: \"@type\" is invalid`);\n }\n const desc = (_a = opts.registry) === null || _a === void 0 ? void 0 : _a.getMessage(typeName);\n if (!desc) {\n throw new Error(`cannot decode message ${any.$typeName} from JSON: ${typeUrl} is not in the type registry`);\n }\n const msg = reflect(desc);\n if (hasCustomJsonRepresentation(desc) &&\n Object.prototype.hasOwnProperty.call(json, \"value\")) {\n const value = json.value;\n readMessage(msg, value, opts);\n }\n else {\n const copy = Object.assign({}, json);\n // biome-ignore lint/performance/noDelete: <explanation>\n delete copy[\"@type\"];\n readMessage(msg, copy, opts);\n }\n anyPack(msg.desc, msg.message, any);\n}\nfunction timestampFromJson(timestamp, json) {\n if (typeof json !== \"string\") {\n throw new Error(`cannot decode message ${timestamp.$typeName} from JSON: ${formatVal(json)}`);\n }\n const matches = json.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\\.([0-9]{1,9}))?(?:Z|([+-][0-9][0-9]:[0-9][0-9]))$/);\n if (!matches) {\n throw new Error(`cannot decode message ${timestamp.$typeName} from JSON: invalid RFC 3339 string`);\n }\n const ms = Date.parse(\n // biome-ignore format: want this to read well\n matches[1] + \"-\" + matches[2] + \"-\" + matches[3] + \"T\" + matches[4] + \":\" + matches[5] + \":\" + matches[6] + (matches[8] ? matches[8] : \"Z\"));\n if (Number.isNaN(ms)) {\n throw new Error(`cannot decode message ${timestamp.$typeName} from JSON: invalid RFC 3339 string`);\n }\n if (ms < Date.parse(\"0001-01-01T00:00:00Z\") ||\n ms > Date.parse(\"9999-12-31T23:59:59Z\")) {\n throw new Error(`cannot decode message ${timestamp.$typeName} from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);\n }\n timestamp.seconds = protoInt64.parse(ms / 1000);\n timestamp.nanos = 0;\n if (matches[7]) {\n timestamp.nanos =\n parseInt(\"1\" + matches[7] + \"0\".repeat(9 - matches[7].length)) -\n 1000000000;\n }\n}\nfunction durationFromJson(duration, json) {\n if (typeof json !== \"string\") {\n throw new Error(`cannot decode message ${duration.$typeName} from JSON: ${formatVal(json)}`);\n }\n const match = json.match(/^(-?[0-9]+)(?:\\.([0-9]+))?s/);\n if (match === null) {\n throw new Error(`cannot decode message ${duration.$typeName} from JSON: ${formatVal(json)}`);\n }\n const longSeconds = Number(match[1]);\n if (longSeconds > 315576000000 || longSeconds < -315576000000) {\n throw new Error(`cannot decode message ${duration.$typeName} from JSON: ${formatVal(json)}`);\n }\n duration.seconds = protoInt64.parse(longSeconds);\n if (typeof match[2] !== \"string\") {\n return;\n }\n const nanosStr = match[2] + \"0\".repeat(9 - match[2].length);\n duration.nanos = parseInt(nanosStr);\n if (longSeconds < 0 || Object.is(longSeconds, -0)) {\n duration.nanos = -duration.nanos;\n }\n}\nfunction fieldMaskFromJson(fieldMask, json) {\n if (typeof json !== \"string\") {\n throw new Error(`cannot decode message ${fieldMask.$typeName} from JSON: ${formatVal(json)}`);\n }\n if (json === \"\") {\n return;\n }\n fieldMask.paths = json.split(\",\").map((path) => {\n if (path.includes(\"_\")) {\n throw new Error(`cannot decode message ${fieldMask.$typeName} from JSON: path names must be lowerCamelCase`);\n }\n return protoSnakeCase(path);\n });\n}\nfunction structFromJson(struct, json) {\n if (typeof json != \"object\" || json == null || Array.isArray(json)) {\n throw new Error(`cannot decode message ${struct.$typeName} from JSON ${formatVal(json)}`);\n }\n for (const [k, v] of Object.entries(json)) {\n const parsedV = create(ValueSchema);\n valueFromJson(parsedV, v);\n struct.fields[k] = parsedV;\n }\n}\nfunction valueFromJson(value, json) {\n switch (typeof json) {\n case \"number\":\n value.kind = { case: \"numberValue\", value: json };\n break;\n case \"string\":\n value.kind = { case: \"stringValue\", value: json };\n break;\n case \"boolean\":\n value.kind = { case: \"boolValue\", value: json };\n break;\n case \"object\":\n if (json === null) {\n value.kind = { case: \"nullValue\", value: NullValue.NULL_VALUE };\n }\n else if (Array.isArray(json)) {\n const listValue = create(ListValueSchema);\n listValueFromJson(listValue, json);\n value.kind = { case: \"listValue\", value: listValue };\n }\n else {\n const struct = create(StructSchema);\n structFromJson(struct, json);\n value.kind = { case: \"structValue\", value: struct };\n }\n break;\n default:\n throw new Error(`cannot decode message ${value.$typeName} from JSON ${formatVal(json)}`);\n }\n return value;\n}\nfunction listValueFromJson(listValue, json) {\n if (!Array.isArray(json)) {\n throw new Error(`cannot decode message ${listValue.$typeName} from JSON ${formatVal(json)}`);\n }\n for (const e of json) {\n const value = create(ValueSchema);\n valueFromJson(value, e);\n listValue.values.push(value);\n }\n}\n","// Copyright 2021-2026 The Connect Authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n/**\n * Create any client for the given service.\n *\n * The given createMethod function is called for each method definition\n * of the service. The function it returns is added to the client object\n * as a method.\n */\nexport function makeAnyClient(service, createMethod) {\n const client = {};\n for (const desc of service.methods) {\n const method = createMethod(desc);\n if (method != null) {\n client[desc.localName] = method;\n }\n }\n return client;\n}\n","// Copyright 2021-2026 The Connect Authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nvar __asyncValues = (this && this.__asyncValues) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n};\nvar __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }\nvar __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n};\nvar __asyncDelegator = (this && this.__asyncDelegator) || function (o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n};\nimport { Code } from \"../code.js\";\nimport { ConnectError } from \"../connect-error.js\";\nimport { createEnvelopeDecoder } from \"./envelope.js\";\nimport { encodeEnvelope, envelopeCompress, envelopeDecompress, } from \"./envelope.js\";\nimport { assertReadMaxBytes } from \"./limit-io.js\";\nexport function pipeTo(source, ...rest) {\n const [transforms, sink, opt] = pickTransformsAndSink(rest);\n let iterable = source;\n let abortable;\n if ((opt === null || opt === void 0 ? void 0 : opt.propagateDownStreamError) === true) {\n iterable = abortable = makeIterableAbortable(iterable);\n }\n // @ts-ignore\n iterable = pipe(iterable, ...transforms, { propagateDownStreamError: false });\n return sink(iterable).catch((reason) => {\n if (abortable) {\n return abortable.abort(reason).then(() => Promise.reject(reason));\n }\n return Promise.reject(reason);\n });\n}\n// pick transforms, the sink, and options from the pipeTo() rest parameter\nfunction pickTransformsAndSink(rest) {\n let opt;\n if (typeof rest[rest.length - 1] != \"function\") {\n opt = rest.pop();\n }\n const sink = rest.pop();\n return [rest, sink, opt];\n}\n/**\n * Creates an AsyncIterableSink that concatenates all elements from the input.\n *\n * @private Internal code, does not follow semantic versioning.\n */\nexport function sinkAll() {\n return async (iterable) => {\n var _a, e_1, _b, _c;\n const all = [];\n try {\n for (var _d = true, iterable_1 = __asyncValues(iterable), iterable_1_1; iterable_1_1 = await iterable_1.next(), _a = iterable_1_1.done, !_a; _d = true) {\n _c = iterable_1_1.value;\n _d = false;\n const chunk = _c;\n all.push(chunk);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (!_d && !_a && (_b = iterable_1.return)) await _b.call(iterable_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return all;\n };\n}\n/**\n * Creates an AsyncIterableSink that concatenates all chunks from the input into\n * a single Uint8Array.\n *\n * The iterable raises an error if the more than readMaxBytes are read.\n *\n * An optional length hint can be provided to optimize allocation and validation.\n * If more or less bytes are present in the source that the length hint indicates,\n * and error is raised.\n * If the length hint is larger than readMaxBytes, an error is raised.\n * If the length hint is not a positive integer, it is ignored.\n *\n * @private Internal code, does not follow semantic versioning.\n */\nexport function sinkAllBytes(readMaxBytes, lengthHint) {\n return async (iterable) => await readAllBytes(iterable, readMaxBytes, lengthHint);\n}\nexport function pipe(source, ...rest) {\n return __asyncGenerator(this, arguments, function* pipe_1() {\n var _a;\n const [transforms, opt] = pickTransforms(rest);\n let abortable;\n const sourceIt = source[Symbol.asyncIterator]();\n const cachedSource = {\n [Symbol.asyncIterator]() {\n return sourceIt;\n },\n };\n let iterable = cachedSource;\n if ((opt === null || opt === void 0 ? void 0 : opt.propagateDownStreamError) === true) {\n iterable = abortable = makeIterableAbortable(iterable);\n }\n for (const t of transforms) {\n iterable = t(iterable);\n }\n const it = iterable[Symbol.asyncIterator]();\n try {\n for (;;) {\n const r = yield __await(it.next());\n if (r.done === true) {\n break;\n }\n if (!abortable) {\n yield yield __await(r.value);\n continue;\n }\n try {\n yield yield __await(r.value);\n }\n catch (e) {\n yield __await(abortable.abort(e)); // propagate downstream error to the source\n throw e;\n }\n }\n }\n finally {\n if ((opt === null || opt === void 0 ? void 0 : opt.propagateDownStreamError) === true) {\n // Call return on the source iterable to indicate\n // that we will no longer consume it and it should\n // cleanup any allocated resources.\n (_a = sourceIt.return) === null || _a === void 0 ? void 0 : _a.call(sourceIt).catch(() => {\n // return returns a promise, which we don't care about.\n //\n // Uncaught promises are thrown at sometime/somewhere by the event loop,\n // this is to ensure error is caught and ignored.\n });\n }\n }\n });\n}\nfunction pickTransforms(rest) {\n let opt;\n if (typeof rest[rest.length - 1] != \"function\") {\n opt = rest.pop();\n }\n return [rest, opt];\n}\n/**\n * Creates an AsyncIterableTransform that catches any error from the input, and\n * passes it to the given catchError function.\n *\n * The catchError function may return a final value.\n *\n * @private Internal code, does not follow semantic versioning.\n */\nexport function transformCatch(catchError) {\n return function (iterable) {\n return __asyncGenerator(this, arguments, function* () {\n // we deliberate avoid a for-await loop because we only want to catch upstream\n // errors, not downstream errors (yield).\n const it = iterable[Symbol.asyncIterator]();\n for (;;) {\n let r;\n try {\n r = yield __await(it.next());\n }\n catch (e) {\n const caught = yield __await(catchError(e));\n if (caught !== undefined) {\n yield yield __await(caught);\n }\n break;\n }\n if (r.done === true) {\n break;\n }\n yield yield __await(r.value);\n }\n });\n };\n}\n/**\n * Creates an AsyncIterableTransform that catches any error from the input, and\n * passes it to the given function. Unlike transformCatch(), the given function\n * is also called when no error is raised.\n *\n * @private Internal code, does not follow semantic versioning.\n */\nexport function transformCatchFinally(catchFinally) {\n return function (iterable) {\n return __asyncGenerator(this, arguments, function* () {\n // we deliberate avoid a for-await loop because we only want to catch upstream\n // errors, not downstream errors (yield).\n let err;\n const it = iterable[Symbol.asyncIterator]();\n for (;;) {\n let r;\n try {\n r = yield __await(it.next());\n }\n catch (e) {\n err = e;\n break;\n }\n if (r.done === true) {\n break;\n }\n yield yield __await(r.value);\n }\n const caught = yield __await(catchFinally(err));\n if (caught !== undefined) {\n yield yield __await(caught);\n }\n });\n };\n}\n/**\n * Creates an AsyncIterableTransform that appends a value.\n *\n * The element to append is provided by a function. If the function returns\n * undefined, no element is appended.\n *\n * @private Internal code, does not follow semantic versioning.\n */\nexport function transformAppend(provide) {\n return function (iterable) {\n return __asyncGenerator(this, arguments, function* () {\n var _a, e_2, _b, _c;\n try {\n for (var _d = true, iterable_2 = __asyncValues(iterable), iterable_2_1; iterable_2_1 = yield __await(iterable_2.next()), _a = iterable_2_1.done, !_a; _d = true) {\n _c = iterable_2_1.value;\n _d = false;\n const chunk = _c;\n yield yield __await(chunk);\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (!_d && !_a && (_b = iterable_2.return)) yield __await(_b.call(iterable_2));\n }\n finally { if (e_2) throw e_2.error; }\n }\n const append = yield __await(provide());\n if (append !== undefined) {\n yield yield __await(append);\n }\n });\n };\n}\n/**\n * Creates an AsyncIterableTransform that prepends an element.\n *\n * The element to prepend is provided by a function. If the function returns\n * undefined, no element is appended.\n *\n * @private Internal code, does not follow semantic versioning.\n */\nexport function transformPrepend(provide) {\n return function (iterable) {\n return __asyncGenerator(this, arguments, function* () {\n var _a, e_3, _b, _c;\n const prepend = yield __await(provide());\n if (prepend !== undefined) {\n yield yield __await(prepend);\n }\n try {\n for (var _d = true, iterable_3 = __asyncValues(iterable), iterable_3_1; iterable_3_1 = yield __await(iterable_3.next()), _a = iterable_3_1.done, !_a; _d = true) {\n _c = iterable_3_1.value;\n _d = false;\n const chunk = _c;\n yield yield __await(chunk);\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (!_d && !_a && (_b = iterable_3.return)) yield __await(_b.call(iterable_3));\n }\n finally { if (e_3) throw e_3.error; }\n }\n });\n };\n}\n/**\n * Creates an AsyncIterableTransform that reads all bytes from the input, and\n * concatenates them to a single Uint8Array.\n *\n * The iterable raises an error if the more than readMaxBytes are read.\n *\n * An optional length hint can be provided to optimize allocation and validation.\n * If more or less bytes are present in the source that the length hint indicates,\n * and error is raised.\n * If the length hint is larger than readMaxBytes, an error is raised.\n * If the length hint is not a positive integer, it is ignored.\n *\n * @private Internal code, does not follow semantic versioning.\n */\nexport function transformReadAllBytes(readMaxBytes, lengthHint) {\n return function (iterable) {\n return __asyncGenerator(this, arguments, function* () {\n yield yield __await(yield __await(readAllBytes(iterable, readMaxBytes, lengthHint)));\n });\n };\n}\nexport function transformSerializeEnvelope(serialization, endStreamFlag, endSerialization) {\n if (endStreamFlag === undefined || endSerialization === undefined) {\n return function (iterable) {\n return __asyncGenerator(this, arguments, function* () {\n var _a, e_4, _b, _c;\n try {\n for (var _d = true, iterable_4 = __asyncValues(iterable), iterable_4_1; iterable_4_1 = yield __await(iterable_4.next()), _a = iterable_4_1.done, !_a; _d = true) {\n _c = iterable_4_1.value;\n _d = false;\n const chunk = _c;\n const data = serialization.serialize(chunk);\n yield yield __await({ flags: 0, data });\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (!_d && !_a && (_b = iterable_4.return)) yield __await(_b.call(iterable_4));\n }\n finally { if (e_4) throw e_4.error; }\n }\n });\n };\n }\n return function (iterable) {\n return __asyncGenerator(this, arguments, function* () {\n var _a, e_5, _b, _c;\n try {\n for (var _d = true, iterable_5 = __asyncValues(iterable), iterable_5_1; iterable_5_1 = yield __await(iterable_5.next()), _a = iterable_5_1.done, !_a; _d = true) {\n _c = iterable_5_1.value;\n _d = false;\n const chunk = _c;\n let data;\n let flags = 0;\n if (chunk.end) {\n flags = flags | endStreamFlag;\n data = endSerialization.serialize(chunk.value);\n }\n else {\n data = serialization.serialize(chunk.value);\n }\n yield yield __await({ flags, data });\n }\n }\n catch (e_5_1) { e_5 = { error: e_5_1 }; }\n finally {\n try {\n if (!_d && !_a && (_b = iterable_5.return)) yield __await(_b.call(iterable_5));\n }\n finally { if (e_5) throw e_5.error; }\n }\n });\n };\n}\nexport function transformParseEnvelope(serialization, endStreamFlag, endSerialization) {\n // code path always yields ParsedEnvelopedMessage<T, E>\n if (endSerialization && endStreamFlag !== undefined) {\n return function (iterable) {\n return __asyncGenerator(this, arguments, function* () {\n var _a, e_6, _b, _c;\n try {\n for (var _d = true, iterable_6 = __asyncValues(iterable), iterable_6_1; iterable_6_1 = yield __await(iterable_6.next()), _a = iterable_6_1.done, !_a; _d = true) {\n _c = iterable_6_1.value;\n _d = false;\n const { flags, data } = _c;\n if ((flags & endStreamFlag) === endStreamFlag) {\n yield yield __await({ value: endSerialization.parse(data), end: true });\n }\n else {\n yield yield __await({ value: serialization.parse(data), end: false });\n }\n }\n }\n catch (e_6_1) { e_6 = { error: e_6_1 }; }\n finally {\n try {\n if (!_d && !_a && (_b = iterable_6.return)) yield __await(_b.call(iterable_6));\n }\n finally { if (e_6) throw e_6.error; }\n }\n });\n };\n }\n // code path always yields T\n return function (iterable) {\n return __asyncGenerator(this, arguments, function* () {\n var _a, e_7, _b, _c;\n try {\n for (var _d = true, iterable_7 = __asyncValues(iterable), iterable_7_1; iterable_7_1 = yield __await(iterable_7.next()), _a = iterable_7_1.done, !_a; _d = true) {\n _c = iterable_7_1.value;\n _d = false;\n const { flags, data } = _c;\n if (endStreamFlag !== undefined &&\n (flags & endStreamFlag) === endStreamFlag) {\n if (endSerialization === null) {\n throw new ConnectError(\"unexpected end flag\", Code.InvalidArgument);\n }\n // skips end-of-stream envelope\n continue;\n }\n yield yield __await(serialization.parse(data));\n }\n }\n catch (e_7_1) { e_7 = { error: e_7_1 }; }\n finally {\n try {\n if (!_d && !_a && (_b = iterable_7.return)) yield __await(_b.call(iterable_7));\n }\n finally { if (e_7) throw e_7.error; }\n }\n });\n };\n}\n/**\n * Creates an AsyncIterableTransform that takes enveloped messages as a source,\n * and compresses them if they are larger than compressMinBytes.\n *\n * @private Internal code, does not follow semantic versioning.\n */\nexport function transformCompressEnvelope(compression, compressMinBytes) {\n return function (iterable) {\n return __asyncGenerator(this, arguments, function* () {\n var _a, e_8, _b, _c;\n try {\n for (var _d = true, iterable_8 = __asyncValues(iterable), iterable_8_1; iterable_8_1 = yield __await(iterable_8.next()), _a = iterable_8_1.done, !_a; _d = true) {\n _c = iterable_8_1.value;\n _d = false;\n const env = _c;\n yield yield __await(yield __await(envelopeCompress(env, compression, compressMinBytes)));\n }\n }\n catch (e_8_1) { e_8 = { error: e_8_1 }; }\n finally {\n try {\n if (!_d && !_a && (_b = iterable_8.return)) yield __await(_b.call(iterable_8));\n }\n finally { if (e_8) throw e_8.error; }\n }\n });\n };\n}\n/**\n * Creates an AsyncIterableTransform that takes enveloped messages as a source,\n * and decompresses them using the given compression.\n *\n * The iterable raises an error if the decompressed payload of an enveloped\n * message is larger than readMaxBytes, or if no compression is provided.\n *\n * @private Internal code, does not follow semantic versioning.\n */\nexport function transformDecompressEnvelope(compression, readMaxBytes) {\n return function (iterable) {\n return __asyncGenerator(this, arguments, function* () {\n var _a, e_9, _b, _c;\n try {\n for (var _d = true, iterable_9 = __asyncValues(iterable), iterable_9_1; iterable_9_1 = yield __await(iterable_9.next()), _a = iterable_9_1.done, !_a; _d = true) {\n _c = iterable_9_1.value;\n _d = false;\n const env = _c;\n yield yield __await(yield __await(envelopeDecompress(env, compression, readMaxBytes)));\n }\n }\n catch (e_9_1) { e_9 = { error: e_9_1 }; }\n finally {\n try {\n if (!_d && !_a && (_b = iterable_9.return)) yield __await(_b.call(iterable_9));\n }\n finally { if (e_9) throw e_9.error; }\n }\n });\n };\n}\n/**\n * Create an AsyncIterableTransform that takes enveloped messages as a source,\n * and joins them into a stream of raw bytes.\n *\n * @private Internal code, does not follow semantic versioning.\n */\nexport function transformJoinEnvelopes() {\n return function (iterable) {\n return __asyncGenerator(this, arguments, function* () {\n var _a, e_10, _b, _c;\n try {\n for (var _d = true, iterable_10 = __asyncValues(iterable), iterable_10_1; iterable_10_1 = yield __await(iterable_10.next()), _a = iterable_10_1.done, !_a; _d = true) {\n _c = iterable_10_1.value;\n _d = false;\n const { flags, data } = _c;\n yield yield __await(encodeEnvelope(flags, data));\n }\n }\n catch (e_10_1) { e_10 = { error: e_10_1 }; }\n finally {\n try {\n if (!_d && !_a && (_b = iterable_10.return)) yield __await(_b.call(iterable_10));\n }\n finally { if (e_10) throw e_10.error; }\n }\n });\n };\n}\n/**\n * Create an AsyncIterableTransform that takes raw bytes as a source, and splits\n * them into enveloped messages.\n *\n * The iterable raises an error\n * - if the payload of an enveloped message is larger than readMaxBytes,\n * - if the stream ended before an enveloped message fully arrived,\n * - or if the stream ended with extraneous data.\n *\n * @private Internal code, does not follow semantic versioning.\n */\nexport function transformSplitEnvelope(readMaxBytes) {\n return function (iterable) {\n return __asyncGenerator(this, arguments, function* () {\n var _a, e_11, _b, _c;\n const buffer = createEnvelopeDecoder(readMaxBytes);\n try {\n for (var _d = true, iterable_11 = __asyncValues(iterable), iterable_11_1; iterable_11_1 = yield __await(iterable_11.next()), _a = iterable_11_1.done, !_a; _d = true) {\n _c = iterable_11_1.value;\n _d = false;\n const chunk = _c;\n for (const env of buffer.decode(chunk)) {\n yield yield __await(env);\n }\n }\n }\n catch (e_11_1) { e_11 = { error: e_11_1 }; }\n finally {\n try {\n if (!_d && !_a && (_b = iterable_11.return)) yield __await(_b.call(iterable_11));\n }\n finally { if (e_11) throw e_11.error; }\n }\n if (buffer.byteLength > 0) {\n throw new ConnectError(\"protocol error: incomplete envelope\", Code.InvalidArgument);\n }\n });\n };\n}\n/**\n * Reads all bytes from the source, and concatenates them to a single Uint8Array.\n *\n * Raises an error if:\n * - more than readMaxBytes are read\n * - lengthHint is a positive integer, but larger than readMaxBytes\n * - lengthHint is a positive integer, and the source contains more or less bytes\n * than promised\n *\n * @private Internal code, does not follow semantic versioning.\n */\nexport async function readAllBytes(iterable, readMaxBytes, lengthHint) {\n var _a, e_12, _b, _c, _d, e_13, _e, _f;\n const [ok, hint] = parseLengthHint(lengthHint);\n if (ok) {\n if (hint > readMaxBytes) {\n assertReadMaxBytes(readMaxBytes, hint, true);\n }\n const buffer = new Uint8Array(hint);\n let offset = 0;\n try {\n for (var _g = true, iterable_12 = __asyncValues(iterable), iterable_12_1; iterable_12_1 = await iterable_12.next(), _a = iterable_12_1.done, !_a; _g = true) {\n _c = iterable_12_1.value;\n _g = false;\n const chunk = _c;\n if (offset + chunk.byteLength > hint) {\n throw new ConnectError(`protocol error: promised ${hint} bytes, received ${offset + chunk.byteLength}`, Code.InvalidArgument);\n }\n buffer.set(chunk, offset);\n offset += chunk.byteLength;\n }\n }\n catch (e_12_1) { e_12 = { error: e_12_1 }; }\n finally {\n try {\n if (!_g && !_a && (_b = iterable_12.return)) await _b.call(iterable_12);\n }\n finally { if (e_12) throw e_12.error; }\n }\n if (offset < hint) {\n throw new ConnectError(`protocol error: promised ${hint} bytes, received ${offset}`, Code.InvalidArgument);\n }\n return buffer;\n }\n const chunks = [];\n let count = 0;\n try {\n for (var _h = true, iterable_13 = __asyncValues(iterable), iterable_13_1; iterable_13_1 = await iterable_13.next(), _d = iterable_13_1.done, !_d; _h = true) {\n _f = iterable_13_1.value;\n _h = false;\n const chunk = _f;\n count += chunk.byteLength;\n assertReadMaxBytes(readMaxBytes, count);\n chunks.push(chunk);\n }\n }\n catch (e_13_1) { e_13 = { error: e_13_1 }; }\n finally {\n try {\n if (!_h && !_d && (_e = iterable_13.return)) await _e.call(iterable_13);\n }\n finally { if (e_13) throw e_13.error; }\n }\n const all = new Uint8Array(count);\n let offset = 0;\n for (let chunk = chunks.shift(); chunk; chunk = chunks.shift()) {\n all.set(chunk, offset);\n offset += chunk.byteLength;\n }\n return all;\n}\n// parse the lengthHint argument of readAllBytes()\nfunction parseLengthHint(lengthHint) {\n if (lengthHint === undefined || lengthHint === null) {\n return [false, 0];\n }\n const n = typeof lengthHint == \"string\" ? parseInt(lengthHint, 10) : lengthHint;\n if (!Number.isSafeInteger(n) || n < 0) {\n return [false, n];\n }\n return [true, n];\n}\n/**\n * Wait for the first element of an iterable without modifying the iterable.\n * This consumes the first element, but pushes it back on the stack.\n *\n * @private Internal code, does not follow semantic versioning.\n */\nexport async function untilFirst(iterable) {\n const it = iterable[Symbol.asyncIterator]();\n let first = await it.next();\n return {\n [Symbol.asyncIterator]() {\n const w = {\n async next() {\n if (first !== null) {\n const n = first;\n first = null;\n return n;\n }\n return await it.next();\n },\n };\n if (it.throw !== undefined) {\n w.throw = (e) => it.throw(e);\n }\n if (it.return !== undefined) {\n w.return = (value) => it.return(value);\n }\n return w;\n },\n };\n}\n/**\n * Wrap the given iterable and return an iterable with an abort() method.\n *\n * This function exists purely for convenience. Where one would typically have\n * to access the iterator directly, advance through all elements, and call\n * AsyncIterator.throw() to notify the upstream iterable, this function allows\n * to use convenient for-await loops and still notify the upstream iterable:\n *\n * ```ts\n * const abortable = makeIterableAbortable(iterable);\n * for await (const ele of abortable) {\n * await abortable.abort(\"ERR\");\n * }\n * ```\n * There are a couple of limitations of this function:\n * - the given async iterable must implement throw\n * - the async iterable cannot be re-use\n * - if source catches errors and yields values for them, they are ignored, and\n * the source may still dangle\n *\n * There are four possible ways an async function* can handle yield errors:\n * 1. don't catch errors at all - Abortable.abort() will resolve \"rethrown\"\n * 2. catch errors and rethrow - Abortable.abort() will resolve \"rethrown\"\n * 3. catch errors and return - Abortable.abort() will resolve \"completed\"\n * 4. catch errors and yield a value - Abortable.abort() will resolve \"caught\"\n *\n * Note that catching errors and yielding a value is problematic, and it should\n * be documented that this may leave the source in a dangling state.\n *\n * @private Internal code, does not follow semantic versioning.\n */\nexport function makeIterableAbortable(iterable) {\n const innerCandidate = iterable[Symbol.asyncIterator]();\n if (innerCandidate.throw === undefined) {\n throw new Error(\"AsyncIterable does not implement throw\");\n }\n const inner = innerCandidate;\n let aborted;\n let resultPromise;\n let it = {\n next() {\n resultPromise = inner.next().finally(() => {\n resultPromise = undefined;\n });\n return resultPromise;\n },\n throw(e) {\n return inner.throw(e);\n },\n };\n if (innerCandidate.return !== undefined) {\n it = Object.assign(Object.assign({}, it), { return(value) {\n return inner.return(value);\n } });\n }\n let used = false;\n return {\n abort(reason) {\n if (aborted) {\n return aborted.state;\n }\n const f = () => {\n return inner.throw(reason).then((r) => (r.done === true ? \"completed\" : \"caught\"), () => \"rethrown\");\n };\n if (resultPromise) {\n aborted = { reason, state: resultPromise.then(f, f) };\n return aborted.state;\n }\n aborted = { reason, state: f() };\n return aborted.state;\n },\n [Symbol.asyncIterator]() {\n if (used) {\n throw new Error(\"AsyncIterable cannot be re-used\");\n }\n used = true;\n return it;\n },\n };\n}\n/**\n * Create a new WritableIterable.\n */\nexport function createWritableIterable() {\n // We start with two queues to capture the read and write attempts.\n //\n // The writes and reads each check of their counterpart is\n // already available and either interact/add themselves to the queue.\n const readQueue = [];\n const writeQueue = [];\n let err = undefined;\n let nextResolve;\n let nextReject;\n let nextPromise = new Promise((resolve, reject) => {\n nextResolve = resolve;\n nextReject = reject;\n });\n let closed = false;\n // drain the readQueue in case of error/writer is closed by sending a\n // done result.\n function drain() {\n for (const next of readQueue.splice(0, readQueue.length)) {\n next({ done: true, value: undefined });\n }\n }\n return {\n close() {\n closed = true;\n drain();\n },\n async write(payload) {\n if (closed) {\n throw err !== null && err !== void 0 ? err : new Error(\"cannot write, WritableIterable already closed\");\n }\n const read = readQueue.shift();\n if (read === undefined) {\n // We didn't find a pending read so we add the payload to the write queue.\n writeQueue.push(payload);\n }\n else {\n // We found a pending read so we respond with the payload.\n read({ done: false, value: payload });\n if (readQueue.length > 0) {\n // If there are more in the read queue we can mark the write as complete.\n // as the error reporting is not guaranteed to be sequential and therefore cannot\n // to linked to a specific write.\n return;\n }\n }\n // We await the next call for as many times as there are items in the queue + 1\n //\n // If there are no items in the write queue that means write happened and we just have\n // to wait for one more call likewise if we are the nth write in the queue we\n // have to wait for n writes to complete and one more.\n const limit = writeQueue.length + 1;\n for (let i = 0; i < limit; i++) {\n await nextPromise;\n }\n },\n [Symbol.asyncIterator]() {\n return {\n next() {\n // Resolve the nextPromise to indicate\n // pending writes that a read attempt has been made\n // after their write.\n //\n // We also need to reset the promise for future writes.\n nextResolve();\n nextPromise = new Promise((resolve, reject) => {\n nextResolve = resolve;\n nextReject = reject;\n });\n const write = writeQueue.shift();\n if (write !== undefined) {\n // We found a pending write so response with the payload.\n return Promise.resolve({ done: false, value: write });\n }\n if (closed) {\n return Promise.resolve({ done: true, value: undefined });\n }\n // We return a promise immediately that is either resolved/rejected\n // as writes happen.\n let readResolve;\n const readPromise = new Promise((resolve) => {\n readResolve = resolve;\n });\n // biome-ignore lint/style/noNonNullAssertion: initialized by promise executor\n readQueue.push(readResolve);\n return readPromise;\n },\n throw(throwErr) {\n err = throwErr;\n closed = true;\n writeQueue.splice(0, writeQueue.length);\n nextPromise.catch(() => {\n // To make sure that the nextPromise is always resolved.\n });\n // This will reject all pending writes.\n nextReject(err);\n drain();\n return Promise.resolve({ done: true, value: undefined });\n },\n return() {\n closed = true;\n writeQueue.splice(0, writeQueue.length);\n // Resolve once for the write awaiting confirmation.\n nextResolve();\n // Reject all future writes.\n nextPromise = Promise.reject(new Error(\"cannot write, consumer called return\"));\n nextPromise.catch(() => {\n // To make sure that the nextPromise is always resolved.\n });\n drain();\n return Promise.resolve({ done: true, value: undefined });\n },\n };\n },\n };\n}\n/**\n * Create an asynchronous iterable from an array.\n *\n * @private Internal code, does not follow semantic versioning.\n */\nexport function createAsyncIterable(items) {\n return __asyncGenerator(this, arguments, function* createAsyncIterable_1() {\n yield __await(yield* __asyncDelegator(__asyncValues(items)));\n });\n}\n","// Copyright 2021-2026 The Connect Authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nvar __asyncValues = (this && this.__asyncValues) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n};\nvar __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }\nvar __asyncDelegator = (this && this.__asyncDelegator) || function (o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n};\nvar __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n};\nimport { makeAnyClient } from \"./any-client.js\";\nimport { ConnectError } from \"./connect-error.js\";\nimport { Code } from \"./code.js\";\nimport { createAsyncIterable } from \"./protocol/async-iterable.js\";\n/**\n * Create a Client for the given service, invoking RPCs through the\n * given transport.\n */\nexport function createClient(service, transport) {\n return makeAnyClient(service, (method) => {\n switch (method.methodKind) {\n case \"unary\":\n return createUnaryFn(transport, method);\n case \"server_streaming\":\n return createServerStreamingFn(transport, method);\n case \"client_streaming\":\n return createClientStreamingFn(transport, method);\n case \"bidi_streaming\":\n return createBiDiStreamingFn(transport, method);\n default:\n return null;\n }\n });\n}\nexport function createUnaryFn(transport, method) {\n return async (input, options) => {\n var _a, _b;\n const response = await transport.unary(method, options === null || options === void 0 ? void 0 : options.signal, options === null || options === void 0 ? void 0 : options.timeoutMs, options === null || options === void 0 ? void 0 : options.headers, input, options === null || options === void 0 ? void 0 : options.contextValues);\n (_a = options === null || options === void 0 ? void 0 : options.onHeader) === null || _a === void 0 ? void 0 : _a.call(options, response.header);\n (_b = options === null || options === void 0 ? void 0 : options.onTrailer) === null || _b === void 0 ? void 0 : _b.call(options, response.trailer);\n return response.message;\n };\n}\nexport function createServerStreamingFn(transport, method) {\n return (input, options) => handleStreamResponse(transport.stream(method, options === null || options === void 0 ? void 0 : options.signal, options === null || options === void 0 ? void 0 : options.timeoutMs, options === null || options === void 0 ? void 0 : options.headers, createAsyncIterable([input]), options === null || options === void 0 ? void 0 : options.contextValues), options);\n}\nexport function createClientStreamingFn(transport, method) {\n return async (request, options) => {\n var _a, e_1, _b, _c;\n var _d, _e;\n const response = await transport.stream(method, options === null || options === void 0 ? void 0 : options.signal, options === null || options === void 0 ? void 0 : options.timeoutMs, options === null || options === void 0 ? void 0 : options.headers, request, options === null || options === void 0 ? void 0 : options.contextValues);\n (_d = options === null || options === void 0 ? void 0 : options.onHeader) === null || _d === void 0 ? void 0 : _d.call(options, response.header);\n let singleMessage;\n let count = 0;\n try {\n for (var _f = true, _g = __asyncValues(response.message), _h; _h = await _g.next(), _a = _h.done, !_a; _f = true) {\n _c = _h.value;\n _f = false;\n const message = _c;\n singleMessage = message;\n count++;\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (!_f && !_a && (_b = _g.return)) await _b.call(_g);\n }\n finally { if (e_1) throw e_1.error; }\n }\n if (!singleMessage) {\n throw new ConnectError(\"protocol error: missing response message\", Code.Unimplemented);\n }\n if (count > 1) {\n throw new ConnectError(\"protocol error: received extra messages for client streaming method\", Code.Unimplemented);\n }\n (_e = options === null || options === void 0 ? void 0 : options.onTrailer) === null || _e === void 0 ? void 0 : _e.call(options, response.trailer);\n return singleMessage;\n };\n}\nexport function createBiDiStreamingFn(transport, method) {\n return (request, options) => handleStreamResponse(transport.stream(method, options === null || options === void 0 ? void 0 : options.signal, options === null || options === void 0 ? void 0 : options.timeoutMs, options === null || options === void 0 ? void 0 : options.headers, request, options === null || options === void 0 ? void 0 : options.contextValues), options);\n}\nfunction handleStreamResponse(stream, options) {\n const it = (function () {\n return __asyncGenerator(this, arguments, function* () {\n var _a, _b;\n const response = yield __await(stream);\n (_a = options === null || options === void 0 ? void 0 : options.onHeader) === null || _a === void 0 ? void 0 : _a.call(options, response.header);\n yield __await(yield* __asyncDelegator(__asyncValues(response.message)));\n (_b = options === null || options === void 0 ? void 0 : options.onTrailer) === null || _b === void 0 ? void 0 : _b.call(options, response.trailer);\n });\n })()[Symbol.asyncIterator]();\n // Create a new iterable to omit throw/return.\n return {\n [Symbol.asyncIterator]: () => ({\n next: () => it.next(),\n }),\n };\n}\n","// Copyright 2021-2026 The Connect Authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n/**\n * createContextValues creates a new ContextValues.\n */\nexport function createContextValues() {\n return {\n get(key) {\n return key.id in this ? this[key.id] : key.defaultValue;\n },\n set(key, value) {\n this[key.id] = value;\n return this;\n },\n delete(key) {\n delete this[key.id];\n return this;\n },\n };\n}\n/**\n * createContextKey creates a new ContextKey.\n */\nexport function createContextKey(defaultValue, options) {\n return { id: Symbol(options === null || options === void 0 ? void 0 : options.description), defaultValue };\n}\n","import { TimeOrBlock } from '../eth/bind-options.js'\nimport { Block, JsonRpcProvider, EthersError } from 'ethers'\n\nasync function getBlockSafely(provider: JsonRpcProvider, blockNumber: number | string): Promise<Block> {\n const block = await provider.getBlock(blockNumber)\n if (!block) {\n throw new Error(`Block ${blockNumber} not found.`)\n }\n return block\n}\n\nexport async function estimateBlockNumberAtDate(\n provider: JsonRpcProvider,\n targetDate: Date,\n startBlock?: number\n): Promise<number | undefined> {\n // Convert JS Date to Unix timestamp in hex\n const timestampHex = '0x' + Math.floor(targetDate.getTime()).toString(16)\n\n // You can customize these based on how your RPC expects it\n // Ensure rangeStart is hex if defined, else default to \"earliest\"\n const rangeStart = startBlock !== undefined ? '0x' + startBlock.toString(16) : 'earliest'\n\n const rangeEnd = 'latest'\n const strategy = 'LE' // or \"GE\", depending on your use case\n\n let result\n try {\n result = await provider.send('sentio_estimateBlockNumberAtDate', [timestampHex, rangeStart, rangeEnd, strategy])\n } catch (e) {\n const serverError = e as EthersError\n if (\n serverError.code === 'SERVER_ERROR' ||\n serverError.code === 'UNKNOWN_ERROR' ||\n serverError.code === 'UNSUPPORTED_OPERATION'\n ) {\n return await estimateBlockNumberAtDateSlow(provider, targetDate, startBlock)\n }\n throw e\n }\n\n if (result === null) {\n return undefined\n }\n\n return parseInt(result, 16)\n}\n\nexport async function estimateBlockNumberAtDateSlow(\n provider: JsonRpcProvider,\n targetDate: Date,\n startBlock?: number\n): Promise<number | undefined> {\n // Convert the Date object to a Unix timestamp (in seconds)\n const targetTimestamp = Math.floor(targetDate.getTime() / 1000)\n\n // Step 1: Get the current block number and its timestamp\n const latestBlock = await getBlockSafely(provider, 'latest')\n const earliestBlockNumber = startBlock !== undefined ? startBlock : 0\n const earliestBlock = await getBlockSafely(provider, earliestBlockNumber)\n\n // Binary search initialization\n let low = earliestBlock.number\n let high = latestBlock.number\n\n while (low <= high) {\n const mid = Math.floor((low + high) / 2)\n const midBlock = await getBlockSafely(provider, mid)\n\n if (midBlock.timestamp === targetTimestamp) {\n return midBlock.number // Exact match\n } else if (midBlock.timestamp < targetTimestamp) {\n low = mid + 1 // Target is in the upper half\n } else {\n high = mid - 1 // Target is in the lower half\n }\n }\n\n // If exact timestamp is not found, return undefined\n if (high === -1) return undefined\n\n const closestBlock = await getBlockSafely(provider, high)\n return closestBlock.number\n}\n\nexport async function timeOrBlockToBlockNumber(provider: JsonRpcProvider, timeOrBlock: TimeOrBlock): Promise<bigint> {\n if (timeOrBlock.block) {\n return BigInt(timeOrBlock.block)\n }\n if (!timeOrBlock.time) {\n return 0n\n }\n const block = await estimateBlockNumberAtDate(provider, timeOrBlock.time)\n if (!block) {\n throw new Error('Block not found')\n }\n return BigInt(block)\n}\n","// import { BigDecimal } from '../core/big-decimal.js'\n// import { Numberish } from '../core/index.js'\n// import { MetricValue } from '@sentio/protos'\n\nexport function bytesToBigInt(bytes: Uint8Array) {\n let intValue = BigInt(0)\n for (let i = 0; i < bytes.length; i++) {\n intValue = intValue * BigInt(256) + BigInt(bytes[i])\n }\n return intValue\n}\n\n// export function metricValueToNumberish(v: MetricValue): Numberish {\n// if (v.doubleValue) {\n// return v.doubleValue\n// }\n// if (v.bigInteger) {\n// let intValue = bytesToBigInt(v.bigInteger.data)\n// if (v.bigInteger.negative) {\n// intValue = -intValue\n// }\n// return intValue\n// }\n//\n// if (v.bigDecimal) {\n// return new BigDecimal(v.bigDecimal)\n// }\n//\n// throw Error(\"MetricValue doesn't contain any of possible value\")\n// }\n","/**\n * The [Base58 Encoding](link-base58) scheme allows a **numeric** value\n * to be encoded as a compact string using a radix of 58 using only\n * alpha-numeric characters. Confusingly similar characters are omitted\n * (i.e. ``\"l0O\"``).\n *\n * Note that Base58 encodes a **numeric** value, not arbitrary bytes,\n * since any zero-bytes on the left would get removed. To mitigate this\n * issue most schemes that use Base58 choose specific high-order values\n * to ensure non-zero prefixes.\n *\n * @_subsection: api/utils:Base58 Encoding [about-base58]\n */\nimport { getBytes } from \"./data.js\";\nimport { assertArgument } from \"./errors.js\";\nimport { toBigInt } from \"./maths.js\";\nconst Alphabet = \"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\";\nlet Lookup = null;\nfunction getAlpha(letter) {\n if (Lookup == null) {\n Lookup = {};\n for (let i = 0; i < Alphabet.length; i++) {\n Lookup[Alphabet[i]] = BigInt(i);\n }\n }\n const result = Lookup[letter];\n assertArgument(result != null, `invalid base58 value`, \"letter\", letter);\n return result;\n}\nconst BN_0 = BigInt(0);\nconst BN_58 = BigInt(58);\n/**\n * Encode %%value%% as a Base58-encoded string.\n */\nexport function encodeBase58(_value) {\n const bytes = getBytes(_value);\n let value = toBigInt(bytes);\n let result = \"\";\n while (value) {\n result = Alphabet[Number(value % BN_58)] + result;\n value /= BN_58;\n }\n // Account for leading padding zeros\n for (let i = 0; i < bytes.length; i++) {\n if (bytes[i]) {\n break;\n }\n result = Alphabet[0] + result;\n }\n return result;\n}\n/**\n * Decode the Base58-encoded %%value%%.\n */\nexport function decodeBase58(value) {\n let result = BN_0;\n for (let i = 0; i < value.length; i++) {\n result *= BN_58;\n result += getAlpha(value[i]);\n }\n return result;\n}\n//# sourceMappingURL=base58.js.map","/**\n * [Base64 encoding](link-wiki-base64) using 6-bit words to encode\n * arbitrary bytes into a string using 65 printable symbols, the\n * upper-case and lower-case alphabet, the digits ``0`` through ``9``,\n * ``\"+\"`` and ``\"/\"`` with the ``\"=\"`` used for padding.\n *\n * @_subsection: api/utils:Base64 Encoding [about-base64]\n */\nimport { getBytes, getBytesCopy } from \"./data.js\";\n/**\n * Decodes the base-64 encoded %%value%%.\n *\n * @example:\n * // The decoded value is always binary data...\n * result = decodeBase64(\"SGVsbG8gV29ybGQhIQ==\")\n * //_result:\n *\n * // ...use toUtf8String to convert it to a string.\n * toUtf8String(result)\n * //_result:\n *\n * // Decoding binary data\n * decodeBase64(\"EjQ=\")\n * //_result:\n */\nexport function decodeBase64(value) {\n return getBytesCopy(Buffer.from(value, \"base64\"));\n}\n;\n/**\n * Encodes %%data%% as a base-64 encoded string.\n *\n * @example:\n * // Encoding binary data as a hexstring\n * encodeBase64(\"0x1234\")\n * //_result:\n *\n * // Encoding binary data as a Uint8Array\n * encodeBase64(new Uint8Array([ 0x12, 0x34 ]))\n * //_result:\n *\n * // The input MUST be data...\n * encodeBase64(\"Hello World!!\")\n * //_error:\n *\n * // ...use toUtf8Bytes for this.\n * encodeBase64(toUtf8Bytes(\"Hello World!!\"))\n * //_result:\n */\nexport function encodeBase64(data) {\n return Buffer.from(getBytes(data)).toString(\"base64\");\n}\n//# sourceMappingURL=base64.js.map","import http from \"http\";\nimport https from \"https\";\nimport { gunzipSync } from \"zlib\";\nimport { assert, makeError } from \"./errors.js\";\nimport { getBytes } from \"./data.js\";\n/**\n * @_ignore:\n */\nexport function createGetUrl(options) {\n async function getUrl(req, signal) {\n // Make sure we weren't cancelled before sending\n assert(signal == null || !signal.cancelled, \"request cancelled before sending\", \"CANCELLED\");\n const protocol = req.url.split(\":\")[0].toLowerCase();\n assert(protocol === \"http\" || protocol === \"https\", `unsupported protocol ${protocol}`, \"UNSUPPORTED_OPERATION\", {\n info: { protocol },\n operation: \"request\"\n });\n assert(protocol === \"https\" || !req.credentials || req.allowInsecureAuthentication, \"insecure authorized connections unsupported\", \"UNSUPPORTED_OPERATION\", {\n operation: \"request\"\n });\n const method = req.method;\n const headers = Object.assign({}, req.headers);\n const reqOptions = { method, headers };\n if (options) {\n if (options.agent) {\n reqOptions.agent = options.agent;\n }\n }\n // Create a Node-specific AbortController, if available\n let abort = null;\n try {\n abort = new AbortController();\n reqOptions.abort = abort.signal;\n }\n catch (e) {\n console.log(e);\n }\n const request = ((protocol === \"http\") ? http : https).request(req.url, reqOptions);\n request.setTimeout(req.timeout);\n const body = req.body;\n if (body) {\n request.write(Buffer.from(body));\n }\n request.end();\n return new Promise((resolve, reject) => {\n if (signal) {\n signal.addListener(() => {\n if (abort) {\n abort.abort();\n }\n reject(makeError(\"request cancelled\", \"CANCELLED\"));\n });\n }\n request.on(\"timeout\", () => {\n reject(makeError(\"request timeout\", \"TIMEOUT\"));\n });\n request.once(\"response\", (resp) => {\n const statusCode = resp.statusCode || 0;\n const statusMessage = resp.statusMessage || \"\";\n const headers = Object.keys(resp.headers || {}).reduce((accum, name) => {\n let value = resp.headers[name] || \"\";\n if (Array.isArray(value)) {\n value = value.join(\", \");\n }\n accum[name] = value;\n return accum;\n }, {});\n let body = null;\n //resp.setEncoding(\"utf8\");\n resp.on(\"data\", (chunk) => {\n if (signal) {\n try {\n signal.checkSignal();\n }\n catch (error) {\n return reject(error);\n }\n }\n if (body == null) {\n body = chunk;\n }\n else {\n const newBody = new Uint8Array(body.length + chunk.length);\n newBody.set(body, 0);\n newBody.set(chunk, body.length);\n body = newBody;\n }\n });\n resp.on(\"end\", () => {\n try {\n if (headers[\"content-encoding\"] === \"gzip\" && body) {\n body = getBytes(gunzipSync(body));\n }\n resolve({ statusCode, statusMessage, headers, body });\n }\n catch (error) {\n reject(makeError(\"bad response data\", \"SERVER_ERROR\", {\n request: req, info: { response: resp, error }\n }));\n }\n });\n resp.on(\"error\", (error) => {\n //@TODO: Should this just return nornal response with a server error?\n error.response = { statusCode, statusMessage, headers, body };\n reject(error);\n });\n });\n request.on(\"error\", (error) => { reject(error); });\n });\n }\n return getUrl;\n}\n// @TODO: remove in v7; provided for backwards compat\nconst defaultGetUrl = createGetUrl({});\n/**\n * @_ignore:\n */\nexport async function getUrl(req, signal) {\n return defaultGetUrl(req, signal);\n}\n//# sourceMappingURL=geturl.js.map","/**\n * Fetching content from the web is environment-specific, so Ethers\n * provides an abstraction that each environment can implement to provide\n * this service.\n *\n * On [Node.js](link-node), the ``http`` and ``https`` libs are used to\n * create a request object, register event listeners and process data\n * and populate the [[FetchResponse]].\n *\n * In a browser, the [DOM fetch](link-js-fetch) is used, and the resulting\n * ``Promise`` is waited on to retrieve the payload.\n *\n * The [[FetchRequest]] is responsible for handling many common situations,\n * such as redirects, server throttling, authentication, etc.\n *\n * It also handles common gateways, such as IPFS and data URIs.\n *\n * @_section api/utils/fetching:Fetching Web Content [about-fetch]\n */\nimport { decodeBase64, encodeBase64 } from \"./base64.js\";\nimport { hexlify } from \"./data.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nimport { defineProperties } from \"./properties.js\";\nimport { toUtf8Bytes, toUtf8String } from \"./utf8.js\";\nimport { createGetUrl } from \"./geturl.js\";\nconst MAX_ATTEMPTS = 12;\nconst SLOT_INTERVAL = 250;\n// The global FetchGetUrlFunc implementation.\nlet defaultGetUrlFunc = createGetUrl();\nconst reData = new RegExp(\"^data:([^;:]*)?(;base64)?,(.*)$\", \"i\");\nconst reIpfs = new RegExp(\"^ipfs:/\\/(ipfs/)?(.*)$\", \"i\");\n// If locked, new Gateways cannot be added\nlet locked = false;\n// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs\nasync function dataGatewayFunc(url, signal) {\n try {\n const match = url.match(reData);\n if (!match) {\n throw new Error(\"invalid data\");\n }\n return new FetchResponse(200, \"OK\", {\n \"content-type\": (match[1] || \"text/plain\"),\n }, (match[2] ? decodeBase64(match[3]) : unpercent(match[3])));\n }\n catch (error) {\n return new FetchResponse(599, \"BAD REQUEST (invalid data: URI)\", {}, null, new FetchRequest(url));\n }\n}\n/**\n * Returns a [[FetchGatewayFunc]] for fetching content from a standard\n * IPFS gateway hosted at %%baseUrl%%.\n */\nfunction getIpfsGatewayFunc(baseUrl) {\n async function gatewayIpfs(url, signal) {\n try {\n const match = url.match(reIpfs);\n if (!match) {\n throw new Error(\"invalid link\");\n }\n return new FetchRequest(`${baseUrl}${match[2]}`);\n }\n catch (error) {\n return new FetchResponse(599, \"BAD REQUEST (invalid IPFS URI)\", {}, null, new FetchRequest(url));\n }\n }\n return gatewayIpfs;\n}\nconst Gateways = {\n \"data\": dataGatewayFunc,\n \"ipfs\": getIpfsGatewayFunc(\"https:/\\/gateway.ipfs.io/ipfs/\")\n};\nconst fetchSignals = new WeakMap();\n/**\n * @_ignore\n */\nexport class FetchCancelSignal {\n #listeners;\n #cancelled;\n constructor(request) {\n this.#listeners = [];\n this.#cancelled = false;\n fetchSignals.set(request, () => {\n if (this.#cancelled) {\n return;\n }\n this.#cancelled = true;\n for (const listener of this.#listeners) {\n setTimeout(() => { listener(); }, 0);\n }\n this.#listeners = [];\n });\n }\n addListener(listener) {\n assert(!this.#cancelled, \"singal already cancelled\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fetchCancelSignal.addCancelListener\"\n });\n this.#listeners.push(listener);\n }\n get cancelled() { return this.#cancelled; }\n checkSignal() {\n assert(!this.cancelled, \"cancelled\", \"CANCELLED\", {});\n }\n}\n// Check the signal, throwing if it is cancelled\nfunction checkSignal(signal) {\n if (signal == null) {\n throw new Error(\"missing signal; should not happen\");\n }\n signal.checkSignal();\n return signal;\n}\n/**\n * Represents a request for a resource using a URI.\n *\n * By default, the supported schemes are ``HTTP``, ``HTTPS``, ``data:``,\n * and ``IPFS:``.\n *\n * Additional schemes can be added globally using [[registerGateway]].\n *\n * @example:\n * req = new FetchRequest(\"https://www.ricmoo.com\")\n * resp = await req.send()\n * resp.body.length\n * //_result:\n */\nexport class FetchRequest {\n #allowInsecure;\n #gzip;\n #headers;\n #method;\n #timeout;\n #url;\n #body;\n #bodyType;\n #creds;\n // Hooks\n #preflight;\n #process;\n #retry;\n #signal;\n #throttle;\n #getUrlFunc;\n /**\n * The fetch URL to request.\n */\n get url() { return this.#url; }\n set url(url) {\n this.#url = String(url);\n }\n /**\n * The fetch body, if any, to send as the request body. //(default: null)//\n *\n * When setting a body, the intrinsic ``Content-Type`` is automatically\n * set and will be used if **not overridden** by setting a custom\n * header.\n *\n * If %%body%% is null, the body is cleared (along with the\n * intrinsic ``Content-Type``).\n *\n * If %%body%% is a string, the intrinsic ``Content-Type`` is set to\n * ``text/plain``.\n *\n * If %%body%% is a Uint8Array, the intrinsic ``Content-Type`` is set to\n * ``application/octet-stream``.\n *\n * If %%body%% is any other object, the intrinsic ``Content-Type`` is\n * set to ``application/json``.\n */\n get body() {\n if (this.#body == null) {\n return null;\n }\n return new Uint8Array(this.#body);\n }\n set body(body) {\n if (body == null) {\n this.#body = undefined;\n this.#bodyType = undefined;\n }\n else if (typeof (body) === \"string\") {\n this.#body = toUtf8Bytes(body);\n this.#bodyType = \"text/plain\";\n }\n else if (body instanceof Uint8Array) {\n this.#body = body;\n this.#bodyType = \"application/octet-stream\";\n }\n else if (typeof (body) === \"object\") {\n this.#body = toUtf8Bytes(JSON.stringify(body));\n this.#bodyType = \"application/json\";\n }\n else {\n throw new Error(\"invalid body\");\n }\n }\n /**\n * Returns true if the request has a body.\n */\n hasBody() {\n return (this.#body != null);\n }\n /**\n * The HTTP method to use when requesting the URI. If no method\n * has been explicitly set, then ``GET`` is used if the body is\n * null and ``POST`` otherwise.\n */\n get method() {\n if (this.#method) {\n return this.#method;\n }\n if (this.hasBody()) {\n return \"POST\";\n }\n return \"GET\";\n }\n set method(method) {\n if (method == null) {\n method = \"\";\n }\n this.#method = String(method).toUpperCase();\n }\n /**\n * The headers that will be used when requesting the URI. All\n * keys are lower-case.\n *\n * This object is a copy, so any changes will **NOT** be reflected\n * in the ``FetchRequest``.\n *\n * To set a header entry, use the ``setHeader`` method.\n */\n get headers() {\n const headers = Object.assign({}, this.#headers);\n if (this.#creds) {\n headers[\"authorization\"] = `Basic ${encodeBase64(toUtf8Bytes(this.#creds))}`;\n }\n ;\n if (this.allowGzip) {\n headers[\"accept-encoding\"] = \"gzip\";\n }\n if (headers[\"content-type\"] == null && this.#bodyType) {\n headers[\"content-type\"] = this.#bodyType;\n }\n if (this.body) {\n headers[\"content-length\"] = String(this.body.length);\n }\n return headers;\n }\n /**\n * Get the header for %%key%%, ignoring case.\n */\n getHeader(key) {\n return this.headers[key.toLowerCase()];\n }\n /**\n * Set the header for %%key%% to %%value%%. All values are coerced\n * to a string.\n */\n setHeader(key, value) {\n this.#headers[String(key).toLowerCase()] = String(value);\n }\n /**\n * Clear all headers, resetting all intrinsic headers.\n */\n clearHeaders() {\n this.#headers = {};\n }\n [Symbol.iterator]() {\n const headers = this.headers;\n const keys = Object.keys(headers);\n let index = 0;\n return {\n next: () => {\n if (index < keys.length) {\n const key = keys[index++];\n return {\n value: [key, headers[key]], done: false\n };\n }\n return { value: undefined, done: true };\n }\n };\n }\n /**\n * The value that will be sent for the ``Authorization`` header.\n *\n * To set the credentials, use the ``setCredentials`` method.\n */\n get credentials() {\n return this.#creds || null;\n }\n /**\n * Sets an ``Authorization`` for %%username%% with %%password%%.\n */\n setCredentials(username, password) {\n assertArgument(!username.match(/:/), \"invalid basic authentication username\", \"username\", \"[REDACTED]\");\n this.#creds = `${username}:${password}`;\n }\n /**\n * Enable and request gzip-encoded responses. The response will\n * automatically be decompressed. //(default: true)//\n */\n get allowGzip() {\n return this.#gzip;\n }\n set allowGzip(value) {\n this.#gzip = !!value;\n }\n /**\n * Allow ``Authentication`` credentials to be sent over insecure\n * channels. //(default: false)//\n */\n get allowInsecureAuthentication() {\n return !!this.#allowInsecure;\n }\n set allowInsecureAuthentication(value) {\n this.#allowInsecure = !!value;\n }\n /**\n * The timeout (in milliseconds) to wait for a complete response.\n * //(default: 5 minutes)//\n */\n get timeout() { return this.#timeout; }\n set timeout(timeout) {\n assertArgument(timeout >= 0, \"timeout must be non-zero\", \"timeout\", timeout);\n this.#timeout = timeout;\n }\n /**\n * This function is called prior to each request, for example\n * during a redirection or retry in case of server throttling.\n *\n * This offers an opportunity to populate headers or update\n * content before sending a request.\n */\n get preflightFunc() {\n return this.#preflight || null;\n }\n set preflightFunc(preflight) {\n this.#preflight = preflight;\n }\n /**\n * This function is called after each response, offering an\n * opportunity to provide client-level throttling or updating\n * response data.\n *\n * Any error thrown in this causes the ``send()`` to throw.\n *\n * To schedule a retry attempt (assuming the maximum retry limit\n * has not been reached), use [[response.throwThrottleError]].\n */\n get processFunc() {\n return this.#process || null;\n }\n set processFunc(process) {\n this.#process = process;\n }\n /**\n * This function is called on each retry attempt.\n */\n get retryFunc() {\n return this.#retry || null;\n }\n set retryFunc(retry) {\n this.#retry = retry;\n }\n /**\n * This function is called to fetch content from HTTP and\n * HTTPS URLs and is platform specific (e.g. nodejs vs\n * browsers).\n *\n * This is by default the currently registered global getUrl\n * function, which can be changed using [[registerGetUrl]].\n * If this has been set, setting is to ``null`` will cause\n * this FetchRequest (and any future clones) to revert back to\n * using the currently registered global getUrl function.\n *\n * Setting this is generally not necessary, but may be useful\n * for developers that wish to intercept requests or to\n * configurege a proxy or other agent.\n */\n get getUrlFunc() {\n return this.#getUrlFunc || defaultGetUrlFunc;\n }\n set getUrlFunc(value) {\n this.#getUrlFunc = value;\n }\n /**\n * Create a new FetchRequest instance with default values.\n *\n * Once created, each property may be set before issuing a\n * ``.send()`` to make the request.\n */\n constructor(url) {\n this.#url = String(url);\n this.#allowInsecure = false;\n this.#gzip = true;\n this.#headers = {};\n this.#method = \"\";\n this.#timeout = 300000;\n this.#throttle = {\n slotInterval: SLOT_INTERVAL,\n maxAttempts: MAX_ATTEMPTS\n };\n this.#getUrlFunc = null;\n }\n toString() {\n return `<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${this.#body ? hexlify(this.#body) : \"null\"}>`;\n }\n /**\n * Update the throttle parameters used to determine maximum\n * attempts and exponential-backoff properties.\n */\n setThrottleParams(params) {\n if (params.slotInterval != null) {\n this.#throttle.slotInterval = params.slotInterval;\n }\n if (params.maxAttempts != null) {\n this.#throttle.maxAttempts = params.maxAttempts;\n }\n }\n async #send(attempt, expires, delay, _request, _response) {\n if (attempt >= this.#throttle.maxAttempts) {\n return _response.makeServerError(\"exceeded maximum retry limit\");\n }\n assert(getTime() <= expires, \"timeout\", \"TIMEOUT\", {\n operation: \"request.send\", reason: \"timeout\", request: _request\n });\n if (delay > 0) {\n await wait(delay);\n }\n let req = this.clone();\n const scheme = (req.url.split(\":\")[0] || \"\").toLowerCase();\n // Process any Gateways\n if (scheme in Gateways) {\n const result = await Gateways[scheme](req.url, checkSignal(_request.#signal));\n if (result instanceof FetchResponse) {\n let response = result;\n if (this.processFunc) {\n checkSignal(_request.#signal);\n try {\n response = await this.processFunc(req, response);\n }\n catch (error) {\n // Something went wrong during processing; throw a 5xx server error\n if (error.throttle == null || typeof (error.stall) !== \"number\") {\n response.makeServerError(\"error in post-processing function\", error).assertOk();\n }\n // Ignore throttling\n }\n }\n return response;\n }\n req = result;\n }\n // We have a preflight function; update the request\n if (this.preflightFunc) {\n req = await this.preflightFunc(req);\n }\n const resp = await this.getUrlFunc(req, checkSignal(_request.#signal));\n let response = new FetchResponse(resp.statusCode, resp.statusMessage, resp.headers, resp.body, _request);\n if ([301, 302, 307, 308].indexOf(response.statusCode) >= 0) {\n // Redirect\n try {\n const location = response.headers.location || \"\";\n return req.redirect(location).#send(attempt + 1, expires, 0, _request, response);\n }\n catch (error) { }\n // Things won't get any better on another attempt; abort\n return response;\n }\n else if (response.statusCode === 429) {\n // Throttle\n if (this.retryFunc == null || (await this.retryFunc(req, response, attempt))) {\n const retryAfter = response.headers[\"retry-after\"];\n let delay = this.#throttle.slotInterval * Math.trunc(Math.random() * Math.pow(2, attempt));\n if (typeof (retryAfter) === \"string\" && retryAfter.match(/^[1-9][0-9]*$/)) {\n delay = parseInt(retryAfter);\n }\n return req.clone().#send(attempt + 1, expires, delay, _request, response);\n }\n }\n if (this.processFunc) {\n checkSignal(_request.#signal);\n try {\n response = await this.processFunc(req, response);\n }\n catch (error) {\n // Something went wrong during processing; throw a 5xx server error\n if (error.throttle == null || typeof (error.stall) !== \"number\") {\n response.makeServerError(\"error in post-processing function\", error).assertOk();\n }\n // Throttle\n let delay = this.#throttle.slotInterval * Math.trunc(Math.random() * Math.pow(2, attempt));\n ;\n if (error.stall >= 0) {\n delay = error.stall;\n }\n return req.clone().#send(attempt + 1, expires, delay, _request, response);\n }\n }\n return response;\n }\n /**\n * Resolves to the response by sending the request.\n */\n send() {\n assert(this.#signal == null, \"request already sent\", \"UNSUPPORTED_OPERATION\", { operation: \"fetchRequest.send\" });\n this.#signal = new FetchCancelSignal(this);\n return this.#send(0, getTime() + this.timeout, 0, this, new FetchResponse(0, \"\", {}, null, this));\n }\n /**\n * Cancels the inflight response, causing a ``CANCELLED``\n * error to be rejected from the [[send]].\n */\n cancel() {\n assert(this.#signal != null, \"request has not been sent\", \"UNSUPPORTED_OPERATION\", { operation: \"fetchRequest.cancel\" });\n const signal = fetchSignals.get(this);\n if (!signal) {\n throw new Error(\"missing signal; should not happen\");\n }\n signal();\n }\n /**\n * Returns a new [[FetchRequest]] that represents the redirection\n * to %%location%%.\n */\n redirect(location) {\n // Redirection; for now we only support absolute locations\n const current = this.url.split(\":\")[0].toLowerCase();\n const target = location.split(\":\")[0].toLowerCase();\n // Don't allow redirecting:\n // - downgrading the security (e.g. https => http)\n // - to non-HTTP (or non-HTTPS) protocols [this could be relaxed?]\n assert((current !== \"https\" || target !== \"http\") && location.match(/^https?:/), `unsupported redirect`, \"UNSUPPORTED_OPERATION\", {\n operation: `redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(location)})`\n });\n // Create a copy of this request, with a new URL\n const req = new FetchRequest(location);\n req.method = this.method;\n req.allowGzip = this.allowGzip;\n req.timeout = this.timeout;\n req.#headers = Object.assign({}, this.#headers);\n if (this.#body) {\n req.#body = new Uint8Array(this.#body);\n }\n req.#bodyType = this.#bodyType;\n // Do not forward credentials unless on the same domain; only absolute\n //req.allowInsecure = false;\n // paths are currently supported; may want a way to specify to forward?\n //setStore(req.#props, \"creds\", getStore(this.#pros, \"creds\"));\n return req;\n }\n /**\n * Create a new copy of this request.\n */\n clone() {\n const clone = new FetchRequest(this.url);\n // Preserve \"default method\" (i.e. null)\n clone.#method = this.#method;\n // Preserve \"default body\" with type, copying the Uint8Array is present\n if (this.#body) {\n clone.#body = this.#body;\n }\n clone.#bodyType = this.#bodyType;\n // Preserve \"default headers\"\n clone.#headers = Object.assign({}, this.#headers);\n // Credentials is readonly, so we copy internally\n clone.#creds = this.#creds;\n if (this.allowGzip) {\n clone.allowGzip = true;\n }\n clone.timeout = this.timeout;\n if (this.allowInsecureAuthentication) {\n clone.allowInsecureAuthentication = true;\n }\n clone.#preflight = this.#preflight;\n clone.#process = this.#process;\n clone.#retry = this.#retry;\n clone.#throttle = Object.assign({}, this.#throttle);\n clone.#getUrlFunc = this.#getUrlFunc;\n return clone;\n }\n /**\n * Locks all static configuration for gateways and FetchGetUrlFunc\n * registration.\n */\n static lockConfig() {\n locked = true;\n }\n /**\n * Get the current Gateway function for %%scheme%%.\n */\n static getGateway(scheme) {\n return Gateways[scheme.toLowerCase()] || null;\n }\n /**\n * Use the %%func%% when fetching URIs using %%scheme%%.\n *\n * This method affects all requests globally.\n *\n * If [[lockConfig]] has been called, no change is made and this\n * throws.\n */\n static registerGateway(scheme, func) {\n scheme = scheme.toLowerCase();\n if (scheme === \"http\" || scheme === \"https\") {\n throw new Error(`cannot intercept ${scheme}; use registerGetUrl`);\n }\n if (locked) {\n throw new Error(\"gateways locked\");\n }\n Gateways[scheme] = func;\n }\n /**\n * Use %%getUrl%% when fetching URIs over HTTP and HTTPS requests.\n *\n * This method affects all requests globally.\n *\n * If [[lockConfig]] has been called, no change is made and this\n * throws.\n */\n static registerGetUrl(getUrl) {\n if (locked) {\n throw new Error(\"gateways locked\");\n }\n defaultGetUrlFunc = getUrl;\n }\n /**\n * Creates a getUrl function that fetches content from HTTP and\n * HTTPS URLs.\n *\n * The available %%options%% are dependent on the platform\n * implementation of the default getUrl function.\n *\n * This is not generally something that is needed, but is useful\n * when trying to customize simple behaviour when fetching HTTP\n * content.\n */\n static createGetUrlFunc(options) {\n return createGetUrl(options);\n }\n /**\n * Creates a function that can \"fetch\" data URIs.\n *\n * Note that this is automatically done internally to support\n * data URIs, so it is not necessary to register it.\n *\n * This is not generally something that is needed, but may\n * be useful in a wrapper to perfom custom data URI functionality.\n */\n static createDataGateway() {\n return dataGatewayFunc;\n }\n /**\n * Creates a function that will fetch IPFS (unvalidated) from\n * a custom gateway baseUrl.\n *\n * The default IPFS gateway used internally is\n * ``\"https:/\\/gateway.ipfs.io/ipfs/\"``.\n */\n static createIpfsGatewayFunc(baseUrl) {\n return getIpfsGatewayFunc(baseUrl);\n }\n}\n;\n/**\n * The response for a FetchRequest.\n */\nexport class FetchResponse {\n #statusCode;\n #statusMessage;\n #headers;\n #body;\n #request;\n #error;\n toString() {\n return `<FetchResponse status=${this.statusCode} body=${this.#body ? hexlify(this.#body) : \"null\"}>`;\n }\n /**\n * The response status code.\n */\n get statusCode() { return this.#statusCode; }\n /**\n * The response status message.\n */\n get statusMessage() { return this.#statusMessage; }\n /**\n * The response headers. All keys are lower-case.\n */\n get headers() { return Object.assign({}, this.#headers); }\n /**\n * The response body, or ``null`` if there was no body.\n */\n get body() {\n return (this.#body == null) ? null : new Uint8Array(this.#body);\n }\n /**\n * The response body as a UTF-8 encoded string, or the empty\n * string (i.e. ``\"\"``) if there was no body.\n *\n * An error is thrown if the body is invalid UTF-8 data.\n */\n get bodyText() {\n try {\n return (this.#body == null) ? \"\" : toUtf8String(this.#body);\n }\n catch (error) {\n assert(false, \"response body is not valid UTF-8 data\", \"UNSUPPORTED_OPERATION\", {\n operation: \"bodyText\", info: { response: this }\n });\n }\n }\n /**\n * The response body, decoded as JSON.\n *\n * An error is thrown if the body is invalid JSON-encoded data\n * or if there was no body.\n */\n get bodyJson() {\n try {\n return JSON.parse(this.bodyText);\n }\n catch (error) {\n assert(false, \"response body is not valid JSON\", \"UNSUPPORTED_OPERATION\", {\n operation: \"bodyJson\", info: { response: this }\n });\n }\n }\n [Symbol.iterator]() {\n const headers = this.headers;\n const keys = Object.keys(headers);\n let index = 0;\n return {\n next: () => {\n if (index < keys.length) {\n const key = keys[index++];\n return {\n value: [key, headers[key]], done: false\n };\n }\n return { value: undefined, done: true };\n }\n };\n }\n constructor(statusCode, statusMessage, headers, body, request) {\n this.#statusCode = statusCode;\n this.#statusMessage = statusMessage;\n this.#headers = Object.keys(headers).reduce((accum, k) => {\n accum[k.toLowerCase()] = String(headers[k]);\n return accum;\n }, {});\n this.#body = ((body == null) ? null : new Uint8Array(body));\n this.#request = (request || null);\n this.#error = { message: \"\" };\n }\n /**\n * Return a Response with matching headers and body, but with\n * an error status code (i.e. 599) and %%message%% with an\n * optional %%error%%.\n */\n makeServerError(message, error) {\n let statusMessage;\n if (!message) {\n message = `${this.statusCode} ${this.statusMessage}`;\n statusMessage = `CLIENT ESCALATED SERVER ERROR (${message})`;\n }\n else {\n statusMessage = `CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${message})`;\n }\n const response = new FetchResponse(599, statusMessage, this.headers, this.body, this.#request || undefined);\n response.#error = { message, error };\n return response;\n }\n /**\n * If called within a [request.processFunc](FetchRequest-processFunc)\n * call, causes the request to retry as if throttled for %%stall%%\n * milliseconds.\n */\n throwThrottleError(message, stall) {\n if (stall == null) {\n stall = -1;\n }\n else {\n assertArgument(Number.isInteger(stall) && stall >= 0, \"invalid stall timeout\", \"stall\", stall);\n }\n const error = new Error(message || \"throttling requests\");\n defineProperties(error, { stall, throttle: true });\n throw error;\n }\n /**\n * Get the header value for %%key%%, ignoring case.\n */\n getHeader(key) {\n return this.headers[key.toLowerCase()];\n }\n /**\n * Returns true if the response has a body.\n */\n hasBody() {\n return (this.#body != null);\n }\n /**\n * The request made for this response.\n */\n get request() { return this.#request; }\n /**\n * Returns true if this response was a success statusCode.\n */\n ok() {\n return (this.#error.message === \"\" && this.statusCode >= 200 && this.statusCode < 300);\n }\n /**\n * Throws a ``SERVER_ERROR`` if this response is not ok.\n */\n assertOk() {\n if (this.ok()) {\n return;\n }\n let { message, error } = this.#error;\n if (message === \"\") {\n message = `server response ${this.statusCode} ${this.statusMessage}`;\n }\n let requestUrl = null;\n if (this.request) {\n requestUrl = this.request.url;\n }\n let responseBody = null;\n try {\n if (this.#body) {\n responseBody = toUtf8String(this.#body);\n }\n }\n catch (e) { }\n assert(false, message, \"SERVER_ERROR\", {\n request: (this.request || \"unknown request\"), response: this, error,\n info: {\n requestUrl, responseBody,\n responseStatus: `${this.statusCode} ${this.statusMessage}`\n }\n });\n }\n}\nfunction getTime() { return (new Date()).getTime(); }\nfunction unpercent(value) {\n return toUtf8Bytes(value.replace(/%([0-9a-f][0-9a-f])/gi, (all, code) => {\n return String.fromCharCode(parseInt(code, 16));\n }));\n}\nfunction wait(delay) {\n return new Promise((resolve) => setTimeout(resolve, delay));\n}\n//# sourceMappingURL=fetch.js.map","//See: https://github.com/ethereum/wiki/wiki/RLP\nimport { hexlify } from \"./data.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nimport { getBytes } from \"./data.js\";\nfunction hexlifyByte(value) {\n let result = value.toString(16);\n while (result.length < 2) {\n result = \"0\" + result;\n }\n return \"0x\" + result;\n}\nfunction unarrayifyInteger(data, offset, length) {\n let result = 0;\n for (let i = 0; i < length; i++) {\n result = (result * 256) + data[offset + i];\n }\n return result;\n}\nfunction _decodeChildren(data, offset, childOffset, length) {\n const result = [];\n while (childOffset < offset + 1 + length) {\n const decoded = _decode(data, childOffset);\n result.push(decoded.result);\n childOffset += decoded.consumed;\n assert(childOffset <= offset + 1 + length, \"child data too short\", \"BUFFER_OVERRUN\", {\n buffer: data, length, offset\n });\n }\n return { consumed: (1 + length), result: result };\n}\n// returns { consumed: number, result: Object }\nfunction _decode(data, offset) {\n assert(data.length !== 0, \"data too short\", \"BUFFER_OVERRUN\", {\n buffer: data, length: 0, offset: 1\n });\n const checkOffset = (offset) => {\n assert(offset <= data.length, \"data short segment too short\", \"BUFFER_OVERRUN\", {\n buffer: data, length: data.length, offset\n });\n };\n // Array with extra length prefix\n if (data[offset] >= 0xf8) {\n const lengthLength = data[offset] - 0xf7;\n checkOffset(offset + 1 + lengthLength);\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n checkOffset(offset + 1 + lengthLength + length);\n return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length);\n }\n else if (data[offset] >= 0xc0) {\n const length = data[offset] - 0xc0;\n checkOffset(offset + 1 + length);\n return _decodeChildren(data, offset, offset + 1, length);\n }\n else if (data[offset] >= 0xb8) {\n const lengthLength = data[offset] - 0xb7;\n checkOffset(offset + 1 + lengthLength);\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n checkOffset(offset + 1 + lengthLength + length);\n const result = hexlify(data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length));\n return { consumed: (1 + lengthLength + length), result: result };\n }\n else if (data[offset] >= 0x80) {\n const length = data[offset] - 0x80;\n checkOffset(offset + 1 + length);\n const result = hexlify(data.slice(offset + 1, offset + 1 + length));\n return { consumed: (1 + length), result: result };\n }\n return { consumed: 1, result: hexlifyByte(data[offset]) };\n}\n/**\n * Decodes %%data%% into the structured data it represents.\n */\nexport function decodeRlp(_data) {\n const data = getBytes(_data, \"data\");\n const decoded = _decode(data, 0);\n assertArgument(decoded.consumed === data.length, \"unexpected junk after rlp payload\", \"data\", _data);\n return decoded.result;\n}\n//# sourceMappingURL=rlp-decode.js.map","//See: https://github.com/ethereum/wiki/wiki/RLP\nimport { getBytes } from \"./data.js\";\nfunction arrayifyInteger(value) {\n const result = [];\n while (value) {\n result.unshift(value & 0xff);\n value >>= 8;\n }\n return result;\n}\nfunction _encode(object) {\n if (Array.isArray(object)) {\n let payload = [];\n object.forEach(function (child) {\n payload = payload.concat(_encode(child));\n });\n if (payload.length <= 55) {\n payload.unshift(0xc0 + payload.length);\n return payload;\n }\n const length = arrayifyInteger(payload.length);\n length.unshift(0xf7 + length.length);\n return length.concat(payload);\n }\n const data = Array.prototype.slice.call(getBytes(object, \"object\"));\n if (data.length === 1 && data[0] <= 0x7f) {\n return data;\n }\n else if (data.length <= 55) {\n data.unshift(0x80 + data.length);\n return data;\n }\n const length = arrayifyInteger(data.length);\n length.unshift(0xb7 + length.length);\n return length.concat(data);\n}\nconst nibbles = \"0123456789abcdef\";\n/**\n * Encodes %%object%% as an RLP-encoded [[DataHexString]].\n */\nexport function encodeRlp(object) {\n let result = \"0x\";\n for (const v of _encode(object)) {\n result += nibbles[v >> 4];\n result += nibbles[v & 0xf];\n }\n return result;\n}\n//# sourceMappingURL=rlp-encode.js.map","import { BaseContract, Overrides } from 'ethers'\nimport { LogParams, BlockParams, TransactionReceiptParams, TransactionResponseParams } from 'ethers/providers'\nimport { allowNull } from './ethers-format.js'\nimport { getNumber } from 'ethers/utils'\n\nimport {\n type EthCallContext,\n EthCallContextSchema,\n type PreparedData,\n type RecordMetaData,\n RecordMetaDataSchema\n} from '@sentio/protos'\nimport { create } from '@bufbuild/protobuf'\nimport { Trace } from './eth.js'\nimport { Labels, normalizeLabels } from '../core/index.js'\nimport { BaseContext } from '../core/base-context.js'\nimport { EthChainId } from '@sentio/chain'\n\nexport abstract class EthContext extends BaseContext {\n readonly chainId: EthChainId\n address: string\n private readonly log?: LogParams\n readonly block?: BlockParams\n readonly trace?: Trace\n readonly blockNumber: number\n readonly transactionHash?: string\n readonly transaction?: TransactionResponseParams\n readonly transactionReceipt?: TransactionReceiptParams\n readonly timestamp: Date\n readonly preparedData?: PreparedData\n\n constructor(\n chainId: EthChainId,\n address: string,\n timestamp?: Date,\n block?: BlockParams,\n log?: LogParams,\n trace?: Trace,\n transaction?: TransactionResponseParams,\n transactionReceipt?: TransactionReceiptParams,\n baseLabels?: Labels,\n preparedData?: PreparedData\n ) {\n super(baseLabels)\n this.chainId = chainId\n this.log = log\n this.block = block\n this.trace = trace\n this.address = address.toLowerCase()\n this.transaction = transaction\n this.transactionReceipt = transactionReceipt\n this.timestamp = timestamp || new Date(0)\n this.preparedData = preparedData\n if (log) {\n this.blockNumber = log.blockNumber\n this.transactionHash = log.transactionHash\n } else if (block) {\n this.blockNumber = block.number\n } else if (trace) {\n this.blockNumber = trace.blockNumber\n this.transactionHash = trace.transactionHash\n } else if (transaction?.blockNumber) {\n this.blockNumber = transaction.blockNumber\n }\n }\n\n protected abstract getContractName(): string\n\n getChainId(): EthChainId {\n return this.chainId\n }\n\n getMetaDataInternal(name: string, labels: Labels): RecordMetaData {\n if (this.log) {\n return create(RecordMetaDataSchema, {\n address: this.address,\n contractName: this.getContractName(),\n blockNumber: BigInt(this.blockNumber),\n transactionIndex: this.log.transactionIndex,\n transactionHash: this.transactionHash || '',\n logIndex: this.log.index,\n chainId: this.chainId,\n name: name,\n labels: normalizeLabels(labels)\n })\n }\n if (this.trace) {\n return create(RecordMetaDataSchema, {\n address: this.address,\n contractName: this.getContractName(),\n blockNumber: BigInt(this.blockNumber),\n // Traces are used as a raw `as Trace` cast (no Formatted wrapper), so transactionPosition\n // may be a hex string from raw RPC; coerce for the int32 field (default 0 when absent).\n transactionIndex: allowNull(getNumber, 0)(this.trace.transactionPosition),\n transactionHash: this.transactionHash || '',\n logIndex: -1,\n chainId: this.chainId.toString(),\n name: name,\n labels: normalizeLabels(labels)\n })\n }\n if (this.transaction) {\n return create(RecordMetaDataSchema, {\n address: this.address,\n contractName: this.getContractName(),\n blockNumber: BigInt(this.blockNumber),\n transactionIndex: this.transaction.index || 0,\n transactionHash: this.transaction.hash || '',\n logIndex: -1,\n chainId: this.chainId.toString(),\n name: name,\n labels: normalizeLabels(labels)\n })\n }\n if (this.block) {\n return create(RecordMetaDataSchema, {\n address: this.address,\n contractName: this.getContractName(),\n blockNumber: BigInt(this.blockNumber),\n transactionIndex: -1,\n transactionHash: '',\n logIndex: -1,\n chainId: this.chainId.toString(),\n name: name,\n labels: normalizeLabels(labels)\n })\n }\n throw new Error(\"Invaid ctx argument can't happen\")\n }\n\n getBlockTag(overrides?: Overrides) {\n let blockTagWithOverride = '0x' + this.blockNumber.toString(16)\n if (overrides?.blockTag) {\n blockTagWithOverride =\n typeof overrides.blockTag == 'string' ? overrides.blockTag : '0x' + overrides.blockTag.toString(16)\n }\n return blockTagWithOverride\n }\n\n getEthCallContext(): EthCallContext {\n return create(EthCallContextSchema, {\n chainId: this.chainId,\n blockTag: '0x' + this.blockNumber.toString(16),\n address: this.address\n })\n }\n}\n\nexport class AccountContext extends EthContext {\n // constructor(chainId: number, address: string, block?: Block, log?: Log, trace?: Trace) {\n // super(chainId, address, new Date(0), block, log, trace)\n // }\n protected getContractName(): string {\n return 'account'\n }\n}\n\nexport class GlobalContext extends EthContext {\n constructor(\n chainId: EthChainId,\n address: string,\n timestamp?: Date,\n block?: BlockParams,\n log?: LogParams,\n trace?: Trace,\n transaction?: TransactionResponseParams,\n transactionReceipt?: TransactionReceiptParams,\n baseLabels?: Labels,\n preparedData?: PreparedData\n ) {\n super(chainId, address, timestamp, block, log, trace, transaction, transactionReceipt, baseLabels, preparedData)\n }\n protected getContractName(): string {\n return '*'\n }\n getMetaDataInternal(name: string, labels: Labels): RecordMetaData {\n const address = this.address\n this.address = '*'\n const res = super.getMetaDataInternal(name, labels)\n this.address = address\n return res\n }\n}\n\nexport class ContractContext<\n TContract extends BaseContract,\n TContractBoundView extends BoundContractView<TContract, ContractView<TContract>>\n> extends EthContext {\n contract: TContractBoundView\n contractName: string\n\n constructor(\n contractName: string,\n view: TContractBoundView,\n chainId: EthChainId,\n timestamp?: Date,\n block?: BlockParams,\n log?: LogParams,\n trace?: Trace,\n transaction?: TransactionResponseParams,\n transactionReceipt?: TransactionReceiptParams,\n baseLabels?: Labels,\n preparedData?: PreparedData\n ) {\n super(\n chainId,\n view.address,\n timestamp,\n block,\n log,\n trace,\n transaction,\n transactionReceipt,\n baseLabels,\n preparedData\n )\n view.context = this\n if (view.callStatic) {\n view.callStatic.context = this\n }\n if (view.encodeCall) {\n view.encodeCall.context = this\n }\n this.contractName = contractName\n this.contract = view\n }\n\n protected getContractName(): string {\n return this.contractName\n }\n}\n\nexport class ContractView<TContract extends BaseContract> {\n constructor(protected contract: TContract) {}\n\n get rawContract() {\n return this.contract\n }\n\n get provider() {\n if (this.contract.runner?.provider) {\n return this.contract.runner.provider\n }\n throw Error(\"Can't find provider for contract\" + this.contract.toString())\n }\n}\n\nexport class BoundContractView<TContract extends BaseContract, TContractView extends ContractView<TContract>> {\n protected view: TContractView\n address: string\n // context will be set right after context creation (in context's constructor)\n // context: ContractContext<TContract, BoundContractView<TContract, TContractView>>\n context: EthContext\n callStatic: {\n context: EthContext\n view: TContractView\n }\n encodeCall: {\n context: EthContext\n view: TContractView\n }\n\n constructor(address: string, view: TContractView) {\n this.address = address\n this.view = view\n }\n\n get rawContract() {\n return this.view.rawContract\n }\n\n get provider() {\n return this.view.provider\n }\n\n get filters() {\n return this.view.rawContract.filters\n }\n}\n","import { createHash } from \"./crypto.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nconst _sha256 = function (data) {\n return createHash(\"sha256\").update(data).digest();\n};\nconst _sha512 = function (data) {\n return createHash(\"sha512\").update(data).digest();\n};\nlet __sha256 = _sha256;\nlet __sha512 = _sha512;\nlet locked256 = false, locked512 = false;\n/**\n * Compute the cryptographic SHA2-256 hash of %%data%%.\n *\n * @_docloc: api/crypto:Hash Functions\n * @returns DataHexstring\n *\n * @example:\n * sha256(\"0x\")\n * //_result:\n *\n * sha256(\"0x1337\")\n * //_result:\n *\n * sha256(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n *\n */\nexport function sha256(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__sha256(data));\n}\nsha256._ = _sha256;\nsha256.lock = function () { locked256 = true; };\nsha256.register = function (func) {\n if (locked256) {\n throw new Error(\"sha256 is locked\");\n }\n __sha256 = func;\n};\nObject.freeze(sha256);\n/**\n * Compute the cryptographic SHA2-512 hash of %%data%%.\n *\n * @_docloc: api/crypto:Hash Functions\n * @returns DataHexstring\n *\n * @example:\n * sha512(\"0x\")\n * //_result:\n *\n * sha512(\"0x1337\")\n * //_result:\n *\n * sha512(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n */\nexport function sha512(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__sha512(data));\n}\nsha512._ = _sha512;\nsha512.lock = function () { locked512 = true; };\nsha512.register = function (func) {\n if (locked512) {\n throw new Error(\"sha512 is locked\");\n }\n __sha512 = func;\n};\nObject.freeze(sha256);\n//# sourceMappingURL=sha2.js.map","import { exists, output } from './_assert.js';\nimport { Hash, createView, toBytes } from './utils.js';\n// Polyfill for Safari 14\nfunction setBigUint64(view, byteOffset, value, isLE) {\n if (typeof view.setBigUint64 === 'function')\n return view.setBigUint64(byteOffset, value, isLE);\n const _32n = BigInt(32);\n const _u32_max = BigInt(0xffffffff);\n const wh = Number((value >> _32n) & _u32_max);\n const wl = Number(value & _u32_max);\n const h = isLE ? 4 : 0;\n const l = isLE ? 0 : 4;\n view.setUint32(byteOffset + h, wh, isLE);\n view.setUint32(byteOffset + l, wl, isLE);\n}\n// Base SHA2 class (RFC 6234)\nexport class SHA2 extends Hash {\n constructor(blockLen, outputLen, padOffset, isLE) {\n super();\n this.blockLen = blockLen;\n this.outputLen = outputLen;\n this.padOffset = padOffset;\n this.isLE = isLE;\n this.finished = false;\n this.length = 0;\n this.pos = 0;\n this.destroyed = false;\n this.buffer = new Uint8Array(blockLen);\n this.view = createView(this.buffer);\n }\n update(data) {\n exists(this);\n const { view, buffer, blockLen } = this;\n data = toBytes(data);\n const len = data.length;\n for (let pos = 0; pos < len;) {\n const take = Math.min(blockLen - this.pos, len - pos);\n // Fast path: we have at least one block in input, cast it to view and process\n if (take === blockLen) {\n const dataView = createView(data);\n for (; blockLen <= len - pos; pos += blockLen)\n this.process(dataView, pos);\n continue;\n }\n buffer.set(data.subarray(pos, pos + take), this.pos);\n this.pos += take;\n pos += take;\n if (this.pos === blockLen) {\n this.process(view, 0);\n this.pos = 0;\n }\n }\n this.length += data.length;\n this.roundClean();\n return this;\n }\n digestInto(out) {\n exists(this);\n output(out, this);\n this.finished = true;\n // Padding\n // We can avoid allocation of buffer for padding completely if it\n // was previously not allocated here. But it won't change performance.\n const { buffer, view, blockLen, isLE } = this;\n let { pos } = this;\n // append the bit '1' to the message\n buffer[pos++] = 0b10000000;\n this.buffer.subarray(pos).fill(0);\n // we have less than padOffset left in buffer, so we cannot put length in current block, need process it and pad again\n if (this.padOffset > blockLen - pos) {\n this.process(view, 0);\n pos = 0;\n }\n // Pad until full block byte with zeros\n for (let i = pos; i < blockLen; i++)\n buffer[i] = 0;\n // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that\n // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen.\n // So we just write lowest 64 bits of that value.\n setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE);\n this.process(view, 0);\n const oview = createView(out);\n const len = this.outputLen;\n // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT\n if (len % 4)\n throw new Error('_sha2: outputLen should be aligned to 32bit');\n const outLen = len / 4;\n const state = this.get();\n if (outLen > state.length)\n throw new Error('_sha2: outputLen bigger than state');\n for (let i = 0; i < outLen; i++)\n oview.setUint32(4 * i, state[i], isLE);\n }\n digest() {\n const { buffer, outputLen } = this;\n this.digestInto(buffer);\n const res = buffer.slice(0, outputLen);\n this.destroy();\n return res;\n }\n _cloneInto(to) {\n to || (to = new this.constructor());\n to.set(...this.get());\n const { blockLen, buffer, length, finished, destroyed, pos } = this;\n to.length = length;\n to.pos = pos;\n to.finished = finished;\n to.destroyed = destroyed;\n if (length % blockLen)\n to.buffer.set(buffer);\n return to;\n }\n}\n//# sourceMappingURL=_sha2.js.map","import { SHA2 } from './_sha2.js';\nimport { rotr, wrapConstructor } from './utils.js';\n// SHA2-256 need to try 2^128 hashes to execute birthday attack.\n// BTC network is doing 2^67 hashes/sec as per early 2023.\n// Choice: a ? b : c\nconst Chi = (a, b, c) => (a & b) ^ (~a & c);\n// Majority function, true if any two inpust is true\nconst Maj = (a, b, c) => (a & b) ^ (a & c) ^ (b & c);\n// Round constants:\n// first 32 bits of the fractional parts of the cube roots of the first 64 primes 2..311)\n// prettier-ignore\nconst SHA256_K = /* @__PURE__ */ new Uint32Array([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\n// Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19):\n// prettier-ignore\nconst IV = /* @__PURE__ */ new Uint32Array([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19\n]);\n// Temporary buffer, not used to store anything between runs\n// Named this way because it matches specification.\nconst SHA256_W = /* @__PURE__ */ new Uint32Array(64);\nclass SHA256 extends SHA2 {\n constructor() {\n super(64, 32, 8, false);\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n this.A = IV[0] | 0;\n this.B = IV[1] | 0;\n this.C = IV[2] | 0;\n this.D = IV[3] | 0;\n this.E = IV[4] | 0;\n this.F = IV[5] | 0;\n this.G = IV[6] | 0;\n this.H = IV[7] | 0;\n }\n get() {\n const { A, B, C, D, E, F, G, H } = this;\n return [A, B, C, D, E, F, G, H];\n }\n // prettier-ignore\n set(A, B, C, D, E, F, G, H) {\n this.A = A | 0;\n this.B = B | 0;\n this.C = C | 0;\n this.D = D | 0;\n this.E = E | 0;\n this.F = F | 0;\n this.G = G | 0;\n this.H = H | 0;\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4)\n SHA256_W[i] = view.getUint32(offset, false);\n for (let i = 16; i < 64; i++) {\n const W15 = SHA256_W[i - 15];\n const W2 = SHA256_W[i - 2];\n const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3);\n const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10);\n SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0;\n }\n // Compression function main loop, 64 rounds\n let { A, B, C, D, E, F, G, H } = this;\n for (let i = 0; i < 64; i++) {\n const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);\n const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);\n const T2 = (sigma0 + Maj(A, B, C)) | 0;\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 // Add the compressed chunk to the current hash value\n A = (A + this.A) | 0;\n B = (B + this.B) | 0;\n C = (C + this.C) | 0;\n D = (D + this.D) | 0;\n E = (E + this.E) | 0;\n F = (F + this.F) | 0;\n G = (G + this.G) | 0;\n H = (H + this.H) | 0;\n this.set(A, B, C, D, E, F, G, H);\n }\n roundClean() {\n SHA256_W.fill(0);\n }\n destroy() {\n this.set(0, 0, 0, 0, 0, 0, 0, 0);\n this.buffer.fill(0);\n }\n}\n// Constants from https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\nclass SHA224 extends SHA256 {\n constructor() {\n super();\n this.A = 0xc1059ed8 | 0;\n this.B = 0x367cd507 | 0;\n this.C = 0x3070dd17 | 0;\n this.D = 0xf70e5939 | 0;\n this.E = 0xffc00b31 | 0;\n this.F = 0x68581511 | 0;\n this.G = 0x64f98fa7 | 0;\n this.H = 0xbefa4fa4 | 0;\n this.outputLen = 28;\n }\n}\n/**\n * SHA2-256 hash function\n * @param message - data that would be hashed\n */\nexport const sha256 = /* @__PURE__ */ wrapConstructor(() => new SHA256());\nexport const sha224 = /* @__PURE__ */ wrapConstructor(() => new SHA224());\n//# sourceMappingURL=sha256.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// 100 lines of code in the file are duplicated from noble-hashes (utils).\n// This is OK: `abstract` directory does not use noble-hashes.\n// User may opt-in into using different hashing library. This way, noble-hashes\n// won't be included into their bundle.\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst u8a = (a) => a instanceof Uint8Array;\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nexport function bytesToHex(bytes) {\n if (!u8a(bytes))\n throw new Error('Uint8Array expected');\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\nexport function numberToHexUnpadded(num) {\n const hex = num.toString(16);\n return hex.length & 1 ? `0${hex}` : hex;\n}\nexport function hexToNumber(hex) {\n if (typeof hex !== 'string')\n throw new Error('hex string expected, got ' + typeof hex);\n // Big Endian\n return BigInt(hex === '' ? '0' : `0x${hex}`);\n}\n/**\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new Error('hex string expected, got ' + typeof hex);\n const len = hex.length;\n if (len % 2)\n throw new Error('padded hex string expected, got unpadded hex of length ' + len);\n const array = new Uint8Array(len / 2);\n for (let i = 0; i < array.length; i++) {\n const j = i * 2;\n const hexByte = hex.slice(j, j + 2);\n const byte = Number.parseInt(hexByte, 16);\n if (Number.isNaN(byte) || byte < 0)\n throw new Error('Invalid byte sequence');\n array[i] = byte;\n }\n return array;\n}\n// BE: Big Endian, LE: Little Endian\nexport function bytesToNumberBE(bytes) {\n return hexToNumber(bytesToHex(bytes));\n}\nexport function bytesToNumberLE(bytes) {\n if (!u8a(bytes))\n throw new Error('Uint8Array expected');\n return hexToNumber(bytesToHex(Uint8Array.from(bytes).reverse()));\n}\nexport function numberToBytesBE(n, len) {\n return hexToBytes(n.toString(16).padStart(len * 2, '0'));\n}\nexport function numberToBytesLE(n, len) {\n return numberToBytesBE(n, len).reverse();\n}\n// Unpadded, rarely used\nexport function numberToVarBytesBE(n) {\n return hexToBytes(numberToHexUnpadded(n));\n}\n/**\n * Takes hex string or Uint8Array, converts to Uint8Array.\n * Validates output length.\n * Will throw error for other types.\n * @param title descriptive title for an error e.g. 'private key'\n * @param hex hex string or Uint8Array\n * @param expectedLength optional, will compare to result array's length\n * @returns\n */\nexport function ensureBytes(title, hex, expectedLength) {\n let res;\n if (typeof hex === 'string') {\n try {\n res = hexToBytes(hex);\n }\n catch (e) {\n throw new Error(`${title} must be valid hex string, got \"${hex}\". Cause: ${e}`);\n }\n }\n else if (u8a(hex)) {\n // Uint8Array.from() instead of hash.slice() because node.js Buffer\n // is instance of Uint8Array, and its slice() creates **mutable** copy\n res = Uint8Array.from(hex);\n }\n else {\n throw new Error(`${title} must be hex string or Uint8Array`);\n }\n const len = res.length;\n if (typeof expectedLength === 'number' && len !== expectedLength)\n throw new Error(`${title} expected ${expectedLength} bytes, got ${len}`);\n return res;\n}\n/**\n * Copies several Uint8Arrays into one.\n */\nexport function concatBytes(...arrays) {\n const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0));\n let pad = 0; // walk through each item, ensure they have proper type\n arrays.forEach((a) => {\n if (!u8a(a))\n throw new Error('Uint8Array expected');\n r.set(a, pad);\n pad += a.length;\n });\n return r;\n}\nexport function equalBytes(b1, b2) {\n // We don't care about timing attacks here\n if (b1.length !== b2.length)\n return false;\n for (let i = 0; i < b1.length; i++)\n if (b1[i] !== b2[i])\n return false;\n return true;\n}\n/**\n * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new Error(`utf8ToBytes expected string, got ${typeof str}`);\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n// Bit operations\n/**\n * Calculates amount of bits in a bigint.\n * Same as `n.toString(2).length`\n */\nexport function bitLen(n) {\n let len;\n for (len = 0; n > _0n; n >>= _1n, len += 1)\n ;\n return len;\n}\n/**\n * Gets single bit at position.\n * NOTE: first bit position is 0 (same as arrays)\n * Same as `!!+Array.from(n.toString(2)).reverse()[pos]`\n */\nexport function bitGet(n, pos) {\n return (n >> BigInt(pos)) & _1n;\n}\n/**\n * Sets single bit at position.\n */\nexport const bitSet = (n, pos, value) => {\n return n | ((value ? _1n : _0n) << BigInt(pos));\n};\n/**\n * Calculate mask for N bits. Not using ** operator with bigints because of old engines.\n * Same as BigInt(`0b${Array(i).fill('1').join('')}`)\n */\nexport const bitMask = (n) => (_2n << BigInt(n - 1)) - _1n;\n// DRBG\nconst u8n = (data) => new Uint8Array(data); // creates Uint8Array\nconst u8fr = (arr) => Uint8Array.from(arr); // another shortcut\n/**\n * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs.\n * @returns function that will call DRBG until 2nd arg returns something meaningful\n * @example\n * const drbg = createHmacDRBG<Key>(32, 32, hmac);\n * drbg(seed, bytesToKey); // bytesToKey must return Key or undefined\n */\nexport function createHmacDrbg(hashLen, qByteLen, hmacFn) {\n if (typeof hashLen !== 'number' || hashLen < 2)\n throw new Error('hashLen must be a number');\n if (typeof qByteLen !== 'number' || qByteLen < 2)\n throw new Error('qByteLen must be a number');\n if (typeof hmacFn !== 'function')\n throw new Error('hmacFn must be a function');\n // Step B, Step C: set hashLen to 8*ceil(hlen/8)\n let v = u8n(hashLen); // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 sigs.\n let k = u8n(hashLen); // Steps B and C of RFC6979 3.2: set hashLen, in our case always same\n let i = 0; // Iterations counter, will throw when over 1000\n const reset = () => {\n v.fill(1);\n k.fill(0);\n i = 0;\n };\n const h = (...b) => hmacFn(k, v, ...b); // hmac(k)(v, ...values)\n const reseed = (seed = u8n()) => {\n // HMAC-DRBG reseed() function. Steps D-G\n k = h(u8fr([0x00]), seed); // k = hmac(k || v || 0x00 || seed)\n v = h(); // v = hmac(k || v)\n if (seed.length === 0)\n return;\n k = h(u8fr([0x01]), seed); // k = hmac(k || v || 0x01 || seed)\n v = h(); // v = hmac(k || v)\n };\n const gen = () => {\n // HMAC-DRBG generate() function\n if (i++ >= 1000)\n throw new Error('drbg: tried 1000 values');\n let len = 0;\n const out = [];\n while (len < qByteLen) {\n v = h();\n const sl = v.slice();\n out.push(sl);\n len += v.length;\n }\n return concatBytes(...out);\n };\n const genUntil = (seed, pred) => {\n reset();\n reseed(seed); // Steps D-G\n let res = undefined; // Step H: grind until k is in [1..n-1]\n while (!(res = pred(gen())))\n reseed();\n reset();\n return res;\n };\n return genUntil;\n}\n// Validating curves and fields\nconst validatorFns = {\n bigint: (val) => typeof val === 'bigint',\n function: (val) => typeof val === 'function',\n boolean: (val) => typeof val === 'boolean',\n string: (val) => typeof val === 'string',\n stringOrUint8Array: (val) => typeof val === 'string' || val instanceof Uint8Array,\n isSafeInteger: (val) => Number.isSafeInteger(val),\n array: (val) => Array.isArray(val),\n field: (val, object) => object.Fp.isValid(val),\n hash: (val) => typeof val === 'function' && Number.isSafeInteger(val.outputLen),\n};\n// type Record<K extends string | number | symbol, T> = { [P in K]: T; }\nexport function validateObject(object, validators, optValidators = {}) {\n const checkField = (fieldName, type, isOptional) => {\n const checkVal = validatorFns[type];\n if (typeof checkVal !== 'function')\n throw new Error(`Invalid validator \"${type}\", expected function`);\n const val = object[fieldName];\n if (isOptional && val === undefined)\n return;\n if (!checkVal(val, object)) {\n throw new Error(`Invalid param ${String(fieldName)}=${val} (${typeof val}), expected ${type}`);\n }\n };\n for (const [fieldName, type] of Object.entries(validators))\n checkField(fieldName, type, false);\n for (const [fieldName, type] of Object.entries(optValidators))\n checkField(fieldName, type, true);\n return object;\n}\n// validate type tests\n// const o: { a: number; b: number; c: number } = { a: 1, b: 5, c: 6 };\n// const z0 = validateObject(o, { a: 'isSafeInteger' }, { c: 'bigint' }); // Ok!\n// // Should fail type-check\n// const z1 = validateObject(o, { a: 'tmp' }, { c: 'zz' });\n// const z2 = validateObject(o, { a: 'isSafeInteger' }, { c: 'zz' });\n// const z3 = validateObject(o, { test: 'boolean', z: 'bug' });\n// const z4 = validateObject(o, { a: 'boolean', z: 'bug' });\n//# sourceMappingURL=utils.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// Utilities for modular arithmetics and finite fields\nimport { bitMask, numberToBytesBE, numberToBytesLE, bytesToNumberBE, bytesToNumberLE, ensureBytes, validateObject, } from './utils.js';\n// prettier-ignore\nconst _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3);\n// prettier-ignore\nconst _4n = BigInt(4), _5n = BigInt(5), _8n = BigInt(8);\n// prettier-ignore\nconst _9n = BigInt(9), _16n = BigInt(16);\n// Calculates a modulo b\nexport function mod(a, b) {\n const result = a % b;\n return result >= _0n ? result : b + result;\n}\n/**\n * Efficiently raise num to power and do modular division.\n * Unsafe in some contexts: uses ladder, so can expose bigint bits.\n * @example\n * pow(2n, 6n, 11n) // 64n % 11n == 9n\n */\n// TODO: use field version && remove\nexport function pow(num, power, modulo) {\n if (modulo <= _0n || power < _0n)\n throw new Error('Expected power/modulo > 0');\n if (modulo === _1n)\n return _0n;\n let res = _1n;\n while (power > _0n) {\n if (power & _1n)\n res = (res * num) % modulo;\n num = (num * num) % modulo;\n power >>= _1n;\n }\n return res;\n}\n// Does x ^ (2 ^ power) mod p. pow2(30, 4) == 30 ^ (2 ^ 4)\nexport function pow2(x, power, modulo) {\n let res = x;\n while (power-- > _0n) {\n res *= res;\n res %= modulo;\n }\n return res;\n}\n// Inverses number over modulo\nexport function invert(number, modulo) {\n if (number === _0n || modulo <= _0n) {\n throw new Error(`invert: expected positive integers, got n=${number} mod=${modulo}`);\n }\n // Euclidean GCD https://brilliant.org/wiki/extended-euclidean-algorithm/\n // Fermat's little theorem \"CT-like\" version inv(n) = n^(m-2) mod m is 30x slower.\n let a = mod(number, modulo);\n let b = modulo;\n // prettier-ignore\n let x = _0n, y = _1n, u = _1n, v = _0n;\n while (a !== _0n) {\n // JIT applies optimization if those two lines follow each other\n const q = b / a;\n const r = b % a;\n const m = x - u * q;\n const n = y - v * q;\n // prettier-ignore\n b = a, a = r, x = u, y = v, u = m, v = n;\n }\n const gcd = b;\n if (gcd !== _1n)\n throw new Error('invert: does not exist');\n return mod(x, modulo);\n}\n/**\n * Tonelli-Shanks square root search algorithm.\n * 1. https://eprint.iacr.org/2012/685.pdf (page 12)\n * 2. Square Roots from 1; 24, 51, 10 to Dan Shanks\n * Will start an infinite loop if field order P is not prime.\n * @param P field order\n * @returns function that takes field Fp (created from P) and number n\n */\nexport function tonelliShanks(P) {\n // Legendre constant: used to calculate Legendre symbol (a | p),\n // which denotes the value of a^((p-1)/2) (mod p).\n // (a | p) ≡ 1 if a is a square (mod p)\n // (a | p) ≡ -1 if a is not a square (mod p)\n // (a | p) ≡ 0 if a ≡ 0 (mod p)\n const legendreC = (P - _1n) / _2n;\n let Q, S, Z;\n // Step 1: By factoring out powers of 2 from p - 1,\n // find q and s such that p - 1 = q*(2^s) with q odd\n for (Q = P - _1n, S = 0; Q % _2n === _0n; Q /= _2n, S++)\n ;\n // Step 2: Select a non-square z such that (z | p) ≡ -1 and set c ≡ zq\n for (Z = _2n; Z < P && pow(Z, legendreC, P) !== P - _1n; Z++)\n ;\n // Fast-path\n if (S === 1) {\n const p1div4 = (P + _1n) / _4n;\n return function tonelliFast(Fp, n) {\n const root = Fp.pow(n, p1div4);\n if (!Fp.eql(Fp.sqr(root), n))\n throw new Error('Cannot find square root');\n return root;\n };\n }\n // Slow-path\n const Q1div2 = (Q + _1n) / _2n;\n return function tonelliSlow(Fp, n) {\n // Step 0: Check that n is indeed a square: (n | p) should not be ≡ -1\n if (Fp.pow(n, legendreC) === Fp.neg(Fp.ONE))\n throw new Error('Cannot find square root');\n let r = S;\n // TODO: will fail at Fp2/etc\n let g = Fp.pow(Fp.mul(Fp.ONE, Z), Q); // will update both x and b\n let x = Fp.pow(n, Q1div2); // first guess at the square root\n let b = Fp.pow(n, Q); // first guess at the fudge factor\n while (!Fp.eql(b, Fp.ONE)) {\n if (Fp.eql(b, Fp.ZERO))\n return Fp.ZERO; // https://en.wikipedia.org/wiki/Tonelli%E2%80%93Shanks_algorithm (4. If t = 0, return r = 0)\n // Find m such b^(2^m)==1\n let m = 1;\n for (let t2 = Fp.sqr(b); m < r; m++) {\n if (Fp.eql(t2, Fp.ONE))\n break;\n t2 = Fp.sqr(t2); // t2 *= t2\n }\n // NOTE: r-m-1 can be bigger than 32, need to convert to bigint before shift, otherwise there will be overflow\n const ge = Fp.pow(g, _1n << BigInt(r - m - 1)); // ge = 2^(r-m-1)\n g = Fp.sqr(ge); // g = ge * ge\n x = Fp.mul(x, ge); // x *= ge\n b = Fp.mul(b, g); // b *= g\n r = m;\n }\n return x;\n };\n}\nexport function FpSqrt(P) {\n // NOTE: different algorithms can give different roots, it is up to user to decide which one they want.\n // For example there is FpSqrtOdd/FpSqrtEven to choice root based on oddness (used for hash-to-curve).\n // P ≡ 3 (mod 4)\n // √n = n^((P+1)/4)\n if (P % _4n === _3n) {\n // Not all roots possible!\n // const ORDER =\n // 0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaabn;\n // const NUM = 72057594037927816n;\n const p1div4 = (P + _1n) / _4n;\n return function sqrt3mod4(Fp, n) {\n const root = Fp.pow(n, p1div4);\n // Throw if root**2 != n\n if (!Fp.eql(Fp.sqr(root), n))\n throw new Error('Cannot find square root');\n return root;\n };\n }\n // Atkin algorithm for q ≡ 5 (mod 8), https://eprint.iacr.org/2012/685.pdf (page 10)\n if (P % _8n === _5n) {\n const c1 = (P - _5n) / _8n;\n return function sqrt5mod8(Fp, n) {\n const n2 = Fp.mul(n, _2n);\n const v = Fp.pow(n2, c1);\n const nv = Fp.mul(n, v);\n const i = Fp.mul(Fp.mul(nv, _2n), v);\n const root = Fp.mul(nv, Fp.sub(i, Fp.ONE));\n if (!Fp.eql(Fp.sqr(root), n))\n throw new Error('Cannot find square root');\n return root;\n };\n }\n // P ≡ 9 (mod 16)\n if (P % _16n === _9n) {\n // NOTE: tonelli is too slow for bls-Fp2 calculations even on start\n // Means we cannot use sqrt for constants at all!\n //\n // const c1 = Fp.sqrt(Fp.negate(Fp.ONE)); // 1. c1 = sqrt(-1) in F, i.e., (c1^2) == -1 in F\n // const c2 = Fp.sqrt(c1); // 2. c2 = sqrt(c1) in F, i.e., (c2^2) == c1 in F\n // const c3 = Fp.sqrt(Fp.negate(c1)); // 3. c3 = sqrt(-c1) in F, i.e., (c3^2) == -c1 in F\n // const c4 = (P + _7n) / _16n; // 4. c4 = (q + 7) / 16 # Integer arithmetic\n // sqrt = (x) => {\n // let tv1 = Fp.pow(x, c4); // 1. tv1 = x^c4\n // let tv2 = Fp.mul(c1, tv1); // 2. tv2 = c1 * tv1\n // const tv3 = Fp.mul(c2, tv1); // 3. tv3 = c2 * tv1\n // let tv4 = Fp.mul(c3, tv1); // 4. tv4 = c3 * tv1\n // const e1 = Fp.equals(Fp.square(tv2), x); // 5. e1 = (tv2^2) == x\n // const e2 = Fp.equals(Fp.square(tv3), x); // 6. e2 = (tv3^2) == x\n // tv1 = Fp.cmov(tv1, tv2, e1); // 7. tv1 = CMOV(tv1, tv2, e1) # Select tv2 if (tv2^2) == x\n // tv2 = Fp.cmov(tv4, tv3, e2); // 8. tv2 = CMOV(tv4, tv3, e2) # Select tv3 if (tv3^2) == x\n // const e3 = Fp.equals(Fp.square(tv2), x); // 9. e3 = (tv2^2) == x\n // return Fp.cmov(tv1, tv2, e3); // 10. z = CMOV(tv1, tv2, e3) # Select the sqrt from tv1 and tv2\n // }\n }\n // Other cases: Tonelli-Shanks algorithm\n return tonelliShanks(P);\n}\n// Little-endian check for first LE bit (last BE bit);\nexport const isNegativeLE = (num, modulo) => (mod(num, modulo) & _1n) === _1n;\n// prettier-ignore\nconst FIELD_FIELDS = [\n 'create', 'isValid', 'is0', 'neg', 'inv', 'sqrt', 'sqr',\n 'eql', 'add', 'sub', 'mul', 'pow', 'div',\n 'addN', 'subN', 'mulN', 'sqrN'\n];\nexport function validateField(field) {\n const initial = {\n ORDER: 'bigint',\n MASK: 'bigint',\n BYTES: 'isSafeInteger',\n BITS: 'isSafeInteger',\n };\n const opts = FIELD_FIELDS.reduce((map, val) => {\n map[val] = 'function';\n return map;\n }, initial);\n return validateObject(field, opts);\n}\n// Generic field functions\n/**\n * Same as `pow` but for Fp: non-constant-time.\n * Unsafe in some contexts: uses ladder, so can expose bigint bits.\n */\nexport function FpPow(f, num, power) {\n // Should have same speed as pow for bigints\n // TODO: benchmark!\n if (power < _0n)\n throw new Error('Expected power > 0');\n if (power === _0n)\n return f.ONE;\n if (power === _1n)\n return num;\n let p = f.ONE;\n let d = num;\n while (power > _0n) {\n if (power & _1n)\n p = f.mul(p, d);\n d = f.sqr(d);\n power >>= _1n;\n }\n return p;\n}\n/**\n * Efficiently invert an array of Field elements.\n * `inv(0)` will return `undefined` here: make sure to throw an error.\n */\nexport function FpInvertBatch(f, nums) {\n const tmp = new Array(nums.length);\n // Walk from first to last, multiply them by each other MOD p\n const lastMultiplied = nums.reduce((acc, num, i) => {\n if (f.is0(num))\n return acc;\n tmp[i] = acc;\n return f.mul(acc, num);\n }, f.ONE);\n // Invert last element\n const inverted = f.inv(lastMultiplied);\n // Walk from last to first, multiply them by inverted each other MOD p\n nums.reduceRight((acc, num, i) => {\n if (f.is0(num))\n return acc;\n tmp[i] = f.mul(acc, tmp[i]);\n return f.mul(acc, num);\n }, inverted);\n return tmp;\n}\nexport function FpDiv(f, lhs, rhs) {\n return f.mul(lhs, typeof rhs === 'bigint' ? invert(rhs, f.ORDER) : f.inv(rhs));\n}\n// This function returns True whenever the value x is a square in the field F.\nexport function FpIsSquare(f) {\n const legendreConst = (f.ORDER - _1n) / _2n; // Integer arithmetic\n return (x) => {\n const p = f.pow(x, legendreConst);\n return f.eql(p, f.ZERO) || f.eql(p, f.ONE);\n };\n}\n// CURVE.n lengths\nexport function nLength(n, nBitLength) {\n // Bit size, byte size of CURVE.n\n const _nBitLength = nBitLength !== undefined ? nBitLength : n.toString(2).length;\n const nByteLength = Math.ceil(_nBitLength / 8);\n return { nBitLength: _nBitLength, nByteLength };\n}\n/**\n * Initializes a finite field over prime. **Non-primes are not supported.**\n * Do not init in loop: slow. Very fragile: always run a benchmark on a change.\n * Major performance optimizations:\n * * a) denormalized operations like mulN instead of mul\n * * b) same object shape: never add or remove keys\n * * c) Object.freeze\n * @param ORDER prime positive bigint\n * @param bitLen how many bits the field consumes\n * @param isLE (def: false) if encoding / decoding should be in little-endian\n * @param redef optional faster redefinitions of sqrt and other methods\n */\nexport function Field(ORDER, bitLen, isLE = false, redef = {}) {\n if (ORDER <= _0n)\n throw new Error(`Expected Field ORDER > 0, got ${ORDER}`);\n const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, bitLen);\n if (BYTES > 2048)\n throw new Error('Field lengths over 2048 bytes are not supported');\n const sqrtP = FpSqrt(ORDER);\n const f = Object.freeze({\n ORDER,\n BITS,\n BYTES,\n MASK: bitMask(BITS),\n ZERO: _0n,\n ONE: _1n,\n create: (num) => mod(num, ORDER),\n isValid: (num) => {\n if (typeof num !== 'bigint')\n throw new Error(`Invalid field element: expected bigint, got ${typeof num}`);\n return _0n <= num && num < ORDER; // 0 is valid element, but it's not invertible\n },\n is0: (num) => num === _0n,\n isOdd: (num) => (num & _1n) === _1n,\n neg: (num) => mod(-num, ORDER),\n eql: (lhs, rhs) => lhs === rhs,\n sqr: (num) => mod(num * num, ORDER),\n add: (lhs, rhs) => mod(lhs + rhs, ORDER),\n sub: (lhs, rhs) => mod(lhs - rhs, ORDER),\n mul: (lhs, rhs) => mod(lhs * rhs, ORDER),\n pow: (num, power) => FpPow(f, num, power),\n div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER),\n // Same as above, but doesn't normalize\n sqrN: (num) => num * num,\n addN: (lhs, rhs) => lhs + rhs,\n subN: (lhs, rhs) => lhs - rhs,\n mulN: (lhs, rhs) => lhs * rhs,\n inv: (num) => invert(num, ORDER),\n sqrt: redef.sqrt || ((n) => sqrtP(f, n)),\n invertBatch: (lst) => FpInvertBatch(f, lst),\n // TODO: do we really need constant cmov?\n // We don't have const-time bigints anyway, so probably will be not very useful\n cmov: (a, b, c) => (c ? b : a),\n toBytes: (num) => (isLE ? numberToBytesLE(num, BYTES) : numberToBytesBE(num, BYTES)),\n fromBytes: (bytes) => {\n if (bytes.length !== BYTES)\n throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes.length}`);\n return isLE ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes);\n },\n });\n return Object.freeze(f);\n}\nexport function FpSqrtOdd(Fp, elm) {\n if (!Fp.isOdd)\n throw new Error(`Field doesn't have isOdd`);\n const root = Fp.sqrt(elm);\n return Fp.isOdd(root) ? root : Fp.neg(root);\n}\nexport function FpSqrtEven(Fp, elm) {\n if (!Fp.isOdd)\n throw new Error(`Field doesn't have isOdd`);\n const root = Fp.sqrt(elm);\n return Fp.isOdd(root) ? Fp.neg(root) : root;\n}\n/**\n * \"Constant-time\" private key generation utility.\n * Same as mapKeyToField, but accepts less bytes (40 instead of 48 for 32-byte field).\n * Which makes it slightly more biased, less secure.\n * @deprecated use mapKeyToField instead\n */\nexport function hashToPrivateScalar(hash, groupOrder, isLE = false) {\n hash = ensureBytes('privateHash', hash);\n const hashLen = hash.length;\n const minLen = nLength(groupOrder).nByteLength + 8;\n if (minLen < 24 || hashLen < minLen || hashLen > 1024)\n throw new Error(`hashToPrivateScalar: expected ${minLen}-1024 bytes of input, got ${hashLen}`);\n const num = isLE ? bytesToNumberLE(hash) : bytesToNumberBE(hash);\n return mod(num, groupOrder - _1n) + _1n;\n}\n/**\n * Returns total number of bytes consumed by the field element.\n * For example, 32 bytes for usual 256-bit weierstrass curve.\n * @param fieldOrder number of field elements, usually CURVE.n\n * @returns byte length of field\n */\nexport function getFieldBytesLength(fieldOrder) {\n if (typeof fieldOrder !== 'bigint')\n throw new Error('field order must be bigint');\n const bitLength = fieldOrder.toString(2).length;\n return Math.ceil(bitLength / 8);\n}\n/**\n * Returns minimal amount of bytes that can be safely reduced\n * by field order.\n * Should be 2^-128 for 128-bit curve such as P256.\n * @param fieldOrder number of field elements, usually CURVE.n\n * @returns byte length of target hash\n */\nexport function getMinHashLength(fieldOrder) {\n const length = getFieldBytesLength(fieldOrder);\n return length + Math.ceil(length / 2);\n}\n/**\n * \"Constant-time\" private key generation utility.\n * Can take (n + n/2) or more bytes of uniform input e.g. from CSPRNG or KDF\n * and convert them into private scalar, with the modulo bias being negligible.\n * Needs at least 48 bytes of input for 32-byte private key.\n * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/\n * FIPS 186-5, A.2 https://csrc.nist.gov/publications/detail/fips/186/5/final\n * RFC 9380, https://www.rfc-editor.org/rfc/rfc9380#section-5\n * @param hash hash output from SHA3 or a similar function\n * @param groupOrder size of subgroup - (e.g. secp256k1.CURVE.n)\n * @param isLE interpret hash bytes as LE num\n * @returns valid private scalar\n */\nexport function mapHashToField(key, fieldOrder, isLE = false) {\n const len = key.length;\n const fieldLen = getFieldBytesLength(fieldOrder);\n const minLen = getMinHashLength(fieldOrder);\n // No small numbers: need to understand bias story. No huge numbers: easier to detect JS timings.\n if (len < 16 || len < minLen || len > 1024)\n throw new Error(`expected ${minLen}-1024 bytes of input, got ${len}`);\n const num = isLE ? bytesToNumberBE(key) : bytesToNumberLE(key);\n // `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0\n const reduced = mod(num, fieldOrder - _1n) + _1n;\n return isLE ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen);\n}\n//# sourceMappingURL=modular.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// Abelian group utilities\nimport { validateField, nLength } from './modular.js';\nimport { validateObject } from './utils.js';\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\n// Elliptic curve multiplication of Point by scalar. Fragile.\n// Scalars should always be less than curve order: this should be checked inside of a curve itself.\n// Creates precomputation tables for fast multiplication:\n// - private scalar is split by fixed size windows of W bits\n// - every window point is collected from window's table & added to accumulator\n// - since windows are different, same point inside tables won't be accessed more than once per calc\n// - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar)\n// - +1 window is neccessary for wNAF\n// - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication\n// TODO: Research returning 2d JS array of windows, instead of a single window. This would allow\n// windows to be in different memory locations\nexport function wNAF(c, bits) {\n const constTimeNegate = (condition, item) => {\n const neg = item.negate();\n return condition ? neg : item;\n };\n const opts = (W) => {\n const windows = Math.ceil(bits / W) + 1; // +1, because\n const windowSize = 2 ** (W - 1); // -1 because we skip zero\n return { windows, windowSize };\n };\n return {\n constTimeNegate,\n // non-const time multiplication ladder\n unsafeLadder(elm, n) {\n let p = c.ZERO;\n let d = elm;\n while (n > _0n) {\n if (n & _1n)\n p = p.add(d);\n d = d.double();\n n >>= _1n;\n }\n return p;\n },\n /**\n * Creates a wNAF precomputation window. Used for caching.\n * Default window size is set by `utils.precompute()` and is equal to 8.\n * Number of precomputed points depends on the curve size:\n * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where:\n * - 𝑊 is the window size\n * - 𝑛 is the bitlength of the curve order.\n * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224.\n * @returns precomputed point tables flattened to a single array\n */\n precomputeWindow(elm, W) {\n const { windows, windowSize } = opts(W);\n const points = [];\n let p = elm;\n let base = p;\n for (let window = 0; window < windows; window++) {\n base = p;\n points.push(base);\n // =1, because we skip zero\n for (let i = 1; i < windowSize; i++) {\n base = base.add(p);\n points.push(base);\n }\n p = base.double();\n }\n return points;\n },\n /**\n * Implements ec multiplication using precomputed tables and w-ary non-adjacent form.\n * @param W window size\n * @param precomputes precomputed tables\n * @param n scalar (we don't check here, but should be less than curve order)\n * @returns real and fake (for const-time) points\n */\n wNAF(W, precomputes, n) {\n // TODO: maybe check that scalar is less than group order? wNAF behavious is undefined otherwise\n // But need to carefully remove other checks before wNAF. ORDER == bits here\n const { windows, windowSize } = opts(W);\n let p = c.ZERO;\n let f = c.BASE;\n const mask = BigInt(2 ** W - 1); // Create mask with W ones: 0b1111 for W=4 etc.\n const maxNumber = 2 ** W;\n const shiftBy = BigInt(W);\n for (let window = 0; window < windows; window++) {\n const offset = window * windowSize;\n // Extract W bits.\n let wbits = Number(n & mask);\n // Shift number by W bits.\n n >>= shiftBy;\n // If the bits are bigger than max size, we'll split those.\n // +224 => 256 - 32\n if (wbits > windowSize) {\n wbits -= maxNumber;\n n += _1n;\n }\n // This code was first written with assumption that 'f' and 'p' will never be infinity point:\n // since each addition is multiplied by 2 ** W, it cannot cancel each other. However,\n // there is negate now: it is possible that negated element from low value\n // would be the same as high element, which will create carry into next window.\n // It's not obvious how this can fail, but still worth investigating later.\n // Check if we're onto Zero point.\n // Add random point inside current window to f.\n const offset1 = offset;\n const offset2 = offset + Math.abs(wbits) - 1; // -1 because we skip zero\n const cond1 = window % 2 !== 0;\n const cond2 = wbits < 0;\n if (wbits === 0) {\n // The most important part for const-time getPublicKey\n f = f.add(constTimeNegate(cond1, precomputes[offset1]));\n }\n else {\n p = p.add(constTimeNegate(cond2, precomputes[offset2]));\n }\n }\n // JIT-compiler should not eliminate f here, since it will later be used in normalizeZ()\n // Even if the variable is still unused, there are some checks which will\n // throw an exception, so compiler needs to prove they won't happen, which is hard.\n // At this point there is a way to F be infinity-point even if p is not,\n // which makes it less const-time: around 1 bigint multiply.\n return { p, f };\n },\n wNAFCached(P, precomputesMap, n, transform) {\n // @ts-ignore\n const W = P._WINDOW_SIZE || 1;\n // Calculate precomputes on a first run, reuse them after\n let comp = precomputesMap.get(P);\n if (!comp) {\n comp = this.precomputeWindow(P, W);\n if (W !== 1) {\n precomputesMap.set(P, transform(comp));\n }\n }\n return this.wNAF(W, comp, n);\n },\n };\n}\nexport function validateBasic(curve) {\n validateField(curve.Fp);\n validateObject(curve, {\n n: 'bigint',\n h: 'bigint',\n Gx: 'field',\n Gy: 'field',\n }, {\n nBitLength: 'isSafeInteger',\n nByteLength: 'isSafeInteger',\n });\n // Set defaults\n return Object.freeze({\n ...nLength(curve.n, curve.nBitLength),\n ...curve,\n ...{ p: curve.Fp.ORDER },\n });\n}\n//# sourceMappingURL=curve.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// Short Weierstrass curve. The formula is: y² = x³ + ax + b\nimport * as mod from './modular.js';\nimport * as ut from './utils.js';\nimport { ensureBytes } from './utils.js';\nimport { wNAF, validateBasic } from './curve.js';\nfunction validatePointOpts(curve) {\n const opts = validateBasic(curve);\n ut.validateObject(opts, {\n a: 'field',\n b: 'field',\n }, {\n allowedPrivateKeyLengths: 'array',\n wrapPrivateKey: 'boolean',\n isTorsionFree: 'function',\n clearCofactor: 'function',\n allowInfinityPoint: 'boolean',\n fromBytes: 'function',\n toBytes: 'function',\n });\n const { endo, Fp, a } = opts;\n if (endo) {\n if (!Fp.eql(a, Fp.ZERO)) {\n throw new Error('Endomorphism can only be defined for Koblitz curves that have a=0');\n }\n if (typeof endo !== 'object' ||\n typeof endo.beta !== 'bigint' ||\n typeof endo.splitScalar !== 'function') {\n throw new Error('Expected endomorphism with beta: bigint and splitScalar: function');\n }\n }\n return Object.freeze({ ...opts });\n}\n// ASN.1 DER encoding utilities\nconst { bytesToNumberBE: b2n, hexToBytes: h2b } = ut;\nexport const DER = {\n // asn.1 DER encoding utils\n Err: class DERErr extends Error {\n constructor(m = '') {\n super(m);\n }\n },\n _parseInt(data) {\n const { Err: E } = DER;\n if (data.length < 2 || data[0] !== 0x02)\n throw new E('Invalid signature integer tag');\n const len = data[1];\n const res = data.subarray(2, len + 2);\n if (!len || res.length !== len)\n throw new E('Invalid signature integer: wrong length');\n // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag,\n // since we always use positive integers here. It must always be empty:\n // - add zero byte if exists\n // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding)\n if (res[0] & 0b10000000)\n throw new E('Invalid signature integer: negative');\n if (res[0] === 0x00 && !(res[1] & 0b10000000))\n throw new E('Invalid signature integer: unnecessary leading zero');\n return { d: b2n(res), l: data.subarray(len + 2) }; // d is data, l is left\n },\n toSig(hex) {\n // parse DER signature\n const { Err: E } = DER;\n const data = typeof hex === 'string' ? h2b(hex) : hex;\n if (!(data instanceof Uint8Array))\n throw new Error('ui8a expected');\n let l = data.length;\n if (l < 2 || data[0] != 0x30)\n throw new E('Invalid signature tag');\n if (data[1] !== l - 2)\n throw new E('Invalid signature: incorrect length');\n const { d: r, l: sBytes } = DER._parseInt(data.subarray(2));\n const { d: s, l: rBytesLeft } = DER._parseInt(sBytes);\n if (rBytesLeft.length)\n throw new E('Invalid signature: left bytes after parsing');\n return { r, s };\n },\n hexFromSig(sig) {\n // Add leading zero if first byte has negative bit enabled. More details in '_parseInt'\n const slice = (s) => (Number.parseInt(s[0], 16) & 0b1000 ? '00' + s : s);\n const h = (num) => {\n const hex = num.toString(16);\n return hex.length & 1 ? `0${hex}` : hex;\n };\n const s = slice(h(sig.s));\n const r = slice(h(sig.r));\n const shl = s.length / 2;\n const rhl = r.length / 2;\n const sl = h(shl);\n const rl = h(rhl);\n return `30${h(rhl + shl + 4)}02${rl}${r}02${sl}${s}`;\n },\n};\n// Be friendly to bad ECMAScript parsers by not using bigint literals\n// prettier-ignore\nconst _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4);\nexport function weierstrassPoints(opts) {\n const CURVE = validatePointOpts(opts);\n const { Fp } = CURVE; // All curves has same field / group length as for now, but they can differ\n const toBytes = CURVE.toBytes ||\n ((_c, point, _isCompressed) => {\n const a = point.toAffine();\n return ut.concatBytes(Uint8Array.from([0x04]), Fp.toBytes(a.x), Fp.toBytes(a.y));\n });\n const fromBytes = CURVE.fromBytes ||\n ((bytes) => {\n // const head = bytes[0];\n const tail = bytes.subarray(1);\n // if (head !== 0x04) throw new Error('Only non-compressed encoding is supported');\n const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES));\n const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES));\n return { x, y };\n });\n /**\n * y² = x³ + ax + b: Short weierstrass curve formula\n * @returns y²\n */\n function weierstrassEquation(x) {\n const { a, b } = CURVE;\n const x2 = Fp.sqr(x); // x * x\n const x3 = Fp.mul(x2, x); // x2 * x\n return Fp.add(Fp.add(x3, Fp.mul(x, a)), b); // x3 + a * x + b\n }\n // Validate whether the passed curve params are valid.\n // We check if curve equation works for generator point.\n // `assertValidity()` won't work: `isTorsionFree()` is not available at this point in bls12-381.\n // ProjectivePoint class has not been initialized yet.\n if (!Fp.eql(Fp.sqr(CURVE.Gy), weierstrassEquation(CURVE.Gx)))\n throw new Error('bad generator point: equation left != right');\n // Valid group elements reside in range 1..n-1\n function isWithinCurveOrder(num) {\n return typeof num === 'bigint' && _0n < num && num < CURVE.n;\n }\n function assertGE(num) {\n if (!isWithinCurveOrder(num))\n throw new Error('Expected valid bigint: 0 < bigint < curve.n');\n }\n // Validates if priv key is valid and converts it to bigint.\n // Supports options allowedPrivateKeyLengths and wrapPrivateKey.\n function normPrivateKeyToScalar(key) {\n const { allowedPrivateKeyLengths: lengths, nByteLength, wrapPrivateKey, n } = CURVE;\n if (lengths && typeof key !== 'bigint') {\n if (key instanceof Uint8Array)\n key = ut.bytesToHex(key);\n // Normalize to hex string, pad. E.g. P521 would norm 130-132 char hex to 132-char bytes\n if (typeof key !== 'string' || !lengths.includes(key.length))\n throw new Error('Invalid key');\n key = key.padStart(nByteLength * 2, '0');\n }\n let num;\n try {\n num =\n typeof key === 'bigint'\n ? key\n : ut.bytesToNumberBE(ensureBytes('private key', key, nByteLength));\n }\n catch (error) {\n throw new Error(`private key must be ${nByteLength} bytes, hex or bigint, not ${typeof key}`);\n }\n if (wrapPrivateKey)\n num = mod.mod(num, n); // disabled by default, enabled for BLS\n assertGE(num); // num in range [1..N-1]\n return num;\n }\n const pointPrecomputes = new Map();\n function assertPrjPoint(other) {\n if (!(other instanceof Point))\n throw new Error('ProjectivePoint expected');\n }\n /**\n * Projective Point works in 3d / projective (homogeneous) coordinates: (x, y, z) ∋ (x=x/z, y=y/z)\n * Default Point works in 2d / affine coordinates: (x, y)\n * We're doing calculations in projective, because its operations don't require costly inversion.\n */\n class Point {\n constructor(px, py, pz) {\n this.px = px;\n this.py = py;\n this.pz = pz;\n if (px == null || !Fp.isValid(px))\n throw new Error('x required');\n if (py == null || !Fp.isValid(py))\n throw new Error('y required');\n if (pz == null || !Fp.isValid(pz))\n throw new Error('z required');\n }\n // Does not validate if the point is on-curve.\n // Use fromHex instead, or call assertValidity() later.\n static fromAffine(p) {\n const { x, y } = p || {};\n if (!p || !Fp.isValid(x) || !Fp.isValid(y))\n throw new Error('invalid affine point');\n if (p instanceof Point)\n throw new Error('projective point not allowed');\n const is0 = (i) => Fp.eql(i, Fp.ZERO);\n // fromAffine(x:0, y:0) would produce (x:0, y:0, z:1), but we need (x:0, y:1, z:0)\n if (is0(x) && is0(y))\n return Point.ZERO;\n return new Point(x, y, Fp.ONE);\n }\n get x() {\n return this.toAffine().x;\n }\n get y() {\n return this.toAffine().y;\n }\n /**\n * Takes a bunch of Projective Points but executes only one\n * inversion on all of them. Inversion is very slow operation,\n * so this improves performance massively.\n * Optimization: converts a list of projective points to a list of identical points with Z=1.\n */\n static normalizeZ(points) {\n const toInv = Fp.invertBatch(points.map((p) => p.pz));\n return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine);\n }\n /**\n * Converts hash string or Uint8Array to Point.\n * @param hex short/long ECDSA hex\n */\n static fromHex(hex) {\n const P = Point.fromAffine(fromBytes(ensureBytes('pointHex', hex)));\n P.assertValidity();\n return P;\n }\n // Multiplies generator point by privateKey.\n static fromPrivateKey(privateKey) {\n return Point.BASE.multiply(normPrivateKeyToScalar(privateKey));\n }\n // \"Private method\", don't use it directly\n _setWindowSize(windowSize) {\n this._WINDOW_SIZE = windowSize;\n pointPrecomputes.delete(this);\n }\n // A point on curve is valid if it conforms to equation.\n assertValidity() {\n if (this.is0()) {\n // (0, 1, 0) aka ZERO is invalid in most contexts.\n // In BLS, ZERO can be serialized, so we allow it.\n // (0, 0, 0) is wrong representation of ZERO and is always invalid.\n if (CURVE.allowInfinityPoint && !Fp.is0(this.py))\n return;\n throw new Error('bad point: ZERO');\n }\n // Some 3rd-party test vectors require different wording between here & `fromCompressedHex`\n const { x, y } = this.toAffine();\n // Check if x, y are valid field elements\n if (!Fp.isValid(x) || !Fp.isValid(y))\n throw new Error('bad point: x or y not FE');\n const left = Fp.sqr(y); // y²\n const right = weierstrassEquation(x); // x³ + ax + b\n if (!Fp.eql(left, right))\n throw new Error('bad point: equation left != right');\n if (!this.isTorsionFree())\n throw new Error('bad point: not in prime-order subgroup');\n }\n hasEvenY() {\n const { y } = this.toAffine();\n if (Fp.isOdd)\n return !Fp.isOdd(y);\n throw new Error(\"Field doesn't support isOdd\");\n }\n /**\n * Compare one point to another.\n */\n equals(other) {\n assertPrjPoint(other);\n const { px: X1, py: Y1, pz: Z1 } = this;\n const { px: X2, py: Y2, pz: Z2 } = other;\n const U1 = Fp.eql(Fp.mul(X1, Z2), Fp.mul(X2, Z1));\n const U2 = Fp.eql(Fp.mul(Y1, Z2), Fp.mul(Y2, Z1));\n return U1 && U2;\n }\n /**\n * Flips point to one corresponding to (x, -y) in Affine coordinates.\n */\n negate() {\n return new Point(this.px, Fp.neg(this.py), this.pz);\n }\n // Renes-Costello-Batina exception-free doubling formula.\n // There is 30% faster Jacobian formula, but it is not complete.\n // https://eprint.iacr.org/2015/1060, algorithm 3\n // Cost: 8M + 3S + 3*a + 2*b3 + 15add.\n double() {\n const { a, b } = CURVE;\n const b3 = Fp.mul(b, _3n);\n const { px: X1, py: Y1, pz: Z1 } = this;\n let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore\n let t0 = Fp.mul(X1, X1); // step 1\n let t1 = Fp.mul(Y1, Y1);\n let t2 = Fp.mul(Z1, Z1);\n let t3 = Fp.mul(X1, Y1);\n t3 = Fp.add(t3, t3); // step 5\n Z3 = Fp.mul(X1, Z1);\n Z3 = Fp.add(Z3, Z3);\n X3 = Fp.mul(a, Z3);\n Y3 = Fp.mul(b3, t2);\n Y3 = Fp.add(X3, Y3); // step 10\n X3 = Fp.sub(t1, Y3);\n Y3 = Fp.add(t1, Y3);\n Y3 = Fp.mul(X3, Y3);\n X3 = Fp.mul(t3, X3);\n Z3 = Fp.mul(b3, Z3); // step 15\n t2 = Fp.mul(a, t2);\n t3 = Fp.sub(t0, t2);\n t3 = Fp.mul(a, t3);\n t3 = Fp.add(t3, Z3);\n Z3 = Fp.add(t0, t0); // step 20\n t0 = Fp.add(Z3, t0);\n t0 = Fp.add(t0, t2);\n t0 = Fp.mul(t0, t3);\n Y3 = Fp.add(Y3, t0);\n t2 = Fp.mul(Y1, Z1); // step 25\n t2 = Fp.add(t2, t2);\n t0 = Fp.mul(t2, t3);\n X3 = Fp.sub(X3, t0);\n Z3 = Fp.mul(t2, t1);\n Z3 = Fp.add(Z3, Z3); // step 30\n Z3 = Fp.add(Z3, Z3);\n return new Point(X3, Y3, Z3);\n }\n // Renes-Costello-Batina exception-free addition formula.\n // There is 30% faster Jacobian formula, but it is not complete.\n // https://eprint.iacr.org/2015/1060, algorithm 1\n // Cost: 12M + 0S + 3*a + 3*b3 + 23add.\n add(other) {\n assertPrjPoint(other);\n const { px: X1, py: Y1, pz: Z1 } = this;\n const { px: X2, py: Y2, pz: Z2 } = other;\n let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore\n const a = CURVE.a;\n const b3 = Fp.mul(CURVE.b, _3n);\n let t0 = Fp.mul(X1, X2); // step 1\n let t1 = Fp.mul(Y1, Y2);\n let t2 = Fp.mul(Z1, Z2);\n let t3 = Fp.add(X1, Y1);\n let t4 = Fp.add(X2, Y2); // step 5\n t3 = Fp.mul(t3, t4);\n t4 = Fp.add(t0, t1);\n t3 = Fp.sub(t3, t4);\n t4 = Fp.add(X1, Z1);\n let t5 = Fp.add(X2, Z2); // step 10\n t4 = Fp.mul(t4, t5);\n t5 = Fp.add(t0, t2);\n t4 = Fp.sub(t4, t5);\n t5 = Fp.add(Y1, Z1);\n X3 = Fp.add(Y2, Z2); // step 15\n t5 = Fp.mul(t5, X3);\n X3 = Fp.add(t1, t2);\n t5 = Fp.sub(t5, X3);\n Z3 = Fp.mul(a, t4);\n X3 = Fp.mul(b3, t2); // step 20\n Z3 = Fp.add(X3, Z3);\n X3 = Fp.sub(t1, Z3);\n Z3 = Fp.add(t1, Z3);\n Y3 = Fp.mul(X3, Z3);\n t1 = Fp.add(t0, t0); // step 25\n t1 = Fp.add(t1, t0);\n t2 = Fp.mul(a, t2);\n t4 = Fp.mul(b3, t4);\n t1 = Fp.add(t1, t2);\n t2 = Fp.sub(t0, t2); // step 30\n t2 = Fp.mul(a, t2);\n t4 = Fp.add(t4, t2);\n t0 = Fp.mul(t1, t4);\n Y3 = Fp.add(Y3, t0);\n t0 = Fp.mul(t5, t4); // step 35\n X3 = Fp.mul(t3, X3);\n X3 = Fp.sub(X3, t0);\n t0 = Fp.mul(t3, t1);\n Z3 = Fp.mul(t5, Z3);\n Z3 = Fp.add(Z3, t0); // step 40\n return new Point(X3, Y3, Z3);\n }\n subtract(other) {\n return this.add(other.negate());\n }\n is0() {\n return this.equals(Point.ZERO);\n }\n wNAF(n) {\n return wnaf.wNAFCached(this, pointPrecomputes, n, (comp) => {\n const toInv = Fp.invertBatch(comp.map((p) => p.pz));\n return comp.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine);\n });\n }\n /**\n * Non-constant-time multiplication. Uses double-and-add algorithm.\n * It's faster, but should only be used when you don't care about\n * an exposed private key e.g. sig verification, which works over *public* keys.\n */\n multiplyUnsafe(n) {\n const I = Point.ZERO;\n if (n === _0n)\n return I;\n assertGE(n); // Will throw on 0\n if (n === _1n)\n return this;\n const { endo } = CURVE;\n if (!endo)\n return wnaf.unsafeLadder(this, n);\n // Apply endomorphism\n let { k1neg, k1, k2neg, k2 } = endo.splitScalar(n);\n let k1p = I;\n let k2p = I;\n let d = this;\n while (k1 > _0n || k2 > _0n) {\n if (k1 & _1n)\n k1p = k1p.add(d);\n if (k2 & _1n)\n k2p = k2p.add(d);\n d = d.double();\n k1 >>= _1n;\n k2 >>= _1n;\n }\n if (k1neg)\n k1p = k1p.negate();\n if (k2neg)\n k2p = k2p.negate();\n k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz);\n return k1p.add(k2p);\n }\n /**\n * Constant time multiplication.\n * Uses wNAF method. Windowed method may be 10% faster,\n * but takes 2x longer to generate and consumes 2x memory.\n * Uses precomputes when available.\n * Uses endomorphism for Koblitz curves.\n * @param scalar by which the point would be multiplied\n * @returns New point\n */\n multiply(scalar) {\n assertGE(scalar);\n let n = scalar;\n let point, fake; // Fake point is used to const-time mult\n const { endo } = CURVE;\n if (endo) {\n const { k1neg, k1, k2neg, k2 } = endo.splitScalar(n);\n let { p: k1p, f: f1p } = this.wNAF(k1);\n let { p: k2p, f: f2p } = this.wNAF(k2);\n k1p = wnaf.constTimeNegate(k1neg, k1p);\n k2p = wnaf.constTimeNegate(k2neg, k2p);\n k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz);\n point = k1p.add(k2p);\n fake = f1p.add(f2p);\n }\n else {\n const { p, f } = this.wNAF(n);\n point = p;\n fake = f;\n }\n // Normalize `z` for both points, but return only real one\n return Point.normalizeZ([point, fake])[0];\n }\n /**\n * Efficiently calculate `aP + bQ`. Unsafe, can expose private key, if used incorrectly.\n * Not using Strauss-Shamir trick: precomputation tables are faster.\n * The trick could be useful if both P and Q are not G (not in our case).\n * @returns non-zero affine point\n */\n multiplyAndAddUnsafe(Q, a, b) {\n const G = Point.BASE; // No Strauss-Shamir trick: we have 10% faster G precomputes\n const mul = (P, a // Select faster multiply() method\n ) => (a === _0n || a === _1n || !P.equals(G) ? P.multiplyUnsafe(a) : P.multiply(a));\n const sum = mul(this, a).add(mul(Q, b));\n return sum.is0() ? undefined : sum;\n }\n // Converts Projective point to affine (x, y) coordinates.\n // Can accept precomputed Z^-1 - for example, from invertBatch.\n // (x, y, z) ∋ (x=x/z, y=y/z)\n toAffine(iz) {\n const { px: x, py: y, pz: z } = this;\n const is0 = this.is0();\n // If invZ was 0, we return zero point. However we still want to execute\n // all operations, so we replace invZ with a random number, 1.\n if (iz == null)\n iz = is0 ? Fp.ONE : Fp.inv(z);\n const ax = Fp.mul(x, iz);\n const ay = Fp.mul(y, iz);\n const zz = Fp.mul(z, iz);\n if (is0)\n return { x: Fp.ZERO, y: Fp.ZERO };\n if (!Fp.eql(zz, Fp.ONE))\n throw new Error('invZ was invalid');\n return { x: ax, y: ay };\n }\n isTorsionFree() {\n const { h: cofactor, isTorsionFree } = CURVE;\n if (cofactor === _1n)\n return true; // No subgroups, always torsion-free\n if (isTorsionFree)\n return isTorsionFree(Point, this);\n throw new Error('isTorsionFree() has not been declared for the elliptic curve');\n }\n clearCofactor() {\n const { h: cofactor, clearCofactor } = CURVE;\n if (cofactor === _1n)\n return this; // Fast-path\n if (clearCofactor)\n return clearCofactor(Point, this);\n return this.multiplyUnsafe(CURVE.h);\n }\n toRawBytes(isCompressed = true) {\n this.assertValidity();\n return toBytes(Point, this, isCompressed);\n }\n toHex(isCompressed = true) {\n return ut.bytesToHex(this.toRawBytes(isCompressed));\n }\n }\n Point.BASE = new Point(CURVE.Gx, CURVE.Gy, Fp.ONE);\n Point.ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ZERO);\n const _bits = CURVE.nBitLength;\n const wnaf = wNAF(Point, CURVE.endo ? Math.ceil(_bits / 2) : _bits);\n // Validate if generator point is on curve\n return {\n CURVE,\n ProjectivePoint: Point,\n normPrivateKeyToScalar,\n weierstrassEquation,\n isWithinCurveOrder,\n };\n}\nfunction validateOpts(curve) {\n const opts = validateBasic(curve);\n ut.validateObject(opts, {\n hash: 'hash',\n hmac: 'function',\n randomBytes: 'function',\n }, {\n bits2int: 'function',\n bits2int_modN: 'function',\n lowS: 'boolean',\n });\n return Object.freeze({ lowS: true, ...opts });\n}\nexport function weierstrass(curveDef) {\n const CURVE = validateOpts(curveDef);\n const { Fp, n: CURVE_ORDER } = CURVE;\n const compressedLen = Fp.BYTES + 1; // e.g. 33 for 32\n const uncompressedLen = 2 * Fp.BYTES + 1; // e.g. 65 for 32\n function isValidFieldElement(num) {\n return _0n < num && num < Fp.ORDER; // 0 is banned since it's not invertible FE\n }\n function modN(a) {\n return mod.mod(a, CURVE_ORDER);\n }\n function invN(a) {\n return mod.invert(a, CURVE_ORDER);\n }\n const { ProjectivePoint: Point, normPrivateKeyToScalar, weierstrassEquation, isWithinCurveOrder, } = weierstrassPoints({\n ...CURVE,\n toBytes(_c, point, isCompressed) {\n const a = point.toAffine();\n const x = Fp.toBytes(a.x);\n const cat = ut.concatBytes;\n if (isCompressed) {\n return cat(Uint8Array.from([point.hasEvenY() ? 0x02 : 0x03]), x);\n }\n else {\n return cat(Uint8Array.from([0x04]), x, Fp.toBytes(a.y));\n }\n },\n fromBytes(bytes) {\n const len = bytes.length;\n const head = bytes[0];\n const tail = bytes.subarray(1);\n // this.assertValidity() is done inside of fromHex\n if (len === compressedLen && (head === 0x02 || head === 0x03)) {\n const x = ut.bytesToNumberBE(tail);\n if (!isValidFieldElement(x))\n throw new Error('Point is not on curve');\n const y2 = weierstrassEquation(x); // y² = x³ + ax + b\n let y = Fp.sqrt(y2); // y = y² ^ (p+1)/4\n const isYOdd = (y & _1n) === _1n;\n // ECDSA\n const isHeadOdd = (head & 1) === 1;\n if (isHeadOdd !== isYOdd)\n y = Fp.neg(y);\n return { x, y };\n }\n else if (len === uncompressedLen && head === 0x04) {\n const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES));\n const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES));\n return { x, y };\n }\n else {\n throw new Error(`Point of length ${len} was invalid. Expected ${compressedLen} compressed bytes or ${uncompressedLen} uncompressed bytes`);\n }\n },\n });\n const numToNByteStr = (num) => ut.bytesToHex(ut.numberToBytesBE(num, CURVE.nByteLength));\n function isBiggerThanHalfOrder(number) {\n const HALF = CURVE_ORDER >> _1n;\n return number > HALF;\n }\n function normalizeS(s) {\n return isBiggerThanHalfOrder(s) ? modN(-s) : s;\n }\n // slice bytes num\n const slcNum = (b, from, to) => ut.bytesToNumberBE(b.slice(from, to));\n /**\n * ECDSA signature with its (r, s) properties. Supports DER & compact representations.\n */\n class Signature {\n constructor(r, s, recovery) {\n this.r = r;\n this.s = s;\n this.recovery = recovery;\n this.assertValidity();\n }\n // pair (bytes of r, bytes of s)\n static fromCompact(hex) {\n const l = CURVE.nByteLength;\n hex = ensureBytes('compactSignature', hex, l * 2);\n return new Signature(slcNum(hex, 0, l), slcNum(hex, l, 2 * l));\n }\n // DER encoded ECDSA signature\n // https://bitcoin.stackexchange.com/questions/57644/what-are-the-parts-of-a-bitcoin-transaction-input-script\n static fromDER(hex) {\n const { r, s } = DER.toSig(ensureBytes('DER', hex));\n return new Signature(r, s);\n }\n assertValidity() {\n // can use assertGE here\n if (!isWithinCurveOrder(this.r))\n throw new Error('r must be 0 < r < CURVE.n');\n if (!isWithinCurveOrder(this.s))\n throw new Error('s must be 0 < s < CURVE.n');\n }\n addRecoveryBit(recovery) {\n return new Signature(this.r, this.s, recovery);\n }\n recoverPublicKey(msgHash) {\n const { r, s, recovery: rec } = this;\n const h = bits2int_modN(ensureBytes('msgHash', msgHash)); // Truncate hash\n if (rec == null || ![0, 1, 2, 3].includes(rec))\n throw new Error('recovery id invalid');\n const radj = rec === 2 || rec === 3 ? r + CURVE.n : r;\n if (radj >= Fp.ORDER)\n throw new Error('recovery id 2 or 3 invalid');\n const prefix = (rec & 1) === 0 ? '02' : '03';\n const R = Point.fromHex(prefix + numToNByteStr(radj));\n const ir = invN(radj); // r^-1\n const u1 = modN(-h * ir); // -hr^-1\n const u2 = modN(s * ir); // sr^-1\n const Q = Point.BASE.multiplyAndAddUnsafe(R, u1, u2); // (sr^-1)R-(hr^-1)G = -(hr^-1)G + (sr^-1)\n if (!Q)\n throw new Error('point at infinify'); // unsafe is fine: no priv data leaked\n Q.assertValidity();\n return Q;\n }\n // Signatures should be low-s, to prevent malleability.\n hasHighS() {\n return isBiggerThanHalfOrder(this.s);\n }\n normalizeS() {\n return this.hasHighS() ? new Signature(this.r, modN(-this.s), this.recovery) : this;\n }\n // DER-encoded\n toDERRawBytes() {\n return ut.hexToBytes(this.toDERHex());\n }\n toDERHex() {\n return DER.hexFromSig({ r: this.r, s: this.s });\n }\n // padded bytes of r, then padded bytes of s\n toCompactRawBytes() {\n return ut.hexToBytes(this.toCompactHex());\n }\n toCompactHex() {\n return numToNByteStr(this.r) + numToNByteStr(this.s);\n }\n }\n const utils = {\n isValidPrivateKey(privateKey) {\n try {\n normPrivateKeyToScalar(privateKey);\n return true;\n }\n catch (error) {\n return false;\n }\n },\n normPrivateKeyToScalar: normPrivateKeyToScalar,\n /**\n * Produces cryptographically secure private key from random of size\n * (groupLen + ceil(groupLen / 2)) with modulo bias being negligible.\n */\n randomPrivateKey: () => {\n const length = mod.getMinHashLength(CURVE.n);\n return mod.mapHashToField(CURVE.randomBytes(length), CURVE.n);\n },\n /**\n * Creates precompute table for an arbitrary EC point. Makes point \"cached\".\n * Allows to massively speed-up `point.multiply(scalar)`.\n * @returns cached point\n * @example\n * const fast = utils.precompute(8, ProjectivePoint.fromHex(someonesPubKey));\n * fast.multiply(privKey); // much faster ECDH now\n */\n precompute(windowSize = 8, point = Point.BASE) {\n point._setWindowSize(windowSize);\n point.multiply(BigInt(3)); // 3 is arbitrary, just need any number here\n return point;\n },\n };\n /**\n * Computes public key for a private key. Checks for validity of the private key.\n * @param privateKey private key\n * @param isCompressed whether to return compact (default), or full key\n * @returns Public key, full when isCompressed=false; short when isCompressed=true\n */\n function getPublicKey(privateKey, isCompressed = true) {\n return Point.fromPrivateKey(privateKey).toRawBytes(isCompressed);\n }\n /**\n * Quick and dirty check for item being public key. Does not validate hex, or being on-curve.\n */\n function isProbPub(item) {\n const arr = item instanceof Uint8Array;\n const str = typeof item === 'string';\n const len = (arr || str) && item.length;\n if (arr)\n return len === compressedLen || len === uncompressedLen;\n if (str)\n return len === 2 * compressedLen || len === 2 * uncompressedLen;\n if (item instanceof Point)\n return true;\n return false;\n }\n /**\n * ECDH (Elliptic Curve Diffie Hellman).\n * Computes shared public key from private key and public key.\n * Checks: 1) private key validity 2) shared key is on-curve.\n * Does NOT hash the result.\n * @param privateA private key\n * @param publicB different public key\n * @param isCompressed whether to return compact (default), or full key\n * @returns shared public key\n */\n function getSharedSecret(privateA, publicB, isCompressed = true) {\n if (isProbPub(privateA))\n throw new Error('first arg must be private key');\n if (!isProbPub(publicB))\n throw new Error('second arg must be public key');\n const b = Point.fromHex(publicB); // check for being on-curve\n return b.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed);\n }\n // RFC6979: ensure ECDSA msg is X bytes and < N. RFC suggests optional truncating via bits2octets.\n // FIPS 186-4 4.6 suggests the leftmost min(nBitLen, outLen) bits, which matches bits2int.\n // bits2int can produce res>N, we can do mod(res, N) since the bitLen is the same.\n // int2octets can't be used; pads small msgs with 0: unacceptatble for trunc as per RFC vectors\n const bits2int = CURVE.bits2int ||\n function (bytes) {\n // For curves with nBitLength % 8 !== 0: bits2octets(bits2octets(m)) !== bits2octets(m)\n // for some cases, since bytes.length * 8 is not actual bitLength.\n const num = ut.bytesToNumberBE(bytes); // check for == u8 done here\n const delta = bytes.length * 8 - CURVE.nBitLength; // truncate to nBitLength leftmost bits\n return delta > 0 ? num >> BigInt(delta) : num;\n };\n const bits2int_modN = CURVE.bits2int_modN ||\n function (bytes) {\n return modN(bits2int(bytes)); // can't use bytesToNumberBE here\n };\n // NOTE: pads output with zero as per spec\n const ORDER_MASK = ut.bitMask(CURVE.nBitLength);\n /**\n * Converts to bytes. Checks if num in `[0..ORDER_MASK-1]` e.g.: `[0..2^256-1]`.\n */\n function int2octets(num) {\n if (typeof num !== 'bigint')\n throw new Error('bigint expected');\n if (!(_0n <= num && num < ORDER_MASK))\n throw new Error(`bigint expected < 2^${CURVE.nBitLength}`);\n // works with order, can have different size than numToField!\n return ut.numberToBytesBE(num, CURVE.nByteLength);\n }\n // Steps A, D of RFC6979 3.2\n // Creates RFC6979 seed; converts msg/privKey to numbers.\n // Used only in sign, not in verify.\n // NOTE: we cannot assume here that msgHash has same amount of bytes as curve order, this will be wrong at least for P521.\n // Also it can be bigger for P224 + SHA256\n function prepSig(msgHash, privateKey, opts = defaultSigOpts) {\n if (['recovered', 'canonical'].some((k) => k in opts))\n throw new Error('sign() legacy options not supported');\n const { hash, randomBytes } = CURVE;\n let { lowS, prehash, extraEntropy: ent } = opts; // generates low-s sigs by default\n if (lowS == null)\n lowS = true; // RFC6979 3.2: we skip step A, because we already provide hash\n msgHash = ensureBytes('msgHash', msgHash);\n if (prehash)\n msgHash = ensureBytes('prehashed msgHash', hash(msgHash));\n // We can't later call bits2octets, since nested bits2int is broken for curves\n // with nBitLength % 8 !== 0. Because of that, we unwrap it here as int2octets call.\n // const bits2octets = (bits) => int2octets(bits2int_modN(bits))\n const h1int = bits2int_modN(msgHash);\n const d = normPrivateKeyToScalar(privateKey); // validate private key, convert to bigint\n const seedArgs = [int2octets(d), int2octets(h1int)];\n // extraEntropy. RFC6979 3.6: additional k' (optional).\n if (ent != null) {\n // K = HMAC_K(V || 0x00 || int2octets(x) || bits2octets(h1) || k')\n const e = ent === true ? randomBytes(Fp.BYTES) : ent; // generate random bytes OR pass as-is\n seedArgs.push(ensureBytes('extraEntropy', e)); // check for being bytes\n }\n const seed = ut.concatBytes(...seedArgs); // Step D of RFC6979 3.2\n const m = h1int; // NOTE: no need to call bits2int second time here, it is inside truncateHash!\n // Converts signature params into point w r/s, checks result for validity.\n function k2sig(kBytes) {\n // RFC 6979 Section 3.2, step 3: k = bits2int(T)\n const k = bits2int(kBytes); // Cannot use fields methods, since it is group element\n if (!isWithinCurveOrder(k))\n return; // Important: all mod() calls here must be done over N\n const ik = invN(k); // k^-1 mod n\n const q = Point.BASE.multiply(k).toAffine(); // q = Gk\n const r = modN(q.x); // r = q.x mod n\n if (r === _0n)\n return;\n // Can use scalar blinding b^-1(bm + bdr) where b ∈ [1,q−1] according to\n // https://tches.iacr.org/index.php/TCHES/article/view/7337/6509. We've decided against it:\n // a) dependency on CSPRNG b) 15% slowdown c) doesn't really help since bigints are not CT\n const s = modN(ik * modN(m + r * d)); // Not using blinding here\n if (s === _0n)\n return;\n let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n); // recovery bit (2 or 3, when q.x > n)\n let normS = s;\n if (lowS && isBiggerThanHalfOrder(s)) {\n normS = normalizeS(s); // if lowS was passed, ensure s is always\n recovery ^= 1; // // in the bottom half of N\n }\n return new Signature(r, normS, recovery); // use normS, not s\n }\n return { seed, k2sig };\n }\n const defaultSigOpts = { lowS: CURVE.lowS, prehash: false };\n const defaultVerOpts = { lowS: CURVE.lowS, prehash: false };\n /**\n * Signs message hash with a private key.\n * ```\n * sign(m, d, k) where\n * (x, y) = G × k\n * r = x mod n\n * s = (m + dr)/k mod n\n * ```\n * @param msgHash NOT message. msg needs to be hashed to `msgHash`, or use `prehash`.\n * @param privKey private key\n * @param opts lowS for non-malleable sigs. extraEntropy for mixing randomness into k. prehash will hash first arg.\n * @returns signature with recovery param\n */\n function sign(msgHash, privKey, opts = defaultSigOpts) {\n const { seed, k2sig } = prepSig(msgHash, privKey, opts); // Steps A, D of RFC6979 3.2.\n const C = CURVE;\n const drbg = ut.createHmacDrbg(C.hash.outputLen, C.nByteLength, C.hmac);\n return drbg(seed, k2sig); // Steps B, C, D, E, F, G\n }\n // Enable precomputes. Slows down first publicKey computation by 20ms.\n Point.BASE._setWindowSize(8);\n // utils.precompute(8, ProjectivePoint.BASE)\n /**\n * Verifies a signature against message hash and public key.\n * Rejects lowS signatures by default: to override,\n * specify option `{lowS: false}`. Implements section 4.1.4 from https://www.secg.org/sec1-v2.pdf:\n *\n * ```\n * verify(r, s, h, P) where\n * U1 = hs^-1 mod n\n * U2 = rs^-1 mod n\n * R = U1⋅G - U2⋅P\n * mod(R.x, n) == r\n * ```\n */\n function verify(signature, msgHash, publicKey, opts = defaultVerOpts) {\n const sg = signature;\n msgHash = ensureBytes('msgHash', msgHash);\n publicKey = ensureBytes('publicKey', publicKey);\n if ('strict' in opts)\n throw new Error('options.strict was renamed to lowS');\n const { lowS, prehash } = opts;\n let _sig = undefined;\n let P;\n try {\n if (typeof sg === 'string' || sg instanceof Uint8Array) {\n // Signature can be represented in 2 ways: compact (2*nByteLength) & DER (variable-length).\n // Since DER can also be 2*nByteLength bytes, we check for it first.\n try {\n _sig = Signature.fromDER(sg);\n }\n catch (derError) {\n if (!(derError instanceof DER.Err))\n throw derError;\n _sig = Signature.fromCompact(sg);\n }\n }\n else if (typeof sg === 'object' && typeof sg.r === 'bigint' && typeof sg.s === 'bigint') {\n const { r, s } = sg;\n _sig = new Signature(r, s);\n }\n else {\n throw new Error('PARSE');\n }\n P = Point.fromHex(publicKey);\n }\n catch (error) {\n if (error.message === 'PARSE')\n throw new Error(`signature must be Signature instance, Uint8Array or hex string`);\n return false;\n }\n if (lowS && _sig.hasHighS())\n return false;\n if (prehash)\n msgHash = CURVE.hash(msgHash);\n const { r, s } = _sig;\n const h = bits2int_modN(msgHash); // Cannot use fields methods, since it is group element\n const is = invN(s); // s^-1\n const u1 = modN(h * is); // u1 = hs^-1 mod n\n const u2 = modN(r * is); // u2 = rs^-1 mod n\n const R = Point.BASE.multiplyAndAddUnsafe(P, u1, u2)?.toAffine(); // R = u1⋅G + u2⋅P\n if (!R)\n return false;\n const v = modN(R.x);\n return v === r;\n }\n return {\n CURVE,\n getPublicKey,\n getSharedSecret,\n sign,\n verify,\n ProjectivePoint: Point,\n Signature,\n utils,\n };\n}\n/**\n * Implementation of the Shallue and van de Woestijne method for any weierstrass curve.\n * TODO: check if there is a way to merge this with uvRatio in Edwards; move to modular.\n * b = True and y = sqrt(u / v) if (u / v) is square in F, and\n * b = False and y = sqrt(Z * (u / v)) otherwise.\n * @param Fp\n * @param Z\n * @returns\n */\nexport function SWUFpSqrtRatio(Fp, Z) {\n // Generic implementation\n const q = Fp.ORDER;\n let l = _0n;\n for (let o = q - _1n; o % _2n === _0n; o /= _2n)\n l += _1n;\n const c1 = l; // 1. c1, the largest integer such that 2^c1 divides q - 1.\n // We need 2n ** c1 and 2n ** (c1-1). We can't use **; but we can use <<.\n // 2n ** c1 == 2n << (c1-1)\n const _2n_pow_c1_1 = _2n << (c1 - _1n - _1n);\n const _2n_pow_c1 = _2n_pow_c1_1 * _2n;\n const c2 = (q - _1n) / _2n_pow_c1; // 2. c2 = (q - 1) / (2^c1) # Integer arithmetic\n const c3 = (c2 - _1n) / _2n; // 3. c3 = (c2 - 1) / 2 # Integer arithmetic\n const c4 = _2n_pow_c1 - _1n; // 4. c4 = 2^c1 - 1 # Integer arithmetic\n const c5 = _2n_pow_c1_1; // 5. c5 = 2^(c1 - 1) # Integer arithmetic\n const c6 = Fp.pow(Z, c2); // 6. c6 = Z^c2\n const c7 = Fp.pow(Z, (c2 + _1n) / _2n); // 7. c7 = Z^((c2 + 1) / 2)\n let sqrtRatio = (u, v) => {\n let tv1 = c6; // 1. tv1 = c6\n let tv2 = Fp.pow(v, c4); // 2. tv2 = v^c4\n let tv3 = Fp.sqr(tv2); // 3. tv3 = tv2^2\n tv3 = Fp.mul(tv3, v); // 4. tv3 = tv3 * v\n let tv5 = Fp.mul(u, tv3); // 5. tv5 = u * tv3\n tv5 = Fp.pow(tv5, c3); // 6. tv5 = tv5^c3\n tv5 = Fp.mul(tv5, tv2); // 7. tv5 = tv5 * tv2\n tv2 = Fp.mul(tv5, v); // 8. tv2 = tv5 * v\n tv3 = Fp.mul(tv5, u); // 9. tv3 = tv5 * u\n let tv4 = Fp.mul(tv3, tv2); // 10. tv4 = tv3 * tv2\n tv5 = Fp.pow(tv4, c5); // 11. tv5 = tv4^c5\n let isQR = Fp.eql(tv5, Fp.ONE); // 12. isQR = tv5 == 1\n tv2 = Fp.mul(tv3, c7); // 13. tv2 = tv3 * c7\n tv5 = Fp.mul(tv4, tv1); // 14. tv5 = tv4 * tv1\n tv3 = Fp.cmov(tv2, tv3, isQR); // 15. tv3 = CMOV(tv2, tv3, isQR)\n tv4 = Fp.cmov(tv5, tv4, isQR); // 16. tv4 = CMOV(tv5, tv4, isQR)\n // 17. for i in (c1, c1 - 1, ..., 2):\n for (let i = c1; i > _1n; i--) {\n let tv5 = i - _2n; // 18. tv5 = i - 2\n tv5 = _2n << (tv5 - _1n); // 19. tv5 = 2^tv5\n let tvv5 = Fp.pow(tv4, tv5); // 20. tv5 = tv4^tv5\n const e1 = Fp.eql(tvv5, Fp.ONE); // 21. e1 = tv5 == 1\n tv2 = Fp.mul(tv3, tv1); // 22. tv2 = tv3 * tv1\n tv1 = Fp.mul(tv1, tv1); // 23. tv1 = tv1 * tv1\n tvv5 = Fp.mul(tv4, tv1); // 24. tv5 = tv4 * tv1\n tv3 = Fp.cmov(tv2, tv3, e1); // 25. tv3 = CMOV(tv2, tv3, e1)\n tv4 = Fp.cmov(tvv5, tv4, e1); // 26. tv4 = CMOV(tv5, tv4, e1)\n }\n return { isValid: isQR, value: tv3 };\n };\n if (Fp.ORDER % _4n === _3n) {\n // sqrt_ratio_3mod4(u, v)\n const c1 = (Fp.ORDER - _3n) / _4n; // 1. c1 = (q - 3) / 4 # Integer arithmetic\n const c2 = Fp.sqrt(Fp.neg(Z)); // 2. c2 = sqrt(-Z)\n sqrtRatio = (u, v) => {\n let tv1 = Fp.sqr(v); // 1. tv1 = v^2\n const tv2 = Fp.mul(u, v); // 2. tv2 = u * v\n tv1 = Fp.mul(tv1, tv2); // 3. tv1 = tv1 * tv2\n let y1 = Fp.pow(tv1, c1); // 4. y1 = tv1^c1\n y1 = Fp.mul(y1, tv2); // 5. y1 = y1 * tv2\n const y2 = Fp.mul(y1, c2); // 6. y2 = y1 * c2\n const tv3 = Fp.mul(Fp.sqr(y1), v); // 7. tv3 = y1^2; 8. tv3 = tv3 * v\n const isQR = Fp.eql(tv3, u); // 9. isQR = tv3 == u\n let y = Fp.cmov(y2, y1, isQR); // 10. y = CMOV(y2, y1, isQR)\n return { isValid: isQR, value: y }; // 11. return (isQR, y) isQR ? y : y*c2\n };\n }\n // No curves uses that\n // if (Fp.ORDER % _8n === _5n) // sqrt_ratio_5mod8\n return sqrtRatio;\n}\n/**\n * Simplified Shallue-van de Woestijne-Ulas Method\n * https://www.rfc-editor.org/rfc/rfc9380#section-6.6.2\n */\nexport function mapToCurveSimpleSWU(Fp, opts) {\n mod.validateField(Fp);\n if (!Fp.isValid(opts.A) || !Fp.isValid(opts.B) || !Fp.isValid(opts.Z))\n throw new Error('mapToCurveSimpleSWU: invalid opts');\n const sqrtRatio = SWUFpSqrtRatio(Fp, opts.Z);\n if (!Fp.isOdd)\n throw new Error('Fp.isOdd is not implemented!');\n // Input: u, an element of F.\n // Output: (x, y), a point on E.\n return (u) => {\n // prettier-ignore\n let tv1, tv2, tv3, tv4, tv5, tv6, x, y;\n tv1 = Fp.sqr(u); // 1. tv1 = u^2\n tv1 = Fp.mul(tv1, opts.Z); // 2. tv1 = Z * tv1\n tv2 = Fp.sqr(tv1); // 3. tv2 = tv1^2\n tv2 = Fp.add(tv2, tv1); // 4. tv2 = tv2 + tv1\n tv3 = Fp.add(tv2, Fp.ONE); // 5. tv3 = tv2 + 1\n tv3 = Fp.mul(tv3, opts.B); // 6. tv3 = B * tv3\n tv4 = Fp.cmov(opts.Z, Fp.neg(tv2), !Fp.eql(tv2, Fp.ZERO)); // 7. tv4 = CMOV(Z, -tv2, tv2 != 0)\n tv4 = Fp.mul(tv4, opts.A); // 8. tv4 = A * tv4\n tv2 = Fp.sqr(tv3); // 9. tv2 = tv3^2\n tv6 = Fp.sqr(tv4); // 10. tv6 = tv4^2\n tv5 = Fp.mul(tv6, opts.A); // 11. tv5 = A * tv6\n tv2 = Fp.add(tv2, tv5); // 12. tv2 = tv2 + tv5\n tv2 = Fp.mul(tv2, tv3); // 13. tv2 = tv2 * tv3\n tv6 = Fp.mul(tv6, tv4); // 14. tv6 = tv6 * tv4\n tv5 = Fp.mul(tv6, opts.B); // 15. tv5 = B * tv6\n tv2 = Fp.add(tv2, tv5); // 16. tv2 = tv2 + tv5\n x = Fp.mul(tv1, tv3); // 17. x = tv1 * tv3\n const { isValid, value } = sqrtRatio(tv2, tv6); // 18. (is_gx1_square, y1) = sqrt_ratio(tv2, tv6)\n y = Fp.mul(tv1, u); // 19. y = tv1 * u -> Z * u^3 * y1\n y = Fp.mul(y, value); // 20. y = y * y1\n x = Fp.cmov(x, tv3, isValid); // 21. x = CMOV(x, tv3, is_gx1_square)\n y = Fp.cmov(y, value, isValid); // 22. y = CMOV(y, y1, is_gx1_square)\n const e1 = Fp.isOdd(u) === Fp.isOdd(y); // 23. e1 = sgn0(u) == sgn0(y)\n y = Fp.cmov(Fp.neg(y), y, e1); // 24. y = CMOV(-y, y, e1)\n x = Fp.div(x, tv4); // 25. x = x / tv4\n return { x, y };\n };\n}\n//# sourceMappingURL=weierstrass.js.map","import { hash as assertHash, bytes as assertBytes, exists as assertExists } from './_assert.js';\nimport { Hash, toBytes } from './utils.js';\n// HMAC (RFC 2104)\nexport class HMAC extends Hash {\n constructor(hash, _key) {\n super();\n this.finished = false;\n this.destroyed = false;\n assertHash(hash);\n const key = toBytes(_key);\n this.iHash = hash.create();\n if (typeof this.iHash.update !== 'function')\n throw new Error('Expected instance of class which extends utils.Hash');\n this.blockLen = this.iHash.blockLen;\n this.outputLen = this.iHash.outputLen;\n const blockLen = this.blockLen;\n const pad = new Uint8Array(blockLen);\n // blockLen can be bigger than outputLen\n pad.set(key.length > blockLen ? hash.create().update(key).digest() : key);\n for (let i = 0; i < pad.length; i++)\n pad[i] ^= 0x36;\n this.iHash.update(pad);\n // By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone\n this.oHash = hash.create();\n // Undo internal XOR && apply outer XOR\n for (let i = 0; i < pad.length; i++)\n pad[i] ^= 0x36 ^ 0x5c;\n this.oHash.update(pad);\n pad.fill(0);\n }\n update(buf) {\n assertExists(this);\n this.iHash.update(buf);\n return this;\n }\n digestInto(out) {\n assertExists(this);\n assertBytes(out, this.outputLen);\n this.finished = true;\n this.iHash.digestInto(out);\n this.oHash.update(out);\n this.oHash.digestInto(out);\n this.destroy();\n }\n digest() {\n const out = new Uint8Array(this.oHash.outputLen);\n this.digestInto(out);\n return out;\n }\n _cloneInto(to) {\n // Create new instance without calling constructor since key already in state and we don't know it.\n to || (to = Object.create(Object.getPrototypeOf(this), {}));\n const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this;\n to = to;\n to.finished = finished;\n to.destroyed = destroyed;\n to.blockLen = blockLen;\n to.outputLen = outputLen;\n to.oHash = oHash._cloneInto(to.oHash);\n to.iHash = iHash._cloneInto(to.iHash);\n return to;\n }\n destroy() {\n this.destroyed = true;\n this.oHash.destroy();\n this.iHash.destroy();\n }\n}\n/**\n * HMAC: RFC2104 message authentication code.\n * @param hash - function that would be used e.g. sha256\n * @param key - message key\n * @param message - message data\n */\nexport const hmac = (hash, key, message) => new HMAC(hash, key).update(message).digest();\nhmac.create = (hash, key) => new HMAC(hash, key);\n//# sourceMappingURL=hmac.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nimport { hmac } from '@noble/hashes/hmac';\nimport { concatBytes, randomBytes } from '@noble/hashes/utils';\nimport { weierstrass } from './abstract/weierstrass.js';\n// connects noble-curves to noble-hashes\nexport function getHash(hash) {\n return {\n hash,\n hmac: (key, ...msgs) => hmac(hash, key, concatBytes(...msgs)),\n randomBytes,\n };\n}\nexport function createCurve(curveDef, defHash) {\n const create = (hash) => weierstrass({ ...curveDef, ...getHash(hash) });\n return Object.freeze({ ...create(defHash), create });\n}\n//# sourceMappingURL=_shortw_utils.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nimport { sha256 } from '@noble/hashes/sha256';\nimport { randomBytes } from '@noble/hashes/utils';\nimport { Field, mod, pow2 } from './abstract/modular.js';\nimport { mapToCurveSimpleSWU } from './abstract/weierstrass.js';\nimport { bytesToNumberBE, concatBytes, ensureBytes, numberToBytesBE } from './abstract/utils.js';\nimport { createHasher, isogenyMap } from './abstract/hash-to-curve.js';\nimport { createCurve } from './_shortw_utils.js';\nconst secp256k1P = BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f');\nconst secp256k1N = BigInt('0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141');\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst divNearest = (a, b) => (a + b / _2n) / b;\n/**\n * √n = n^((p+1)/4) for fields p = 3 mod 4. We unwrap the loop and multiply bit-by-bit.\n * (P+1n/4n).toString(2) would produce bits [223x 1, 0, 22x 1, 4x 0, 11, 00]\n */\nfunction sqrtMod(y) {\n const P = secp256k1P;\n // prettier-ignore\n const _3n = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22);\n // prettier-ignore\n const _23n = BigInt(23), _44n = BigInt(44), _88n = BigInt(88);\n const b2 = (y * y * y) % P; // x^3, 11\n const b3 = (b2 * b2 * y) % P; // x^7\n const b6 = (pow2(b3, _3n, P) * b3) % P;\n const b9 = (pow2(b6, _3n, P) * b3) % P;\n const b11 = (pow2(b9, _2n, P) * b2) % P;\n const b22 = (pow2(b11, _11n, P) * b11) % P;\n const b44 = (pow2(b22, _22n, P) * b22) % P;\n const b88 = (pow2(b44, _44n, P) * b44) % P;\n const b176 = (pow2(b88, _88n, P) * b88) % P;\n const b220 = (pow2(b176, _44n, P) * b44) % P;\n const b223 = (pow2(b220, _3n, P) * b3) % P;\n const t1 = (pow2(b223, _23n, P) * b22) % P;\n const t2 = (pow2(t1, _6n, P) * b2) % P;\n const root = pow2(t2, _2n, P);\n if (!Fp.eql(Fp.sqr(root), y))\n throw new Error('Cannot find square root');\n return root;\n}\nconst Fp = Field(secp256k1P, undefined, undefined, { sqrt: sqrtMod });\nexport const secp256k1 = createCurve({\n a: BigInt(0),\n b: BigInt(7),\n Fp,\n n: secp256k1N,\n // Base point (x, y) aka generator point\n Gx: BigInt('55066263022277343669578718895168534326250603453777594175500187360389116729240'),\n Gy: BigInt('32670510020758816978083085130507043184471273380659243275938904335757337482424'),\n h: BigInt(1),\n lowS: true,\n /**\n * secp256k1 belongs to Koblitz curves: it has efficiently computable endomorphism.\n * Endomorphism uses 2x less RAM, speeds up precomputation by 2x and ECDH / key recovery by 20%.\n * For precomputed wNAF it trades off 1/2 init time & 1/3 ram for 20% perf hit.\n * Explanation: https://gist.github.com/paulmillr/eb670806793e84df628a7c434a873066\n */\n endo: {\n beta: BigInt('0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee'),\n splitScalar: (k) => {\n const n = secp256k1N;\n const a1 = BigInt('0x3086d221a7d46bcde86c90e49284eb15');\n const b1 = -_1n * BigInt('0xe4437ed6010e88286f547fa90abfe4c3');\n const a2 = BigInt('0x114ca50f7a8e2f3f657c1108d9d44cfd8');\n const b2 = a1;\n const POW_2_128 = BigInt('0x100000000000000000000000000000000'); // (2n**128n).toString(16)\n const c1 = divNearest(b2 * k, n);\n const c2 = divNearest(-b1 * k, n);\n let k1 = mod(k - c1 * a1 - c2 * a2, n);\n let k2 = mod(-c1 * b1 - c2 * b2, n);\n const k1neg = k1 > POW_2_128;\n const k2neg = k2 > POW_2_128;\n if (k1neg)\n k1 = n - k1;\n if (k2neg)\n k2 = n - k2;\n if (k1 > POW_2_128 || k2 > POW_2_128) {\n throw new Error('splitScalar: Endomorphism failed, k=' + k);\n }\n return { k1neg, k1, k2neg, k2 };\n },\n },\n}, sha256);\n// Schnorr signatures are superior to ECDSA from above. Below is Schnorr-specific BIP0340 code.\n// https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki\nconst _0n = BigInt(0);\nconst fe = (x) => typeof x === 'bigint' && _0n < x && x < secp256k1P;\nconst ge = (x) => typeof x === 'bigint' && _0n < x && x < secp256k1N;\n/** An object mapping tags to their tagged hash prefix of [SHA256(tag) | SHA256(tag)] */\nconst TAGGED_HASH_PREFIXES = {};\nfunction taggedHash(tag, ...messages) {\n let tagP = TAGGED_HASH_PREFIXES[tag];\n if (tagP === undefined) {\n const tagH = sha256(Uint8Array.from(tag, (c) => c.charCodeAt(0)));\n tagP = concatBytes(tagH, tagH);\n TAGGED_HASH_PREFIXES[tag] = tagP;\n }\n return sha256(concatBytes(tagP, ...messages));\n}\n// ECDSA compact points are 33-byte. Schnorr is 32: we strip first byte 0x02 or 0x03\nconst pointToBytes = (point) => point.toRawBytes(true).slice(1);\nconst numTo32b = (n) => numberToBytesBE(n, 32);\nconst modP = (x) => mod(x, secp256k1P);\nconst modN = (x) => mod(x, secp256k1N);\nconst Point = secp256k1.ProjectivePoint;\nconst GmulAdd = (Q, a, b) => Point.BASE.multiplyAndAddUnsafe(Q, a, b);\n// Calculate point, scalar and bytes\nfunction schnorrGetExtPubKey(priv) {\n let d_ = secp256k1.utils.normPrivateKeyToScalar(priv); // same method executed in fromPrivateKey\n let p = Point.fromPrivateKey(d_); // P = d'⋅G; 0 < d' < n check is done inside\n const scalar = p.hasEvenY() ? d_ : modN(-d_);\n return { scalar: scalar, bytes: pointToBytes(p) };\n}\n/**\n * lift_x from BIP340. Convert 32-byte x coordinate to elliptic curve point.\n * @returns valid point checked for being on-curve\n */\nfunction lift_x(x) {\n if (!fe(x))\n throw new Error('bad x: need 0 < x < p'); // Fail if x ≥ p.\n const xx = modP(x * x);\n const c = modP(xx * x + BigInt(7)); // Let c = x³ + 7 mod p.\n let y = sqrtMod(c); // Let y = c^(p+1)/4 mod p.\n if (y % _2n !== _0n)\n y = modP(-y); // Return the unique point P such that x(P) = x and\n const p = new Point(x, y, _1n); // y(P) = y if y mod 2 = 0 or y(P) = p-y otherwise.\n p.assertValidity();\n return p;\n}\n/**\n * Create tagged hash, convert it to bigint, reduce modulo-n.\n */\nfunction challenge(...args) {\n return modN(bytesToNumberBE(taggedHash('BIP0340/challenge', ...args)));\n}\n/**\n * Schnorr public key is just `x` coordinate of Point as per BIP340.\n */\nfunction schnorrGetPublicKey(privateKey) {\n return schnorrGetExtPubKey(privateKey).bytes; // d'=int(sk). Fail if d'=0 or d'≥n. Ret bytes(d'⋅G)\n}\n/**\n * Creates Schnorr signature as per BIP340. Verifies itself before returning anything.\n * auxRand is optional and is not the sole source of k generation: bad CSPRNG won't be dangerous.\n */\nfunction schnorrSign(message, privateKey, auxRand = randomBytes(32)) {\n const m = ensureBytes('message', message);\n const { bytes: px, scalar: d } = schnorrGetExtPubKey(privateKey); // checks for isWithinCurveOrder\n const a = ensureBytes('auxRand', auxRand, 32); // Auxiliary random data a: a 32-byte array\n const t = numTo32b(d ^ bytesToNumberBE(taggedHash('BIP0340/aux', a))); // Let t be the byte-wise xor of bytes(d) and hash/aux(a)\n const rand = taggedHash('BIP0340/nonce', t, px, m); // Let rand = hash/nonce(t || bytes(P) || m)\n const k_ = modN(bytesToNumberBE(rand)); // Let k' = int(rand) mod n\n if (k_ === _0n)\n throw new Error('sign failed: k is zero'); // Fail if k' = 0.\n const { bytes: rx, scalar: k } = schnorrGetExtPubKey(k_); // Let R = k'⋅G.\n const e = challenge(rx, px, m); // Let e = int(hash/challenge(bytes(R) || bytes(P) || m)) mod n.\n const sig = new Uint8Array(64); // Let sig = bytes(R) || bytes((k + ed) mod n).\n sig.set(rx, 0);\n sig.set(numTo32b(modN(k + e * d)), 32);\n // If Verify(bytes(P), m, sig) (see below) returns failure, abort\n if (!schnorrVerify(sig, m, px))\n throw new Error('sign: Invalid signature produced');\n return sig;\n}\n/**\n * Verifies Schnorr signature.\n * Will swallow errors & return false except for initial type validation of arguments.\n */\nfunction schnorrVerify(signature, message, publicKey) {\n const sig = ensureBytes('signature', signature, 64);\n const m = ensureBytes('message', message);\n const pub = ensureBytes('publicKey', publicKey, 32);\n try {\n const P = lift_x(bytesToNumberBE(pub)); // P = lift_x(int(pk)); fail if that fails\n const r = bytesToNumberBE(sig.subarray(0, 32)); // Let r = int(sig[0:32]); fail if r ≥ p.\n if (!fe(r))\n return false;\n const s = bytesToNumberBE(sig.subarray(32, 64)); // Let s = int(sig[32:64]); fail if s ≥ n.\n if (!ge(s))\n return false;\n const e = challenge(numTo32b(r), pointToBytes(P), m); // int(challenge(bytes(r)||bytes(P)||m))%n\n const R = GmulAdd(P, s, modN(-e)); // R = s⋅G - e⋅P\n if (!R || !R.hasEvenY() || R.toAffine().x !== r)\n return false; // -eP == (n-e)P\n return true; // Fail if is_infinite(R) / not has_even_y(R) / x(R) ≠ r.\n }\n catch (error) {\n return false;\n }\n}\nexport const schnorr = /* @__PURE__ */ (() => ({\n getPublicKey: schnorrGetPublicKey,\n sign: schnorrSign,\n verify: schnorrVerify,\n utils: {\n randomPrivateKey: secp256k1.utils.randomPrivateKey,\n lift_x,\n pointToBytes,\n numberToBytesBE,\n bytesToNumberBE,\n taggedHash,\n mod,\n },\n}))();\nconst isoMap = /* @__PURE__ */ (() => isogenyMap(Fp, [\n // xNum\n [\n '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7',\n '0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581',\n '0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262',\n '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c',\n ],\n // xDen\n [\n '0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b',\n '0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14',\n '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1\n ],\n // yNum\n [\n '0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c',\n '0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3',\n '0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931',\n '0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84',\n ],\n // yDen\n [\n '0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b',\n '0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573',\n '0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f',\n '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1\n ],\n].map((i) => i.map((j) => BigInt(j)))))();\nconst mapSWU = /* @__PURE__ */ (() => mapToCurveSimpleSWU(Fp, {\n A: BigInt('0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533'),\n B: BigInt('1771'),\n Z: Fp.create(BigInt('-11')),\n}))();\nconst htf = /* @__PURE__ */ (() => createHasher(secp256k1.ProjectivePoint, (scalars) => {\n const { x, y } = mapSWU(Fp.create(scalars[0]));\n return isoMap(x, y);\n}, {\n DST: 'secp256k1_XMD:SHA-256_SSWU_RO_',\n encodeDST: 'secp256k1_XMD:SHA-256_SSWU_NU_',\n p: Fp.ORDER,\n m: 1,\n k: 128,\n expand: 'xmd',\n hash: sha256,\n}))();\nexport const hashToCurve = /* @__PURE__ */ (() => htf.hashToCurve)();\nexport const encodeToCurve = /* @__PURE__ */ (() => htf.encodeToCurve)();\n//# sourceMappingURL=secp256k1.js.map","/**\n * A constant for the zero address.\n *\n * (**i.e.** ``\"0x0000000000000000000000000000000000000000\"``)\n */\nexport const ZeroAddress = \"0x0000000000000000000000000000000000000000\";\n//# sourceMappingURL=addresses.js.map","/**\n * Add details about signing here.\n *\n * @_subsection: api/crypto:Signing [about-signing]\n */\nimport { secp256k1 } from \"@noble/curves/secp256k1\";\nimport { concat, dataLength, getBytes, getBytesCopy, hexlify, toBeHex, assertArgument } from \"../utils/index.js\";\nimport { Signature } from \"./signature.js\";\n/**\n * A **SigningKey** provides high-level access to the elliptic curve\n * cryptography (ECC) operations and key management.\n */\nexport class SigningKey {\n #privateKey;\n /**\n * Creates a new **SigningKey** for %%privateKey%%.\n */\n constructor(privateKey) {\n assertArgument(dataLength(privateKey) === 32, \"invalid private key\", \"privateKey\", \"[REDACTED]\");\n this.#privateKey = hexlify(privateKey);\n }\n /**\n * The private key.\n */\n get privateKey() { return this.#privateKey; }\n /**\n * The uncompressed public key.\n *\n * This will always begin with the prefix ``0x04`` and be 132\n * characters long (the ``0x`` prefix and 130 hexadecimal nibbles).\n */\n get publicKey() { return SigningKey.computePublicKey(this.#privateKey); }\n /**\n * The compressed public key.\n *\n * This will always begin with either the prefix ``0x02`` or ``0x03``\n * and be 68 characters long (the ``0x`` prefix and 33 hexadecimal\n * nibbles)\n */\n get compressedPublicKey() { return SigningKey.computePublicKey(this.#privateKey, true); }\n /**\n * Return the signature of the signed %%digest%%.\n */\n sign(digest) {\n assertArgument(dataLength(digest) === 32, \"invalid digest length\", \"digest\", digest);\n const sig = secp256k1.sign(getBytesCopy(digest), getBytesCopy(this.#privateKey), {\n lowS: true\n });\n return Signature.from({\n r: toBeHex(sig.r, 32),\n s: toBeHex(sig.s, 32),\n v: (sig.recovery ? 0x1c : 0x1b)\n });\n }\n /**\n * Returns the [[link-wiki-ecdh]] shared secret between this\n * private key and the %%other%% key.\n *\n * The %%other%% key may be any type of key, a raw public key,\n * a compressed/uncompressed pubic key or aprivate key.\n *\n * Best practice is usually to use a cryptographic hash on the\n * returned value before using it as a symetric secret.\n *\n * @example:\n * sign1 = new SigningKey(id(\"some-secret-1\"))\n * sign2 = new SigningKey(id(\"some-secret-2\"))\n *\n * // Notice that privA.computeSharedSecret(pubB)...\n * sign1.computeSharedSecret(sign2.publicKey)\n * //_result:\n *\n * // ...is equal to privB.computeSharedSecret(pubA).\n * sign2.computeSharedSecret(sign1.publicKey)\n * //_result:\n */\n computeSharedSecret(other) {\n const pubKey = SigningKey.computePublicKey(other);\n return hexlify(secp256k1.getSharedSecret(getBytesCopy(this.#privateKey), getBytes(pubKey), false));\n }\n /**\n * Compute the public key for %%key%%, optionally %%compressed%%.\n *\n * The %%key%% may be any type of key, a raw public key, a\n * compressed/uncompressed public key or private key.\n *\n * @example:\n * sign = new SigningKey(id(\"some-secret\"));\n *\n * // Compute the uncompressed public key for a private key\n * SigningKey.computePublicKey(sign.privateKey)\n * //_result:\n *\n * // Compute the compressed public key for a private key\n * SigningKey.computePublicKey(sign.privateKey, true)\n * //_result:\n *\n * // Compute the uncompressed public key\n * SigningKey.computePublicKey(sign.publicKey, false);\n * //_result:\n *\n * // Compute the Compressed a public key\n * SigningKey.computePublicKey(sign.publicKey, true);\n * //_result:\n */\n static computePublicKey(key, compressed) {\n let bytes = getBytes(key, \"key\");\n // private key\n if (bytes.length === 32) {\n const pubKey = secp256k1.getPublicKey(bytes, !!compressed);\n return hexlify(pubKey);\n }\n // raw public key; use uncompressed key with 0x04 prefix\n if (bytes.length === 64) {\n const pub = new Uint8Array(65);\n pub[0] = 0x04;\n pub.set(bytes, 1);\n bytes = pub;\n }\n const point = secp256k1.ProjectivePoint.fromHex(bytes);\n return hexlify(point.toRawBytes(compressed));\n }\n /**\n * Returns the public key for the private key which produced the\n * %%signature%% for the given %%digest%%.\n *\n * @example:\n * key = new SigningKey(id(\"some-secret\"))\n * digest = id(\"hello world\")\n * sig = key.sign(digest)\n *\n * // Notice the signer public key...\n * key.publicKey\n * //_result:\n *\n * // ...is equal to the recovered public key\n * SigningKey.recoverPublicKey(digest, sig)\n * //_result:\n *\n */\n static recoverPublicKey(digest, signature) {\n assertArgument(dataLength(digest) === 32, \"invalid digest length\", \"digest\", digest);\n const sig = Signature.from(signature);\n let secpSig = secp256k1.Signature.fromCompact(getBytesCopy(concat([sig.r, sig.s])));\n secpSig = secpSig.addRecoveryBit(sig.yParity);\n const pubKey = secpSig.recoverPublicKey(getBytesCopy(digest));\n assertArgument(pubKey != null, \"invalid signature for digest\", \"signature\", signature);\n return \"0x\" + pubKey.toHex(false);\n }\n /**\n * Returns the point resulting from adding the ellipic curve points\n * %%p0%% and %%p1%%.\n *\n * This is not a common function most developers should require, but\n * can be useful for certain privacy-specific techniques.\n *\n * For example, it is used by [[HDNodeWallet]] to compute child\n * addresses from parent public keys and chain codes.\n */\n static addPoints(p0, p1, compressed) {\n const pub0 = secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p0).substring(2));\n const pub1 = secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p1).substring(2));\n return \"0x\" + pub0.add(pub1).toHex(!!compressed);\n }\n}\n//# sourceMappingURL=signing-key.js.map","import { keccak256 } from \"../crypto/index.js\";\nimport { concat, dataSlice, getBigInt, getBytes, encodeRlp, assertArgument } from \"../utils/index.js\";\nimport { getAddress } from \"./address.js\";\n// http://ethereum.stackexchange.com/questions/760/how-is-the-address-of-an-ethereum-contract-computed\n/**\n * Returns the address that would result from a ``CREATE`` for %%tx%%.\n *\n * This can be used to compute the address a contract will be\n * deployed to by an EOA when sending a deployment transaction (i.e.\n * when the ``to`` address is ``null``).\n *\n * This can also be used to compute the address a contract will be\n * deployed to by a contract, by using the contract's address as the\n * ``to`` and the contract's nonce.\n *\n * @example\n * from = \"0x8ba1f109551bD432803012645Ac136ddd64DBA72\";\n * nonce = 5;\n *\n * getCreateAddress({ from, nonce });\n * //_result:\n */\nexport function getCreateAddress(tx) {\n const from = getAddress(tx.from);\n const nonce = getBigInt(tx.nonce, \"tx.nonce\");\n let nonceHex = nonce.toString(16);\n if (nonceHex === \"0\") {\n nonceHex = \"0x\";\n }\n else if (nonceHex.length % 2) {\n nonceHex = \"0x0\" + nonceHex;\n }\n else {\n nonceHex = \"0x\" + nonceHex;\n }\n return getAddress(dataSlice(keccak256(encodeRlp([from, nonceHex])), 12));\n}\n/**\n * Returns the address that would result from a ``CREATE2`` operation\n * with the given %%from%%, %%salt%% and %%initCodeHash%%.\n *\n * To compute the %%initCodeHash%% from a contract's init code, use\n * the [[keccak256]] function.\n *\n * For a quick overview and example of ``CREATE2``, see [[link-ricmoo-wisps]].\n *\n * @example\n * // The address of the contract\n * from = \"0x8ba1f109551bD432803012645Ac136ddd64DBA72\"\n *\n * // The salt\n * salt = id(\"HelloWorld\")\n *\n * // The hash of the initCode\n * initCode = \"0x6394198df16000526103ff60206004601c335afa6040516060f3\";\n * initCodeHash = keccak256(initCode)\n *\n * getCreate2Address(from, salt, initCodeHash)\n * //_result:\n */\nexport function getCreate2Address(_from, _salt, _initCodeHash) {\n const from = getAddress(_from);\n const salt = getBytes(_salt, \"salt\");\n const initCodeHash = getBytes(_initCodeHash, \"initCodeHash\");\n assertArgument(salt.length === 32, \"salt must be 32 bytes\", \"salt\", _salt);\n assertArgument(initCodeHash.length === 32, \"initCodeHash must be 32 bytes\", \"initCodeHash\", _initCodeHash);\n return getAddress(dataSlice(keccak256(concat([\"0xff\", from, salt, initCodeHash])), 12));\n}\n//# sourceMappingURL=contract-address.js.map","// created 2025-09-14T17:56:24.099Z\n// compressed base64-encoded blob for include-ens data\n// source: https://github.com/adraffy/ens-normalize.js/blob/main/src/make.js\n// see: https://github.com/adraffy/ens-normalize.js#security\n// SHA-256: 92cbf3a1af3c3c0a91aee0dc542072775f4ebbbc526a84189a12da2d56f5accd\nvar COMPRESSED$1 = 'AEkVMQnvDV0B0wKWAQYBQgDpATQAoQDcAIUApwBsAOMAcACTAEUAigBRAHkAPgA/ACwANwAoAGIAHgAvACsAJQAXAC8AHAAhACIALwAVACsAEQAiAAsAGwARABgAFwA7ACoAKwAsADQAFgAtABIAHAAhAA4AHQAdABUAFgAZAA0ADgAXABAAGQAUABIEtAYQASIUOjfDBdMAsQCuPwFnAKUBA10jAK5/Ly8vLwE/pwUJ6/0HPwbkMQVXBVgAPSs5APa2EQbIwQuUCkEDyJ4zAsUKLwKOoQKG2D+Ob4kCxcsCg/IBH98JAPKtAUECLY0KP48A4wDiChUAF9S5yAwLPZ0EG3cA/QI5GL0P6wkGKekFBIFnDRsHLQCrAGmR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K7hEiJhCLYFDx3PBhE97c2a0ub1/ePJcyJOqr7UaTAPTJ+xvZtjb/40sloY1ltRnTkWILmIP2b7S3AdXCR+YiArMUHwdncpjpyDGfzqGOUoAuaamWzAMacQtb34/M32FEgR5lUEf8fRzFrZUhzQj0fR7/6gdzdnVVvcSneLmtqJ930VCCDORY8CVdQWdo/S3PNkX3pQsPVKWIYGAMrFZoq8bQ/OJBDSXP7KSBdL3QN0Zqd393p6VFc7DnlnFiN00SY5Nux7yadeIM0Upl2rVsu8/VAI';\nconst FENCED = new Map([[8217,\"apostrophe\"],[8260,\"fraction slash\"],[12539,\"middle dot\"]]);\nconst NSM_MAX = 4;\n\nfunction decode_arithmetic(bytes) {\r\n\tlet pos = 0;\r\n\tfunction u16() { return (bytes[pos++] << 8) | bytes[pos++]; }\r\n\t\r\n\t// decode the frequency table\r\n\tlet symbol_count = u16();\r\n\tlet total = 1;\r\n\tlet acc = [0, 1]; // first symbol has frequency 1\r\n\tfor (let i = 1; i < symbol_count; i++) {\r\n\t\tacc.push(total += u16());\r\n\t}\r\n\r\n\t// skip the sized-payload that the last 3 symbols index into\r\n\tlet skip = u16();\r\n\tlet pos_payload = pos;\r\n\tpos += skip;\r\n\r\n\tlet read_width = 0;\r\n\tlet read_buffer = 0; \r\n\tfunction read_bit() {\r\n\t\tif (read_width == 0) {\r\n\t\t\t// this will read beyond end of buffer\r\n\t\t\t// but (undefined|0) => zero pad\r\n\t\t\tread_buffer = (read_buffer << 8) | bytes[pos++];\r\n\t\t\tread_width = 8;\r\n\t\t}\r\n\t\treturn (read_buffer >> --read_width) & 1;\r\n\t}\r\n\r\n\tconst N = 31;\r\n\tconst FULL = 2**N;\r\n\tconst HALF = FULL >>> 1;\r\n\tconst QRTR = HALF >> 1;\r\n\tconst MASK = FULL - 1;\r\n\r\n\t// fill register\r\n\tlet register = 0;\r\n\tfor (let i = 0; i < N; i++) register = (register << 1) | read_bit();\r\n\r\n\tlet symbols = [];\r\n\tlet low = 0;\r\n\tlet range = FULL; // treat like a float\r\n\twhile (true) {\r\n\t\tlet value = Math.floor((((register - low + 1) * total) - 1) / range);\r\n\t\tlet start = 0;\r\n\t\tlet end = symbol_count;\r\n\t\twhile (end - start > 1) { // binary search\r\n\t\t\tlet mid = (start + end) >>> 1;\r\n\t\t\tif (value < acc[mid]) {\r\n\t\t\t\tend = mid;\r\n\t\t\t} else {\r\n\t\t\t\tstart = mid;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (start == 0) break; // first symbol is end mark\r\n\t\tsymbols.push(start);\r\n\t\tlet a = low + Math.floor(range * acc[start] / total);\r\n\t\tlet b = low + Math.floor(range * acc[start+1] / total) - 1;\r\n\t\twhile (((a ^ b) & HALF) == 0) {\r\n\t\t\tregister = (register << 1) & MASK | read_bit();\r\n\t\t\ta = (a << 1) & MASK;\r\n\t\t\tb = (b << 1) & MASK | 1;\r\n\t\t}\r\n\t\twhile (a & ~b & QRTR) {\r\n\t\t\tregister = (register & HALF) | ((register << 1) & (MASK >>> 1)) | read_bit();\r\n\t\t\ta = (a << 1) ^ HALF;\r\n\t\t\tb = ((b ^ HALF) << 1) | HALF | 1;\r\n\t\t}\r\n\t\tlow = a;\r\n\t\trange = 1 + b - a;\r\n\t}\r\n\tlet offset = symbol_count - 4;\r\n\treturn symbols.map(x => { // index into payload\r\n\t\tswitch (x - offset) {\r\n\t\t\tcase 3: return offset + 0x10100 + ((bytes[pos_payload++] << 16) | (bytes[pos_payload++] << 8) | bytes[pos_payload++]);\r\n\t\t\tcase 2: return offset + 0x100 + ((bytes[pos_payload++] << 8) | bytes[pos_payload++]);\r\n\t\t\tcase 1: return offset + bytes[pos_payload++];\r\n\t\t\tdefault: return x - 1;\r\n\t\t}\r\n\t});\r\n}\t\r\n\r\n// returns an iterator which returns the next symbol\r\nfunction read_payload(v) {\r\n\tlet pos = 0;\r\n\treturn () => v[pos++];\r\n}\r\nfunction read_compressed_payload(s) {\r\n\treturn read_payload(decode_arithmetic(unsafe_atob(s)));\r\n}\r\n\r\n// unsafe in the sense:\r\n// expected well-formed Base64 w/o padding \r\n// 20220922: added for https://github.com/adraffy/ens-normalize.js/issues/4\r\nfunction unsafe_atob(s) {\r\n\tlet lookup = [];\r\n\t[...'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'].forEach((c, i) => lookup[c.charCodeAt(0)] = i);\r\n\tlet n = s.length;\r\n\tlet ret = new Uint8Array((6 * n) >> 3);\r\n\tfor (let i = 0, pos = 0, width = 0, carry = 0; i < n; i++) {\r\n\t\tcarry = (carry << 6) | lookup[s.charCodeAt(i)];\r\n\t\twidth += 6;\r\n\t\tif (width >= 8) {\r\n\t\t\tret[pos++] = (carry >> (width -= 8));\r\n\t\t}\r\n\t}\r\n\treturn ret;\r\n}\r\n\r\n// eg. [0,1,2,3...] => [0,-1,1,-2,...]\r\nfunction signed(i) { \r\n\treturn (i & 1) ? (~i >> 1) : (i >> 1);\r\n}\r\n\r\nfunction read_deltas(n, next) {\r\n\tlet v = Array(n);\r\n\tfor (let i = 0, x = 0; i < n; i++) v[i] = x += signed(next());\r\n\treturn v;\r\n}\r\n\r\n// [123][5] => [0 3] [1 1] [0 0]\r\nfunction read_sorted(next, prev = 0) {\r\n\tlet ret = [];\r\n\twhile (true) {\r\n\t\tlet x = next();\r\n\t\tlet n = next();\r\n\t\tif (!n) break;\r\n\t\tprev += x;\r\n\t\tfor (let i = 0; i < n; i++) {\r\n\t\t\tret.push(prev + i);\r\n\t\t}\r\n\t\tprev += n + 1;\r\n\t}\r\n\treturn ret;\r\n}\r\n\r\nfunction read_sorted_arrays(next) {\r\n\treturn read_array_while(() => { \r\n\t\tlet v = read_sorted(next);\r\n\t\tif (v.length) return v;\r\n\t});\r\n}\r\n\r\n// returns map of x => ys\r\nfunction read_mapped(next) {\r\n\tlet ret = [];\r\n\twhile (true) {\r\n\t\tlet w = next();\r\n\t\tif (w == 0) break;\r\n\t\tret.push(read_linear_table(w, next));\r\n\t}\r\n\twhile (true) {\r\n\t\tlet w = next() - 1;\r\n\t\tif (w < 0) break;\r\n\t\tret.push(read_replacement_table(w, next));\r\n\t}\r\n\treturn ret.flat();\r\n}\r\n\r\n// read until next is falsy\r\n// return array of read values\r\nfunction read_array_while(next) {\r\n\tlet v = [];\r\n\twhile (true) {\r\n\t\tlet x = next(v.length);\r\n\t\tif (!x) break;\r\n\t\tv.push(x);\r\n\t}\r\n\treturn v;\r\n}\r\n\r\n// read w columns of length n\r\n// return as n rows of length w\r\nfunction read_transposed(n, w, next) {\r\n\tlet m = Array(n).fill().map(() => []);\r\n\tfor (let i = 0; i < w; i++) {\r\n\t\tread_deltas(n, next).forEach((x, j) => m[j].push(x));\r\n\t}\r\n\treturn m;\r\n}\r\n \r\n// returns [[x, ys], [x+dx, ys+dy], [x+2*dx, ys+2*dy], ...]\r\n// where dx/dy = steps, n = run size, w = length of y\r\nfunction read_linear_table(w, next) {\r\n\tlet dx = 1 + next();\r\n\tlet dy = next();\r\n\tlet vN = read_array_while(next);\r\n\tlet m = read_transposed(vN.length, 1+w, next);\r\n\treturn m.flatMap((v, i) => {\r\n\t\tlet [x, ...ys] = v;\r\n\t\treturn Array(vN[i]).fill().map((_, j) => {\r\n\t\t\tlet j_dy = j * dy;\r\n\t\t\treturn [x + j * dx, ys.map(y => y + j_dy)];\r\n\t\t});\r\n\t});\r\n}\r\n\r\n// return [[x, ys...], ...]\r\n// where w = length of y\r\nfunction read_replacement_table(w, next) { \r\n\tlet n = 1 + next();\r\n\tlet m = read_transposed(n, 1+w, next);\r\n\treturn m.map(v => [v[0], v.slice(1)]);\r\n}\r\n\r\n\r\nfunction read_trie(next) {\r\n\tlet ret = [];\r\n\tlet sorted = read_sorted(next); \r\n\texpand(decode([]), []);\r\n\treturn ret; // not sorted\r\n\tfunction decode(Q) { // characters that lead into this node\r\n\t\tlet S = next(); // state: valid, save, check\r\n\t\tlet B = read_array_while(() => { // buckets leading to new nodes\r\n\t\t\tlet cps = read_sorted(next).map(i => sorted[i]);\r\n\t\t\tif (cps.length) return decode(cps);\r\n\t\t});\r\n\t\treturn {S, B, Q};\r\n\t}\r\n\tfunction expand({S, B}, cps, saved) {\r\n\t\tif (S & 4 && saved === cps[cps.length-1]) return;\r\n\t\tif (S & 2) saved = cps[cps.length-1];\r\n\t\tif (S & 1) ret.push(cps); \r\n\t\tfor (let br of B) {\r\n\t\t\tfor (let cp of br.Q) {\r\n\t\t\t\texpand(br, [...cps, cp], saved);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\n\nfunction hex_cp(cp) {\r\n\treturn cp.toString(16).toUpperCase().padStart(2, '0');\r\n}\r\n\r\nfunction quote_cp(cp) {\r\n\treturn `{${hex_cp(cp)}}`; // raffy convention: like \"\\u{X}\" w/o the \"\\u\"\r\n}\r\n\r\n/*\r\nexport function explode_cp(s) {\r\n\treturn [...s].map(c => c.codePointAt(0));\r\n}\r\n*/\r\nfunction explode_cp(s) { // this is about 2x faster\r\n\tlet cps = [];\r\n\tfor (let pos = 0, len = s.length; pos < len; ) {\r\n\t\tlet cp = s.codePointAt(pos);\r\n\t\tpos += cp < 0x10000 ? 1 : 2;\r\n\t\tcps.push(cp);\r\n\t}\r\n\treturn cps;\r\n}\r\n\r\nfunction str_from_cps(cps) {\r\n\tconst chunk = 4096;\r\n\tlet len = cps.length;\r\n\tif (len < chunk) return String.fromCodePoint(...cps);\r\n\tlet buf = [];\r\n\tfor (let i = 0; i < len; ) {\r\n\t\tbuf.push(String.fromCodePoint(...cps.slice(i, i += chunk)));\r\n\t}\r\n\treturn buf.join('');\r\n}\r\n\r\nfunction compare_arrays(a, b) {\r\n\tlet n = a.length;\r\n\tlet c = n - b.length;\r\n\tfor (let i = 0; c == 0 && i < n; i++) c = a[i] - b[i];\r\n\treturn c;\r\n}\r\n\r\nfunction array_replace(v, a, b) {\r\n\tlet prev = 0;\r\n\twhile (true) {\r\n\t\tlet next = v.indexOf(a, prev);\r\n\t\tif (next < 0) break;\r\n\t\tv[next] = b; \r\n\t\tprev = next + 1;\r\n\t}\r\n}\n\n// created 2025-09-14T17:56:24.099Z\n// compressed base64-encoded blob for include-nf data\n// source: https://github.com/adraffy/ens-normalize.js/blob/main/src/make.js\n// see: https://github.com/adraffy/ens-normalize.js#security\n// SHA-256: 9ef43cc7215aa7a53e4ed9afa3b4f2f8ce00a2c708b9eb96aa409ae6fa3fb6af\nvar COMPRESSED = 'AEUDWAHSCGYATwDVADIAdgAiADQAFAAtABQAIQAPACcADQASAAsAGQAJABIACQARAAUACwAFAAwABQAQAAMABwAEAAoABQAJAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACwANAA0AAwAKAAkABAAdAAYAZwDTAecDNACxCmIB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgPi89uj00MsvBXxEPAGPCDwBnQKoEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJEMAJpIBpob5AERSMAKNoAXqaQLRBMCzEiC+AZ4EWRJJFbEu7QDQLARtEbgECxDwAb/RyAk1AV4nD2cEQQKTAzsAGpobPgAahAGPCrysdy0OAKwAfFIcBAQFUmoA/PtZADkBIadVj2UMUgx5Il4ANQC9vLIBDAHUGVsQ8wCzfQIbGVcCHBZHAZ8CBAgXOhG7AqMZ4M7+1M0UAPDNAWsC+mcJDe8AAQA99zkEXLICyQozAo6lAobcP5JvjQLFzwKD9gU/OD8FEQCtEQL6bW+nAKUEvzjDHsuRyUvOFHcacUz5AqIFRSE2kzsBEQCuaQL5DQTlcgO6twSpTiUgCwIFCAUXBHQEqQV6swAVxUlmTmsCwjqsP/wKJQmXb793UgZBEBsn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UNzpOxVdrwRPvlh1aIOf0xFEqD3YkGnCnFah/cFN3J2gB7N+bZSGawwkKFu1tpQMrp1W+27YNkyT0TpcFpTqgOqqLabrgcCUPxh97mREOGy4xItzQ9xSl6rq+8BZsHcrQFReS+QeMxJ3P6CnL9EP/eOLDjumLhvrcQrpPiknsofbzBv9gTP0lU+TIVwE6E7CcKfT36q+ZiEOHJ9ayf0dyUJLezAb2M8aNHwd0+OJmsVgTzRWA';\n\n// https://unicode.org/reports/tr15/\r\n// for reference implementation\r\n// see: /derive/nf.js\r\n\r\n\r\n// algorithmic hangul\r\n// https://www.unicode.org/versions/Unicode15.0.0/ch03.pdf (page 144)\r\nconst S0 = 0xAC00;\r\nconst L0 = 0x1100;\r\nconst V0 = 0x1161;\r\nconst T0 = 0x11A7;\r\nconst L_COUNT = 19;\r\nconst V_COUNT = 21;\r\nconst T_COUNT = 28;\r\nconst N_COUNT = V_COUNT * T_COUNT;\r\nconst S_COUNT = L_COUNT * N_COUNT;\r\nconst S1 = S0 + S_COUNT;\r\nconst L1 = L0 + L_COUNT;\r\nconst V1 = V0 + V_COUNT;\r\nconst T1 = T0 + T_COUNT;\r\n\r\nfunction unpack_cc(packed) {\r\n\treturn (packed >> 24) & 0xFF;\r\n}\r\nfunction unpack_cp(packed) {\r\n\treturn packed & 0xFFFFFF;\r\n}\r\n\r\nlet SHIFTED_RANK, EXCLUSIONS, DECOMP, RECOMP;\r\n\r\n// export function nf_deinit() {\r\n// \tif (!SHIFTED_RANK) return;\r\n// \tSHIFTED_RANK = EXCLUSIONS = DECOMP = RECOMP = undefined;\r\n// }\r\n\r\nfunction init$1() {\r\n\t//console.time('nf');\r\n\tlet r = read_compressed_payload(COMPRESSED);\r\n\tSHIFTED_RANK = new Map(read_sorted_arrays(r).flatMap((v, i) => v.map(x => [x, (i+1) << 24]))); // pre-shifted\r\n\tEXCLUSIONS = new Set(read_sorted(r));\r\n\tDECOMP = new Map();\r\n\tRECOMP = new Map();\r\n\tfor (let [cp, cps] of read_mapped(r)) {\r\n\t\tif (!EXCLUSIONS.has(cp) && cps.length == 2) {\r\n\t\t\tlet [a, b] = cps;\r\n\t\t\tlet bucket = RECOMP.get(a);\r\n\t\t\tif (!bucket) {\r\n\t\t\t\tbucket = new Map();\r\n\t\t\t\tRECOMP.set(a, bucket);\r\n\t\t\t}\r\n\t\t\tbucket.set(b, cp);\r\n\t\t}\r\n\t\tDECOMP.set(cp, cps.reverse()); // stored reversed\r\n\t}\r\n\t//console.timeEnd('nf');\r\n\t// 20230905: 11ms\r\n}\r\n\r\nfunction is_hangul(cp) {\r\n\treturn cp >= S0 && cp < S1;\r\n}\r\n\r\nfunction compose_pair(a, b) {\r\n\tif (a >= L0 && a < L1 && b >= V0 && b < V1) {\r\n\t\treturn S0 + (a - L0) * N_COUNT + (b - V0) * T_COUNT;\r\n\t} else if (is_hangul(a) && b > T0 && b < T1 && (a - S0) % T_COUNT == 0) {\r\n\t\treturn a + (b - T0);\r\n\t} else {\r\n\t\tlet recomp = RECOMP.get(a);\r\n\t\tif (recomp) {\r\n\t\t\trecomp = recomp.get(b);\r\n\t\t\tif (recomp) {\r\n\t\t\t\treturn recomp;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn -1;\r\n\t}\r\n}\r\n\r\nfunction decomposed(cps) {\r\n\tif (!SHIFTED_RANK) init$1();\r\n\tlet ret = [];\r\n\tlet buf = [];\r\n\tlet check_order = false;\r\n\tfunction add(cp) {\r\n\t\tlet cc = SHIFTED_RANK.get(cp);\r\n\t\tif (cc) {\r\n\t\t\tcheck_order = true;\r\n\t\t\tcp |= cc;\r\n\t\t}\r\n\t\tret.push(cp);\r\n\t}\r\n\tfor (let cp of cps) {\r\n\t\twhile (true) {\r\n\t\t\tif (cp < 0x80) {\r\n\t\t\t\tret.push(cp);\r\n\t\t\t} else if (is_hangul(cp)) {\r\n\t\t\t\tlet s_index = cp - S0;\r\n\t\t\t\tlet l_index = s_index / N_COUNT | 0;\r\n\t\t\t\tlet v_index = (s_index % N_COUNT) / T_COUNT | 0;\r\n\t\t\t\tlet t_index = s_index % T_COUNT;\r\n\t\t\t\tadd(L0 + l_index);\r\n\t\t\t\tadd(V0 + v_index);\r\n\t\t\t\tif (t_index > 0) add(T0 + t_index);\r\n\t\t\t} else {\r\n\t\t\t\tlet mapped = DECOMP.get(cp);\r\n\t\t\t\tif (mapped) {\r\n\t\t\t\t\tbuf.push(...mapped);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tadd(cp);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!buf.length) break;\r\n\t\t\tcp = buf.pop();\r\n\t\t}\r\n\t}\r\n\tif (check_order && ret.length > 1) {\r\n\t\tlet prev_cc = unpack_cc(ret[0]);\r\n\t\tfor (let i = 1; i < ret.length; i++) {\r\n\t\t\tlet cc = unpack_cc(ret[i]);\r\n\t\t\tif (cc == 0 || prev_cc <= cc) {\r\n\t\t\t\tprev_cc = cc;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tlet j = i-1;\r\n\t\t\twhile (true) {\r\n\t\t\t\tlet tmp = ret[j+1];\r\n\t\t\t\tret[j+1] = ret[j];\r\n\t\t\t\tret[j] = tmp;\r\n\t\t\t\tif (!j) break;\r\n\t\t\t\tprev_cc = unpack_cc(ret[--j]);\r\n\t\t\t\tif (prev_cc <= cc) break;\r\n\t\t\t}\r\n\t\t\tprev_cc = unpack_cc(ret[i]);\r\n\t\t}\r\n\t}\r\n\treturn ret;\r\n}\r\n\r\nfunction composed_from_decomposed(v) {\r\n\tlet ret = [];\r\n\tlet stack = [];\r\n\tlet prev_cp = -1;\r\n\tlet prev_cc = 0;\r\n\tfor (let packed of v) {\r\n\t\tlet cc = unpack_cc(packed);\r\n\t\tlet cp = unpack_cp(packed);\r\n\t\tif (prev_cp == -1) {\r\n\t\t\tif (cc == 0) {\r\n\t\t\t\tprev_cp = cp;\r\n\t\t\t} else {\r\n\t\t\t\tret.push(cp);\r\n\t\t\t}\r\n\t\t} else if (prev_cc > 0 && prev_cc >= cc) {\r\n\t\t\tif (cc == 0) {\r\n\t\t\t\tret.push(prev_cp, ...stack);\r\n\t\t\t\tstack.length = 0;\r\n\t\t\t\tprev_cp = cp;\r\n\t\t\t} else {\r\n\t\t\t\tstack.push(cp);\r\n\t\t\t}\r\n\t\t\tprev_cc = cc;\r\n\t\t} else {\r\n\t\t\tlet composed = compose_pair(prev_cp, cp);\r\n\t\t\tif (composed >= 0) {\r\n\t\t\t\tprev_cp = composed;\r\n\t\t\t} else if (prev_cc == 0 && cc == 0) {\r\n\t\t\t\tret.push(prev_cp);\r\n\t\t\t\tprev_cp = cp;\r\n\t\t\t} else {\r\n\t\t\t\tstack.push(cp);\r\n\t\t\t\tprev_cc = cc;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (prev_cp >= 0) {\r\n\t\tret.push(prev_cp, ...stack);\t\r\n\t}\r\n\treturn ret;\r\n}\r\n\r\n// note: cps can be iterable\r\nfunction nfd(cps) {\r\n\treturn decomposed(cps).map(unpack_cp);\r\n}\r\nfunction nfc(cps) {\r\n\treturn composed_from_decomposed(decomposed(cps));\r\n}\n\nconst HYPHEN = 0x2D;\r\nconst STOP = 0x2E;\r\nconst STOP_CH = '.';\r\nconst FE0F = 0xFE0F;\r\nconst UNIQUE_PH = 1;\r\n\r\n// 20230913: replace [...v] with Array_from(v) to avoid large spreads\r\nconst Array_from = x => Array.from(x); // Array.from.bind(Array);\r\n\r\nfunction group_has_cp(g, cp) {\r\n\t// 20230913: keep primary and secondary distinct instead of creating valid union\r\n\treturn g.P.has(cp) || g.Q.has(cp);\r\n}\r\n\r\nclass Emoji extends Array {\r\n\tget is_emoji() { return true; } // free tagging system\r\n}\r\n\r\nlet MAPPED, IGNORED, CM, NSM, ESCAPE, NFC_CHECK, GROUPS, WHOLE_VALID, WHOLE_MAP, VALID, EMOJI_LIST, EMOJI_ROOT;\r\n\r\n// export function ens_deinit() {\r\n// \tnf_deinit();\r\n// \tif (!MAPPED) return;\r\n// \tMAPPED = IGNORED = CM = NSM = ESCAPE = NFC_CHECK = GROUPS = WHOLE_VALID = WHOLE_MAP = VALID = EMOJI_LIST = EMOJI_ROOT = undefined;\r\n// }\r\n\r\nfunction init() {\r\n\tif (MAPPED) return;\r\n\t\r\n\tlet r = read_compressed_payload(COMPRESSED$1);\r\n\tconst read_sorted_array = () => read_sorted(r);\r\n\tconst read_sorted_set = () => new Set(read_sorted_array());\r\n\tconst set_add_many = (set, v) => v.forEach(x => set.add(x));\r\n\r\n\tMAPPED = new Map(read_mapped(r)); \r\n\tIGNORED = read_sorted_set(); // ignored characters are not valid, so just read raw codepoints\r\n\r\n\t/*\r\n\t// direct include from payload is smaller than the decompression code\r\n\tconst FENCED = new Map(read_array_while(() => {\r\n\t\tlet cp = r();\r\n\t\tif (cp) return [cp, read_str(r())];\r\n\t}));\r\n\t*/\r\n\t// 20230217: we still need all CM for proper error formatting\r\n\t// but norm only needs NSM subset that are potentially-valid\r\n\tCM = read_sorted_array();\r\n\tNSM = new Set(read_sorted_array().map(i => CM[i]));\r\n\tCM = new Set(CM);\r\n\t\r\n\tESCAPE = read_sorted_set(); // characters that should not be printed\r\n\tNFC_CHECK = read_sorted_set(); // only needed to illustrate ens_tokenize() transformations\r\n\r\n\tlet chunks = read_sorted_arrays(r);\r\n\tlet unrestricted = r();\r\n\t//const read_chunked = () => new Set(read_sorted_array().flatMap(i => chunks[i]).concat(read_sorted_array()));\r\n\tconst read_chunked = () => {\r\n\t\t// 20230921: build set in parts, 2x faster\r\n\t\tlet set = new Set();\r\n\t\tread_sorted_array().forEach(i => set_add_many(set, chunks[i]));\r\n\t\tset_add_many(set, read_sorted_array());\r\n\t\treturn set; \r\n\t};\r\n\tGROUPS = read_array_while(i => {\r\n\t\t// minifier property mangling seems unsafe\r\n\t\t// so these are manually renamed to single chars\r\n\t\tlet N = read_array_while(r).map(x => x+0x60);\r\n\t\tif (N.length) {\r\n\t\t\tlet R = i >= unrestricted; // unrestricted then restricted\r\n\t\t\tN[0] -= 32; // capitalize\r\n\t\t\tN = str_from_cps(N);\r\n\t\t\tif (R) N=`Restricted[${N}]`;\r\n\t\t\tlet P = read_chunked(); // primary\r\n\t\t\tlet Q = read_chunked(); // secondary\r\n\t\t\tlet M = !r(); // not-whitelisted, check for NSM\r\n\t\t\t// *** this code currently isn't needed ***\r\n\t\t\t/*\r\n\t\t\tlet V = [...P, ...Q].sort((a, b) => a-b); // derive: sorted valid\r\n\t\t\tlet M = r()-1; // number of combining mark\r\n\t\t\tif (M < 0) { // whitelisted\r\n\t\t\t\tM = new Map(read_array_while(() => {\r\n\t\t\t\t\tlet i = r();\r\n\t\t\t\t\tif (i) return [V[i-1], read_array_while(() => {\r\n\t\t\t\t\t\tlet v = read_array_while(r);\r\n\t\t\t\t\t\tif (v.length) return v.map(x => x-1);\r\n\t\t\t\t\t})];\r\n\t\t\t\t}));\r\n\t\t\t}*/\r\n\t\t\treturn {N, P, Q, M, R};\r\n\t\t}\r\n\t});\r\n\r\n\t// decode compressed wholes\r\n\tWHOLE_VALID = read_sorted_set();\r\n\tWHOLE_MAP = new Map();\r\n\tlet wholes = read_sorted_array().concat(Array_from(WHOLE_VALID)).sort((a, b) => a-b); // must be sorted\r\n\twholes.forEach((cp, i) => {\r\n\t\tlet d = r(); \r\n\t\tlet w = wholes[i] = d ? wholes[i-d] : {V: [], M: new Map()};\r\n\t\tw.V.push(cp); // add to member set\r\n\t\tif (!WHOLE_VALID.has(cp)) {\r\n\t\t\tWHOLE_MAP.set(cp, w); // register with whole map\r\n\t\t}\r\n\t});\r\n\r\n\t// compute confusable-extent complements\r\n\t// usage: WHOLE_MAP.get(cp).M.get(cp) = complement set\r\n\tfor (let {V, M} of new Set(WHOLE_MAP.values())) {\r\n\t\t// connect all groups that have each whole character\r\n\t\tlet recs = [];\r\n\t\tfor (let cp of V) {\r\n\t\t\tlet gs = GROUPS.filter(g => group_has_cp(g, cp));\r\n\t\t\tlet rec = recs.find(({G}) => gs.some(g => G.has(g)));\r\n\t\t\tif (!rec) {\r\n\t\t\t\trec = {G: new Set(), V: []};\r\n\t\t\t\trecs.push(rec);\r\n\t\t\t}\r\n\t\t\trec.V.push(cp);\r\n\t\t\tset_add_many(rec.G, gs);\r\n\t\t}\r\n\t\t// per character cache groups which are not a member of the extent\r\n\t\tlet union = recs.flatMap(x => Array_from(x.G)); // all of the groups used by this whole\r\n\t\tfor (let {G, V} of recs) {\r\n\t\t\tlet complement = new Set(union.filter(g => !G.has(g))); // groups not covered by the extent\r\n\t\t\tfor (let cp of V) {\r\n\t\t\t\tM.set(cp, complement); // this is the same reference\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// compute valid set\r\n\t// 20230924: VALID was union but can be re-used\r\n\tVALID = new Set(); // exists in 1+ groups\r\n\tlet multi = new Set(); // exists in 2+ groups\r\n\tconst add_to_union = cp => VALID.has(cp) ? multi.add(cp) : VALID.add(cp);\r\n\tfor (let g of GROUPS) {\r\n\t\tfor (let cp of g.P) add_to_union(cp);\r\n\t\tfor (let cp of g.Q) add_to_union(cp);\r\n\t}\r\n\t// dual purpose WHOLE_MAP: return placeholder if unique non-confusable\r\n\tfor (let cp of VALID) {\r\n\t\tif (!WHOLE_MAP.has(cp) && !multi.has(cp)) {\r\n\t\t\tWHOLE_MAP.set(cp, UNIQUE_PH);\r\n\t\t}\r\n\t}\r\n\t// add all decomposed parts\r\n\t// see derive: \"Valid is Closed (via Brute-force)\"\r\n\tset_add_many(VALID, nfd(VALID));\r\n\t\r\n\t// decode emoji\r\n\t// 20230719: emoji are now fully-expanded to avoid quirk logic \r\n\tEMOJI_LIST = read_trie(r).map(v => Emoji.from(v)).sort(compare_arrays);\r\n\tEMOJI_ROOT = new Map(); // this has approx 7K nodes (2+ per emoji)\r\n\tfor (let cps of EMOJI_LIST) {\r\n\t\t// 20230719: change to *slightly* stricter algorithm which disallows \r\n\t\t// insertion of misplaced FE0F in emoji sequences (matching ENSIP-15)\r\n\t\t// example: beautified [A B] (eg. flag emoji) \r\n\t\t// before: allow: [A FE0F B], error: [A FE0F FE0F B] \r\n\t\t// after: error: both\r\n\t\t// note: this code now matches ENSNormalize.{cs,java} logic\r\n\t\tlet prev = [EMOJI_ROOT];\r\n\t\tfor (let cp of cps) {\r\n\t\t\tlet next = prev.map(node => {\r\n\t\t\t\tlet child = node.get(cp);\r\n\t\t\t\tif (!child) {\r\n\t\t\t\t\t// should this be object? \r\n\t\t\t\t\t// (most have 1-2 items, few have many)\r\n\t\t\t\t\t// 20230719: no, v8 default map is 4?\r\n\t\t\t\t\tchild = new Map();\r\n\t\t\t\t\tnode.set(cp, child);\r\n\t\t\t\t}\r\n\t\t\t\treturn child;\r\n\t\t\t});\r\n\t\t\tif (cp === FE0F) {\r\n\t\t\t\tprev.push(...next); // less than 20 elements\r\n\t\t\t} else {\r\n\t\t\t\tprev = next;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (let x of prev) {\r\n\t\t\tx.V = cps;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n// if escaped: {HEX}\r\n// else: \"x\" {HEX}\r\nfunction quoted_cp(cp) {\r\n\treturn (should_escape(cp) ? '' : `${bidi_qq(safe_str_from_cps([cp]))} `) + quote_cp(cp);\r\n}\r\n\r\n// 20230211: some messages can be mixed-directional and result in spillover\r\n// use 200E after a quoted string to force the remainder of a string from \r\n// acquring the direction of the quote\r\n// https://www.w3.org/International/questions/qa-bidi-unicode-controls#exceptions\r\nfunction bidi_qq(s) {\r\n\treturn `\"${s}\"\\u200E`; // strong LTR\r\n}\r\n\r\nfunction check_label_extension(cps) {\r\n\tif (cps.length >= 4 && cps[2] == HYPHEN && cps[3] == HYPHEN) {\r\n\t\tthrow new Error(`invalid label extension: \"${str_from_cps(cps.slice(0, 4))}\"`); // this can only be ascii so cant be bidi\r\n\t}\r\n}\r\nfunction check_leading_underscore(cps) {\r\n\tconst UNDERSCORE = 0x5F;\r\n\tfor (let i = cps.lastIndexOf(UNDERSCORE); i > 0; ) {\r\n\t\tif (cps[--i] !== UNDERSCORE) {\r\n\t\t\tthrow new Error('underscore allowed only at start');\r\n\t\t}\r\n\t}\r\n}\r\n// check that a fenced cp is not leading, trailing, or touching another fenced cp\r\nfunction check_fenced(cps) {\r\n\tlet cp = cps[0];\r\n\tlet prev = FENCED.get(cp);\r\n\tif (prev) throw error_placement(`leading ${prev}`);\r\n\tlet n = cps.length;\r\n\tlet last = -1; // prevents trailing from throwing\r\n\tfor (let i = 1; i < n; i++) {\r\n\t\tcp = cps[i];\r\n\t\tlet match = FENCED.get(cp);\r\n\t\tif (match) {\r\n\t\t\t// since cps[0] isn't fenced, cps[1] cannot throw\r\n\t\t\tif (last == i) throw error_placement(`${prev} + ${match}`);\r\n\t\t\tlast = i + 1;\r\n\t\t\tprev = match;\r\n\t\t}\r\n\t}\r\n\tif (last == n) throw error_placement(`trailing ${prev}`);\r\n}\r\n\r\n// create a safe to print string \r\n// invisibles are escaped\r\n// leading cm uses placeholder\r\n// if cps exceed max, middle truncate with ellipsis\r\n// quoter(cp) => string, eg. 3000 => \"{3000}\"\r\n// note: in html, you'd call this function then replace [<>&] with entities\r\nfunction safe_str_from_cps(cps, max = Infinity, quoter = quote_cp) {\r\n\t//if (Number.isInteger(cps)) cps = [cps];\r\n\t//if (!Array.isArray(cps)) throw new TypeError(`expected codepoints`);\r\n\tlet buf = [];\r\n\tif (is_combining_mark(cps[0])) buf.push('◌');\r\n\tif (cps.length > max) {\r\n\t\tmax >>= 1;\r\n\t\tcps = [...cps.slice(0, max), 0x2026, ...cps.slice(-max)];\r\n\t}\r\n\tlet prev = 0;\r\n\tlet n = cps.length;\r\n\tfor (let i = 0; i < n; i++) {\r\n\t\tlet cp = cps[i];\r\n\t\tif (should_escape(cp)) {\r\n\t\t\tbuf.push(str_from_cps(cps.slice(prev, i)));\r\n\t\t\tbuf.push(quoter(cp));\r\n\t\t\tprev = i + 1;\r\n\t\t}\r\n\t}\r\n\tbuf.push(str_from_cps(cps.slice(prev, n)));\r\n\treturn buf.join('');\r\n}\r\n\r\n// note: set(s) cannot be exposed because they can be modified\r\n// note: Object.freeze() doesn't work\r\nfunction is_combining_mark(cp, only_nsm) { // 20240127: add extra argument\r\n\tinit();\r\n\treturn only_nsm ? NSM.has(cp) : CM.has(cp);\r\n}\r\nfunction should_escape(cp) {\r\n\tinit();\r\n\treturn ESCAPE.has(cp);\r\n}\r\n\r\n// return all supported emoji as fully-qualified emoji \r\n// ordered by length then lexicographic \r\nfunction ens_emoji() {\r\n\tinit();\r\n\treturn EMOJI_LIST.map(x => x.slice()); // emoji are exposed so copy\r\n}\r\n\r\nfunction ens_normalize_fragment(frag, decompose) {\r\n\tinit();\r\n\tlet nf = decompose ? nfd : nfc;\r\n\treturn frag.split(STOP_CH).map(label => str_from_cps(tokens_from_str(explode_cp(label), nf, filter_fe0f).flat())).join(STOP_CH);\r\n}\r\n\r\nfunction ens_normalize(name) {\r\n\treturn flatten(split(name, nfc, filter_fe0f));\r\n}\r\n\r\nfunction ens_beautify(name) {\r\n\tlet labels = split(name, nfc, x => x); // emoji not exposed\r\n\tfor (let {type, output, error} of labels) {\r\n\t\tif (error) break; // flatten will throw\r\n\r\n\t\t// replace leading/trailing hyphen\r\n\t\t// 20230121: consider beautifing all or leading/trailing hyphen to unicode variant\r\n\t\t// not exactly the same in every font, but very similar: \"-\" vs \"‐\"\r\n\t\t/*\r\n\t\tconst UNICODE_HYPHEN = 0x2010;\r\n\t\t// maybe this should replace all for visual consistancy?\r\n\t\t// `node tools/reg-count.js regex ^-\\{2,\\}` => 592\r\n\t\t//for (let i = 0; i < output.length; i++) if (output[i] == 0x2D) output[i] = 0x2010;\r\n\t\tif (output[0] == HYPHEN) output[0] = UNICODE_HYPHEN;\r\n\t\tlet end = output.length-1;\r\n\t\tif (output[end] == HYPHEN) output[end] = UNICODE_HYPHEN;\r\n\t\t*/\r\n\t\t// 20230123: WHATWG URL uses \"CheckHyphens\" false\r\n\t\t// https://url.spec.whatwg.org/#idna\r\n\r\n\t\t// update ethereum symbol\r\n\t\t// ξ => Ξ if not greek\r\n\t\tif (type !== 'Greek') array_replace(output, 0x3BE, 0x39E);\r\n\r\n\t\t// 20221213: fixes bidi subdomain issue, but breaks invariant (200E is disallowed)\r\n\t\t// could be fixed with special case for: 2D (.) + 200E (LTR)\r\n\t\t// https://discuss.ens.domains/t/bidi-label-ordering-spoof/15824\r\n\t\t//output.splice(0, 0, 0x200E);\r\n\t}\r\n\treturn flatten(labels);\r\n}\r\n\r\nfunction ens_split(name, preserve_emoji) {\r\n\treturn split(name, nfc, preserve_emoji ? x => x.slice() : filter_fe0f); // emoji are exposed so copy\r\n}\r\n\r\nfunction split(name, nf, ef) {\r\n\tif (!name) return []; // 20230719: empty name allowance\r\n\tinit();\r\n\tlet offset = 0;\r\n\t// https://unicode.org/reports/tr46/#Validity_Criteria\r\n\t// 4.) \"The label must not contain a U+002E ( . ) FULL STOP.\"\r\n\treturn name.split(STOP_CH).map(label => {\r\n\t\tlet input = explode_cp(label);\r\n\t\tlet info = {\r\n\t\t\tinput,\r\n\t\t\toffset, // codepoint, not substring!\r\n\t\t};\r\n\t\toffset += input.length + 1; // + stop\r\n\t\ttry {\r\n\t\t\t// 1.) \"The label must be in Unicode Normalization Form NFC\"\r\n\t\t\tlet tokens = info.tokens = tokens_from_str(input, nf, ef);\r\n\t\t\tlet token_count = tokens.length;\r\n\t\t\tlet type;\r\n\t\t\tif (!token_count) { // the label was effectively empty (could of had ignored characters)\r\n\t\t\t\t//norm = [];\r\n\t\t\t\t//type = 'None'; // use this instead of next match, \"ASCII\"\r\n\t\t\t\t// 20230120: change to strict\r\n\t\t\t\t// https://discuss.ens.domains/t/ens-name-normalization-2nd/14564/59\r\n\t\t\t\tthrow new Error(`empty label`);\r\n\t\t\t} \r\n\t\t\tlet norm = info.output = tokens.flat();\r\n\t\t\tcheck_leading_underscore(norm);\r\n\t\t\tlet emoji = info.emoji = token_count > 1 || tokens[0].is_emoji; // same as: tokens.some(x => x.is_emoji);\r\n\t\t\tif (!emoji && norm.every(cp => cp < 0x80)) { // special case for ascii\r\n\t\t\t\t// 20230123: matches matches WHATWG, see note 3.3\r\n\t\t\t\tcheck_label_extension(norm); // only needed for ascii\r\n\t\t\t\t// cant have fenced\r\n\t\t\t\t// cant have cm\r\n\t\t\t\t// cant have wholes\r\n\t\t\t\t// see derive: \"Fastpath ASCII\"\r\n\t\t\t\ttype = 'ASCII';\r\n\t\t\t} else {\r\n\t\t\t\tlet chars = tokens.flatMap(x => x.is_emoji ? [] : x); // all of the nfc tokens concat together\r\n\t\t\t\tif (!chars.length) { // theres no text, just emoji\r\n\t\t\t\t\ttype = 'Emoji';\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// 5.) \"The label must not begin with a combining mark, that is: General_Category=Mark.\"\r\n\t\t\t\t\tif (CM.has(norm[0])) throw error_placement('leading combining mark');\r\n\t\t\t\t\tfor (let i = 1; i < token_count; i++) { // we've already checked the first token\r\n\t\t\t\t\t\tlet cps = tokens[i];\r\n\t\t\t\t\t\tif (!cps.is_emoji && CM.has(cps[0])) { // every text token has emoji neighbors, eg. EtEEEtEt...\r\n\t\t\t\t\t\t\t// bidi_qq() not needed since emoji is LTR and cps is a CM\r\n\t\t\t\t\t\t\tthrow error_placement(`emoji + combining mark: \"${str_from_cps(tokens[i-1])} + ${safe_str_from_cps([cps[0]])}\"`); \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcheck_fenced(norm);\r\n\t\t\t\t\tlet unique = Array_from(new Set(chars));\r\n\t\t\t\t\tlet [g] = determine_group(unique); // take the first match\r\n\t\t\t\t\t// see derive: \"Matching Groups have Same CM Style\"\r\n\t\t\t\t\t// alternative: could form a hybrid type: Latin/Japanese/...\t\r\n\t\t\t\t\tcheck_group(g, chars); // need text in order\r\n\t\t\t\t\tcheck_whole(g, unique); // only need unique text (order would be required for multiple-char confusables)\r\n\t\t\t\t\ttype = g.N;\r\n\t\t\t\t\t// 20230121: consider exposing restricted flag\r\n\t\t\t\t\t// it's simpler to just check for 'Restricted'\r\n\t\t\t\t\t// or even better: type.endsWith(']')\r\n\t\t\t\t\t//if (g.R) info.restricted = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tinfo.type = type;\r\n\t\t} catch (err) {\r\n\t\t\tinfo.error = err; // use full error object\r\n\t\t}\r\n\t\treturn info;\r\n\t});\r\n}\r\n\r\nfunction check_whole(group, unique) {\r\n\tlet maker;\r\n\tlet shared = [];\r\n\tfor (let cp of unique) {\r\n\t\tlet whole = WHOLE_MAP.get(cp);\r\n\t\tif (whole === UNIQUE_PH) return; // unique, non-confusable\r\n\t\tif (whole) {\r\n\t\t\tlet set = whole.M.get(cp); // groups which have a character that look-like this character\r\n\t\t\tmaker = maker ? maker.filter(g => set.has(g)) : Array_from(set);\r\n\t\t\tif (!maker.length) return; // confusable intersection is empty\r\n\t\t} else {\r\n\t\t\tshared.push(cp); \r\n\t\t}\r\n\t}\r\n\tif (maker) {\r\n\t\t// we have 1+ confusable\r\n\t\t// check if any of the remaining groups\r\n\t\t// contain the shared characters too\r\n\t\tfor (let g of maker) {\r\n\t\t\tif (shared.every(cp => group_has_cp(g, cp))) {\r\n\t\t\t\tthrow new Error(`whole-script confusable: ${group.N}/${g.N}`);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n// assumption: unique.size > 0\r\n// returns list of matching groups\r\nfunction determine_group(unique) {\r\n\tlet groups = GROUPS;\r\n\tfor (let cp of unique) {\r\n\t\t// note: we need to dodge CM that are whitelisted\r\n\t\t// but that code isn't currently necessary\r\n\t\tlet gs = groups.filter(g => group_has_cp(g, cp));\r\n\t\tif (!gs.length) {\r\n\t\t\tif (!GROUPS.some(g => group_has_cp(g, cp))) { \r\n\t\t\t\t// the character was composed of valid parts\r\n\t\t\t\t// but it's NFC form is invalid\r\n\t\t\t\t// 20230716: change to more exact statement, see: ENSNormalize.{cs,java}\r\n\t\t\t\t// note: this doesn't have to be a composition\r\n\t\t\t\t// 20230720: change to full check\r\n\t\t\t\tthrow error_disallowed(cp); // this should be rare\r\n\t\t\t} else {\r\n\t\t\t\t// there is no group that contains all these characters\r\n\t\t\t\t// throw using the highest priority group that matched\r\n\t\t\t\t// https://www.unicode.org/reports/tr39/#mixed_script_confusables\r\n\t\t\t\tthrow error_group_member(groups[0], cp);\r\n\t\t\t}\r\n\t\t}\r\n\t\tgroups = gs;\r\n\t\tif (gs.length == 1) break; // there is only one group left\r\n\t}\r\n\t// there are at least 1 group(s) with all of these characters\r\n\treturn groups;\r\n}\r\n\r\n// throw on first error\r\nfunction flatten(split) {\r\n\treturn split.map(({input, error, output}) => {\r\n\t\tif (error) {\r\n\t\t\t// don't print label again if just a single label\r\n\t\t\tlet msg = error.message;\r\n\t\t\t// bidi_qq() only necessary if msg is digits\r\n\t\t\tthrow new Error(split.length == 1 ? msg : `Invalid label ${bidi_qq(safe_str_from_cps(input, 63))}: ${msg}`); \r\n\t\t}\r\n\t\treturn str_from_cps(output);\r\n\t}).join(STOP_CH);\r\n}\r\n\r\nfunction error_disallowed(cp) {\r\n\t// TODO: add cp to error?\r\n\treturn new Error(`disallowed character: ${quoted_cp(cp)}`); \r\n}\r\nfunction error_group_member(g, cp) {\r\n\tlet quoted = quoted_cp(cp);\r\n\tlet gg = GROUPS.find(g => g.P.has(cp)); // only check primary\r\n\tif (gg) {\r\n\t\tquoted = `${gg.N} ${quoted}`;\r\n\t}\r\n\treturn new Error(`illegal mixture: ${g.N} + ${quoted}`);\r\n}\r\nfunction error_placement(where) {\r\n\treturn new Error(`illegal placement: ${where}`);\r\n}\r\n\r\n// assumption: cps.length > 0\r\n// assumption: cps[0] isn't a CM\r\n// assumption: the previous character isn't an emoji\r\nfunction check_group(g, cps) {\r\n\tfor (let cp of cps) {\r\n\t\tif (!group_has_cp(g, cp)) {\r\n\t\t\t// for whitelisted scripts, this will throw illegal mixture on invalid cm, eg. \"e{300}{300}\"\r\n\t\t\t// at the moment, it's unnecessary to introduce an extra error type\r\n\t\t\t// until there exists a whitelisted multi-character\r\n\t\t\t// eg. if (M < 0 && is_combining_mark(cp)) { ... }\r\n\t\t\t// there are 3 cases:\r\n\t\t\t// 1. illegal cm for wrong group => mixture error\r\n\t\t\t// 2. illegal cm for same group => cm error\r\n\t\t\t// requires set of whitelist cm per group: \r\n\t\t\t// eg. new Set([...g.P, ...g.Q].flatMap(nfc).filter(cp => CM.has(cp)))\r\n\t\t\t// 3. wrong group => mixture error\r\n\t\t\tthrow error_group_member(g, cp);\r\n\t\t}\r\n\t}\r\n\t//if (M >= 0) { // we have a known fixed cm count\r\n\tif (g.M) { // we need to check for NSM\r\n\t\tlet decomposed = nfd(cps);\r\n\t\tfor (let i = 1, e = decomposed.length; i < e; i++) { // see: assumption\r\n\t\t\t// 20230210: bugfix: using cps instead of decomposed h/t Carbon225\r\n\t\t\t/*\r\n\t\t\tif (CM.has(decomposed[i])) {\r\n\t\t\t\tlet j = i + 1;\r\n\t\t\t\twhile (j < e && CM.has(decomposed[j])) j++;\r\n\t\t\t\tif (j - i > M) {\r\n\t\t\t\t\tthrow new Error(`too many combining marks: ${g.N} ${bidi_qq(str_from_cps(decomposed.slice(i-1, j)))} (${j-i}/${M})`);\r\n\t\t\t\t}\r\n\t\t\t\ti = j;\r\n\t\t\t}\r\n\t\t\t*/\r\n\t\t\t// 20230217: switch to NSM counting\r\n\t\t\t// https://www.unicode.org/reports/tr39/#Optional_Detection\r\n\t\t\tif (NSM.has(decomposed[i])) {\r\n\t\t\t\tlet j = i + 1;\r\n\t\t\t\tfor (let cp; j < e && NSM.has(cp = decomposed[j]); j++) {\r\n\t\t\t\t\t// a. Forbid sequences of the same nonspacing mark.\r\n\t\t\t\t\tfor (let k = i; k < j; k++) { // O(n^2) but n < 100\r\n\t\t\t\t\t\tif (decomposed[k] == cp) {\r\n\t\t\t\t\t\t\tthrow new Error(`duplicate non-spacing marks: ${quoted_cp(cp)}`);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// parse to end so we have full nsm count\r\n\t\t\t\t// b. Forbid sequences of more than 4 nonspacing marks (gc=Mn or gc=Me).\r\n\t\t\t\tif (j - i > NSM_MAX) {\r\n\t\t\t\t\t// note: this slice starts with a base char or spacing-mark cm\r\n\t\t\t\t\tthrow new Error(`excessive non-spacing marks: ${bidi_qq(safe_str_from_cps(decomposed.slice(i-1, j)))} (${j-i}/${NSM_MAX})`);\r\n\t\t\t\t}\r\n\t\t\t\ti = j;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t// *** this code currently isn't needed ***\r\n\t/*\r\n\tlet cm_whitelist = M instanceof Map;\r\n\tfor (let i = 0, e = cps.length; i < e; ) {\r\n\t\tlet cp = cps[i++];\r\n\t\tlet seqs = cm_whitelist && M.get(cp);\r\n\t\tif (seqs) { \r\n\t\t\t// list of codepoints that can follow\r\n\t\t\t// if this exists, this will always be 1+\r\n\t\t\tlet j = i;\r\n\t\t\twhile (j < e && CM.has(cps[j])) j++;\r\n\t\t\tlet cms = cps.slice(i, j);\r\n\t\t\tlet match = seqs.find(seq => !compare_arrays(seq, cms));\r\n\t\t\tif (!match) throw new Error(`disallowed combining mark sequence: \"${safe_str_from_cps([cp, ...cms])}\"`);\r\n\t\t\ti = j;\r\n\t\t} else if (!V.has(cp)) {\r\n\t\t\t// https://www.unicode.org/reports/tr39/#mixed_script_confusables\r\n\t\t\tlet quoted = quoted_cp(cp);\r\n\t\t\tfor (let cp of cps) {\r\n\t\t\t\tlet u = UNIQUE.get(cp);\r\n\t\t\t\tif (u && u !== g) {\r\n\t\t\t\t\t// if both scripts are restricted this error is confusing\r\n\t\t\t\t\t// because we don't differentiate RestrictedA from RestrictedB \r\n\t\t\t\t\tif (!u.R) quoted = `${quoted} is ${u.N}`;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthrow new Error(`disallowed ${g.N} character: ${quoted}`);\r\n\t\t\t//throw new Error(`disallowed character: ${quoted} (expected ${g.N})`);\r\n\t\t\t//throw new Error(`${g.N} does not allow: ${quoted}`);\r\n\t\t}\r\n\t}\r\n\tif (!cm_whitelist) {\r\n\t\tlet decomposed = nfd(cps);\r\n\t\tfor (let i = 1, e = decomposed.length; i < e; i++) { // we know it can't be cm leading\r\n\t\t\tif (CM.has(decomposed[i])) {\r\n\t\t\t\tlet j = i + 1;\r\n\t\t\t\twhile (j < e && CM.has(decomposed[j])) j++;\r\n\t\t\t\tif (j - i > M) {\r\n\t\t\t\t\tthrow new Error(`too many combining marks: \"${str_from_cps(decomposed.slice(i-1, j))}\" (${j-i}/${M})`);\r\n\t\t\t\t}\r\n\t\t\t\ti = j;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t*/\r\n}\r\n\r\n// given a list of codepoints\r\n// returns a list of lists, where emoji are a fully-qualified (as Array subclass)\r\n// eg. explode_cp(\"abc💩d\") => [[61, 62, 63], Emoji[1F4A9, FE0F], [64]]\r\n// 20230818: rename for 'process' name collision h/t Javarome\r\n// https://github.com/adraffy/ens-normalize.js/issues/23\r\nfunction tokens_from_str(input, nf, ef) {\r\n\tlet ret = [];\r\n\tlet chars = [];\r\n\tinput = input.slice().reverse(); // flip so we can pop\r\n\twhile (input.length) {\r\n\t\tlet emoji = consume_emoji_reversed(input);\r\n\t\tif (emoji) {\r\n\t\t\tif (chars.length) {\r\n\t\t\t\tret.push(nf(chars));\r\n\t\t\t\tchars = [];\r\n\t\t\t}\r\n\t\t\tret.push(ef(emoji));\r\n\t\t} else {\r\n\t\t\tlet cp = input.pop();\r\n\t\t\tif (VALID.has(cp)) {\r\n\t\t\t\tchars.push(cp);\r\n\t\t\t} else {\r\n\t\t\t\tlet cps = MAPPED.get(cp);\r\n\t\t\t\tif (cps) {\r\n\t\t\t\t\tchars.push(...cps); // less than 10 elements\r\n\t\t\t\t} else if (!IGNORED.has(cp)) {\r\n\t\t\t\t\t// 20230912: unicode 15.1 changed the order of processing such that\r\n\t\t\t\t\t// disallowed parts are only rejected after NFC\r\n\t\t\t\t\t// https://unicode.org/reports/tr46/#Validity_Criteria\r\n\t\t\t\t\t// this doesn't impact normalization as of today\r\n\t\t\t\t\t// technically, this error can be removed as the group logic will apply similar logic\r\n\t\t\t\t\t// however the error type might be less clear\r\n\t\t\t\t\tthrow error_disallowed(cp);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (chars.length) {\r\n\t\tret.push(nf(chars));\r\n\t}\r\n\treturn ret;\r\n}\r\n\r\nfunction filter_fe0f(cps) {\r\n\treturn cps.filter(cp => cp != FE0F);\r\n}\r\n\r\n// given array of codepoints\r\n// returns the longest valid emoji sequence (or undefined if no match)\r\n// *MUTATES* the supplied array\r\n// disallows interleaved ignored characters\r\n// fills (optional) eaten array with matched codepoints\r\nfunction consume_emoji_reversed(cps, eaten) {\r\n\tlet node = EMOJI_ROOT;\r\n\tlet emoji;\r\n\tlet pos = cps.length;\r\n\twhile (pos) {\r\n\t\tnode = node.get(cps[--pos]);\r\n\t\tif (!node) break;\r\n\t\tlet {V} = node;\r\n\t\tif (V) { // this is a valid emoji (so far)\r\n\t\t\temoji = V;\r\n\t\t\tif (eaten) eaten.push(...cps.slice(pos).reverse()); // (optional) copy input, used for ens_tokenize()\r\n\t\t\tcps.length = pos; // truncate\r\n\t\t}\r\n\t}\r\n\treturn emoji;\r\n}\r\n\r\n// ************************************************************\r\n// tokenizer \r\n\r\nconst TY_VALID = 'valid';\r\nconst TY_MAPPED = 'mapped';\r\nconst TY_IGNORED = 'ignored';\r\nconst TY_DISALLOWED = 'disallowed';\r\nconst TY_EMOJI = 'emoji';\r\nconst TY_NFC = 'nfc';\r\nconst TY_STOP = 'stop';\r\n\r\nfunction ens_tokenize(name, {\r\n\tnf = true, // collapse unnormalized runs into a single token\r\n} = {}) {\r\n\tinit();\r\n\tlet input = explode_cp(name).reverse();\r\n\tlet eaten = [];\r\n\tlet tokens = [];\r\n\twhile (input.length) {\r\n\t\tlet emoji = consume_emoji_reversed(input, eaten);\r\n\t\tif (emoji) {\r\n\t\t\ttokens.push({\r\n\t\t\t\ttype: TY_EMOJI,\r\n\t\t\t\temoji: emoji.slice(), // copy emoji\r\n\t\t\t\tinput: eaten,\r\n\t\t\t\tcps: filter_fe0f(emoji)\r\n\t\t\t});\r\n\t\t\teaten = []; // reset buffer\r\n\t\t} else {\r\n\t\t\tlet cp = input.pop();\r\n\t\t\tif (cp == STOP) {\r\n\t\t\t\ttokens.push({type: TY_STOP, cp});\r\n\t\t\t} else if (VALID.has(cp)) {\r\n\t\t\t\ttokens.push({type: TY_VALID, cps: [cp]});\r\n\t\t\t} else if (IGNORED.has(cp)) {\r\n\t\t\t\ttokens.push({type: TY_IGNORED, cp});\r\n\t\t\t} else {\r\n\t\t\t\tlet cps = MAPPED.get(cp);\r\n\t\t\t\tif (cps) {\r\n\t\t\t\t\ttokens.push({type: TY_MAPPED, cp, cps: cps.slice()});\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttokens.push({type: TY_DISALLOWED, cp});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (nf) {\r\n\t\tfor (let i = 0, start = -1; i < tokens.length; i++) {\r\n\t\t\tlet token = tokens[i];\r\n\t\t\tif (is_valid_or_mapped(token.type)) {\r\n\t\t\t\tif (requires_check(token.cps)) { // normalization might be needed\r\n\t\t\t\t\tlet end = i + 1;\r\n\t\t\t\t\tfor (let pos = end; pos < tokens.length; pos++) { // find adjacent text\r\n\t\t\t\t\t\tlet {type, cps} = tokens[pos];\r\n\t\t\t\t\t\tif (is_valid_or_mapped(type)) {\r\n\t\t\t\t\t\t\tif (!requires_check(cps)) break;\r\n\t\t\t\t\t\t\tend = pos + 1;\r\n\t\t\t\t\t\t} else if (type !== TY_IGNORED) { // || type !== TY_DISALLOWED) { \r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (start < 0) start = i;\r\n\t\t\t\t\tlet slice = tokens.slice(start, end);\r\n\t\t\t\t\tlet cps0 = slice.flatMap(x => is_valid_or_mapped(x.type) ? x.cps : []); // strip junk tokens\r\n\t\t\t\t\tlet cps = nfc(cps0);\r\n\t\t\t\t\tif (compare_arrays(cps, cps0)) { // bundle into an nfc token\r\n\t\t\t\t\t\ttokens.splice(start, end - start, {\r\n\t\t\t\t\t\t\ttype: TY_NFC, \r\n\t\t\t\t\t\t\tinput: cps0, // there are 3 states: tokens0 ==(process)=> input ==(nfc)=> tokens/cps\r\n\t\t\t\t\t\t\tcps, \r\n\t\t\t\t\t\t\ttokens0: collapse_valid_tokens(slice),\r\n\t\t\t\t\t\t\ttokens: ens_tokenize(str_from_cps(cps), {nf: false})\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\ti = start;\r\n\t\t\t\t\t} else { \r\n\t\t\t\t\t\ti = end - 1; // skip to end of slice\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstart = -1; // reset\r\n\t\t\t\t} else {\r\n\t\t\t\t\tstart = i; // remember last\r\n\t\t\t\t}\r\n\t\t\t} else if (token.type !== TY_IGNORED) { // 20221024: is this correct?\r\n\t\t\t\tstart = -1; // reset\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn collapse_valid_tokens(tokens);\r\n}\r\n\r\nfunction is_valid_or_mapped(type) {\r\n\treturn type == TY_VALID || type == TY_MAPPED;\r\n}\r\n\r\nfunction requires_check(cps) {\r\n\treturn cps.some(cp => NFC_CHECK.has(cp));\r\n}\r\n\r\nfunction collapse_valid_tokens(tokens) {\r\n\tfor (let i = 0; i < tokens.length; i++) {\r\n\t\tif (tokens[i].type == TY_VALID) {\r\n\t\t\tlet j = i + 1;\r\n\t\t\twhile (j < tokens.length && tokens[j].type == TY_VALID) j++;\r\n\t\t\ttokens.splice(i, j - i, {type: TY_VALID, cps: tokens.slice(i, j).flatMap(x => x.cps)});\r\n\t\t}\r\n\t}\r\n\treturn tokens;\r\n}\n\nexport { ens_beautify, ens_emoji, ens_normalize, ens_normalize_fragment, ens_split, ens_tokenize, is_combining_mark, nfc, nfd, safe_str_from_cps, should_escape };\n","import { keccak256 } from \"../crypto/index.js\";\nimport { concat, hexlify, assertArgument, toUtf8Bytes } from \"../utils/index.js\";\nimport { ens_normalize } from \"@adraffy/ens-normalize\";\nconst Zeros = new Uint8Array(32);\nZeros.fill(0);\nfunction checkComponent(comp) {\n assertArgument(comp.length !== 0, \"invalid ENS name; empty component\", \"comp\", comp);\n return comp;\n}\nfunction ensNameSplit(name) {\n const bytes = toUtf8Bytes(ensNormalize(name));\n const comps = [];\n if (name.length === 0) {\n return comps;\n }\n let last = 0;\n for (let i = 0; i < bytes.length; i++) {\n const d = bytes[i];\n // A separator (i.e. \".\"); copy this component\n if (d === 0x2e) {\n comps.push(checkComponent(bytes.slice(last, i)));\n last = i + 1;\n }\n }\n // There was a stray separator at the end of the name\n assertArgument(last < bytes.length, \"invalid ENS name; empty component\", \"name\", name);\n comps.push(checkComponent(bytes.slice(last)));\n return comps;\n}\n/**\n * Returns the ENS %%name%% normalized.\n */\nexport function ensNormalize(name) {\n try {\n if (name.length === 0) {\n throw new Error(\"empty label\");\n }\n return ens_normalize(name);\n }\n catch (error) {\n assertArgument(false, `invalid ENS name (${error.message})`, \"name\", name);\n }\n}\n/**\n * Returns ``true`` if %%name%% is a valid ENS name.\n */\nexport function isValidName(name) {\n try {\n return (ensNameSplit(name).length !== 0);\n }\n catch (error) { }\n return false;\n}\n/**\n * Returns the [[link-namehash]] for %%name%%.\n */\nexport function namehash(name) {\n assertArgument(typeof (name) === \"string\", \"invalid ENS name; not a string\", \"name\", name);\n assertArgument(name.length, `invalid ENS name (empty label)`, \"name\", name);\n let result = Zeros;\n const comps = ensNameSplit(name);\n while (comps.length) {\n result = keccak256(concat([result, keccak256((comps.pop()))]));\n }\n return hexlify(result);\n}\n/**\n * Returns the DNS encoded %%name%%.\n *\n * This is used for various parts of ENS name resolution, such\n * as the wildcard resolution.\n */\nexport function dnsEncode(name, _maxLength) {\n const length = (_maxLength != null) ? _maxLength : 63;\n assertArgument(length <= 255, \"DNS encoded label cannot exceed 255\", \"length\", length);\n return hexlify(concat(ensNameSplit(name).map((comp) => {\n assertArgument(comp.length <= length, `label ${JSON.stringify(name)} exceeds ${length} bytes`, \"name\", name);\n const bytes = new Uint8Array(comp.length + 1);\n bytes.set(comp, 1);\n bytes[0] = bytes.length - 1;\n return bytes;\n }))) + \"00\";\n}\n//# sourceMappingURL=namehash.js.map","import { getAddress } from \"../address/index.js\";\nimport { Signature } from \"../crypto/index.js\";\nimport { getBigInt } from \"../utils/index.js\";\nexport function authorizationify(auth) {\n return {\n address: getAddress(auth.address),\n nonce: getBigInt((auth.nonce != null) ? auth.nonce : 0),\n chainId: getBigInt((auth.chainId != null) ? auth.chainId : 0),\n signature: Signature.from(auth.signature)\n };\n}\n//# sourceMappingURL=authorization.js.map","import { getAddress } from \"../address/index.js\";\nimport { keccak256, SigningKey } from \"../crypto/index.js\";\n/**\n * Returns the address for the %%key%%.\n *\n * The key may be any standard form of public key or a private key.\n */\nexport function computeAddress(key) {\n let pubkey;\n if (typeof (key) === \"string\") {\n pubkey = SigningKey.computePublicKey(key, false);\n }\n else {\n pubkey = key.publicKey;\n }\n return getAddress(keccak256(\"0x\" + pubkey.substring(4)).substring(26));\n}\n/**\n * Returns the recovered address for the private key that was\n * used to sign %%digest%% that resulted in %%signature%%.\n */\nexport function recoverAddress(digest, signature) {\n return computeAddress(SigningKey.recoverPublicKey(digest, signature));\n}\n//# sourceMappingURL=address.js.map","import { getAddress } from \"../address/index.js\";\nimport { ZeroAddress } from \"../constants/addresses.js\";\nimport { keccak256, sha256, Signature, SigningKey } from \"../crypto/index.js\";\nimport { concat, decodeRlp, encodeRlp, getBytes, getBigInt, getNumber, hexlify, assert, assertArgument, isBytesLike, isHexString, toBeArray, zeroPadValue } from \"../utils/index.js\";\nimport { accessListify } from \"./accesslist.js\";\nimport { authorizationify } from \"./authorization.js\";\nimport { recoverAddress } from \"./address.js\";\nconst BN_0 = BigInt(0);\nconst BN_2 = BigInt(2);\nconst BN_27 = BigInt(27);\nconst BN_28 = BigInt(28);\nconst BN_35 = BigInt(35);\nconst BN_MAX_UINT = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\nconst inspect = Symbol.for(\"nodejs.util.inspect.custom\");\nconst BLOB_SIZE = 4096 * 32;\nconst CELL_COUNT = 128;\n/**\n * Returns a BLOb proof as its cells for [[link-eip-7594]] BLOb.\n *\n * The default %%cellCount%% is 128.\n */\nexport function splitBlobCells(_proof, cellCount) {\n if (cellCount == null) {\n cellCount = CELL_COUNT;\n }\n const cellProofs = [];\n const proof = getBytes(_proof);\n const cellSize = proof.length / cellCount;\n for (let i = 0; i < proof.length; i += cellSize) {\n cellProofs.push(hexlify(proof.subarray(i, i + cellSize)));\n }\n return cellProofs;\n}\nfunction getKzgLibrary(kzg) {\n const blobToKzgCommitment = (blob) => {\n if (\"computeBlobProof\" in kzg) {\n // micro-ecc-signer; check for computeBlobProof since this API\n // expects a string while the kzg-wasm below expects a Unit8Array\n if (\"blobToKzgCommitment\" in kzg && typeof (kzg.blobToKzgCommitment) === \"function\") {\n return getBytes(kzg.blobToKzgCommitment(hexlify(blob)));\n }\n }\n else if (\"blobToKzgCommitment\" in kzg && typeof (kzg.blobToKzgCommitment) === \"function\") {\n // kzg-wasm <0.5.0; blobToKzgCommitment(Uint8Array) => Uint8Array\n return getBytes(kzg.blobToKzgCommitment(blob));\n }\n // kzg-wasm >= 0.5.0; blobToKZGCommitment(string) => string\n if (\"blobToKZGCommitment\" in kzg && typeof (kzg.blobToKZGCommitment) === \"function\") {\n return getBytes(kzg.blobToKZGCommitment(hexlify(blob)));\n }\n assertArgument(false, \"unsupported KZG library\", \"kzg\", kzg);\n };\n const computeBlobKzgProof = (blob, commitment) => {\n // micro-ecc-signer\n if (\"computeBlobProof\" in kzg && typeof (kzg.computeBlobProof) === \"function\") {\n return getBytes(kzg.computeBlobProof(hexlify(blob), hexlify(commitment)));\n }\n // kzg-wasm <0.5.0; computeBlobKzgProof(Uint8Array, Uint8Array) => Uint8Array\n if (\"computeBlobKzgProof\" in kzg && typeof (kzg.computeBlobKzgProof) === \"function\") {\n return kzg.computeBlobKzgProof(blob, commitment);\n }\n // kzg-wasm >= 0.5.0; computeBlobKZGProof(string, string) => string\n if (\"computeBlobKZGProof\" in kzg && typeof (kzg.computeBlobKZGProof) === \"function\") {\n return getBytes(kzg.computeBlobKZGProof(hexlify(blob), hexlify(commitment)));\n }\n assertArgument(false, \"unsupported KZG library\", \"kzg\", kzg);\n };\n return { blobToKzgCommitment, computeBlobKzgProof };\n}\nfunction getVersionedHash(version, hash) {\n let versioned = version.toString(16);\n while (versioned.length < 2) {\n versioned = \"0\" + versioned;\n }\n versioned += sha256(hash).substring(4);\n return \"0x\" + versioned;\n}\nfunction handleAddress(value) {\n if (value === \"0x\") {\n return null;\n }\n return getAddress(value);\n}\nfunction handleAccessList(value, param) {\n try {\n return accessListify(value);\n }\n catch (error) {\n assertArgument(false, error.message, param, value);\n }\n}\nfunction handleAuthorizationList(value, param) {\n try {\n if (!Array.isArray(value)) {\n throw new Error(\"authorizationList: invalid array\");\n }\n const result = [];\n for (let i = 0; i < value.length; i++) {\n const auth = value[i];\n if (!Array.isArray(auth)) {\n throw new Error(`authorization[${i}]: invalid array`);\n }\n if (auth.length !== 6) {\n throw new Error(`authorization[${i}]: wrong length`);\n }\n if (!auth[1]) {\n throw new Error(`authorization[${i}]: null address`);\n }\n result.push({\n address: handleAddress(auth[1]),\n nonce: handleUint(auth[2], \"nonce\"),\n chainId: handleUint(auth[0], \"chainId\"),\n signature: Signature.from({\n yParity: handleNumber(auth[3], \"yParity\"),\n r: zeroPadValue(auth[4], 32),\n s: zeroPadValue(auth[5], 32)\n })\n });\n }\n return result;\n }\n catch (error) {\n assertArgument(false, error.message, param, value);\n }\n}\nfunction handleNumber(_value, param) {\n if (_value === \"0x\") {\n return 0;\n }\n return getNumber(_value, param);\n}\nfunction handleUint(_value, param) {\n if (_value === \"0x\") {\n return BN_0;\n }\n const value = getBigInt(_value, param);\n assertArgument(value <= BN_MAX_UINT, \"value exceeds uint size\", param, value);\n return value;\n}\nfunction formatNumber(_value, name) {\n const value = getBigInt(_value, \"value\");\n const result = toBeArray(value);\n assertArgument(result.length <= 32, `value too large`, `tx.${name}`, value);\n return result;\n}\nfunction formatAccessList(value) {\n return accessListify(value).map((set) => [set.address, set.storageKeys]);\n}\nfunction formatAuthorizationList(value) {\n return value.map((a) => {\n return [\n formatNumber(a.chainId, \"chainId\"),\n a.address,\n formatNumber(a.nonce, \"nonce\"),\n formatNumber(a.signature.yParity, \"yParity\"),\n toBeArray(a.signature.r),\n toBeArray(a.signature._s)\n ];\n });\n}\nfunction formatHashes(value, param) {\n assertArgument(Array.isArray(value), `invalid ${param}`, \"value\", value);\n for (let i = 0; i < value.length; i++) {\n assertArgument(isHexString(value[i], 32), \"invalid ${ param } hash\", `value[${i}]`, value[i]);\n }\n return value;\n}\nfunction _parseLegacy(data) {\n const fields = decodeRlp(data);\n assertArgument(Array.isArray(fields) && (fields.length === 9 || fields.length === 6), \"invalid field count for legacy transaction\", \"data\", data);\n const tx = {\n type: 0,\n nonce: handleNumber(fields[0], \"nonce\"),\n gasPrice: handleUint(fields[1], \"gasPrice\"),\n gasLimit: handleUint(fields[2], \"gasLimit\"),\n to: handleAddress(fields[3]),\n value: handleUint(fields[4], \"value\"),\n data: hexlify(fields[5]),\n chainId: BN_0\n };\n // Legacy unsigned transaction\n if (fields.length === 6) {\n return tx;\n }\n const v = handleUint(fields[6], \"v\");\n const r = handleUint(fields[7], \"r\");\n const s = handleUint(fields[8], \"s\");\n if (r === BN_0 && s === BN_0) {\n // EIP-155 unsigned transaction\n tx.chainId = v;\n }\n else {\n // Compute the EIP-155 chain ID (or 0 for legacy)\n let chainId = (v - BN_35) / BN_2;\n if (chainId < BN_0) {\n chainId = BN_0;\n }\n tx.chainId = chainId;\n // Signed Legacy Transaction\n assertArgument(chainId !== BN_0 || (v === BN_27 || v === BN_28), \"non-canonical legacy v\", \"v\", fields[6]);\n tx.signature = Signature.from({\n r: zeroPadValue(fields[7], 32),\n s: zeroPadValue(fields[8], 32),\n v\n });\n //tx.hash = keccak256(data);\n }\n return tx;\n}\nfunction _serializeLegacy(tx, sig) {\n const fields = [\n formatNumber(tx.nonce, \"nonce\"),\n formatNumber(tx.gasPrice || 0, \"gasPrice\"),\n formatNumber(tx.gasLimit, \"gasLimit\"),\n (tx.to || \"0x\"),\n formatNumber(tx.value, \"value\"),\n tx.data,\n ];\n let chainId = BN_0;\n if (tx.chainId != BN_0) {\n // A chainId was provided; if non-zero we'll use EIP-155\n chainId = getBigInt(tx.chainId, \"tx.chainId\");\n // We have a chainId in the tx and an EIP-155 v in the signature,\n // make sure they agree with each other\n assertArgument(!sig || sig.networkV == null || sig.legacyChainId === chainId, \"tx.chainId/sig.v mismatch\", \"sig\", sig);\n }\n else if (tx.signature) {\n // No explicit chainId, but EIP-155 have a derived implicit chainId\n const legacy = tx.signature.legacyChainId;\n if (legacy != null) {\n chainId = legacy;\n }\n }\n // Requesting an unsigned transaction\n if (!sig) {\n // We have an EIP-155 transaction (chainId was specified and non-zero)\n if (chainId !== BN_0) {\n fields.push(toBeArray(chainId));\n fields.push(\"0x\");\n fields.push(\"0x\");\n }\n return encodeRlp(fields);\n }\n // @TODO: We should probably check that tx.signature, chainId, and sig\n // match but that logic could break existing code, so schedule\n // this for the next major bump.\n // Compute the EIP-155 v\n let v = BigInt(27 + sig.yParity);\n if (chainId !== BN_0) {\n v = Signature.getChainIdV(chainId, sig.v);\n }\n else if (BigInt(sig.v) !== v) {\n assertArgument(false, \"tx.chainId/sig.v mismatch\", \"sig\", sig);\n }\n // Add the signature\n fields.push(toBeArray(v));\n fields.push(toBeArray(sig.r));\n fields.push(toBeArray(sig._s));\n return encodeRlp(fields);\n}\nfunction _parseEipSignature(tx, fields) {\n let yParity;\n try {\n yParity = handleNumber(fields[0], \"yParity\");\n if (yParity !== 0 && yParity !== 1) {\n throw new Error(\"bad yParity\");\n }\n }\n catch (error) {\n assertArgument(false, \"invalid yParity\", \"yParity\", fields[0]);\n }\n const r = zeroPadValue(fields[1], 32);\n const s = zeroPadValue(fields[2], 32);\n const signature = Signature.from({ r, s, yParity });\n tx.signature = signature;\n}\nfunction _parseEip1559(data) {\n const fields = decodeRlp(getBytes(data).slice(1));\n assertArgument(Array.isArray(fields) && (fields.length === 9 || fields.length === 12), \"invalid field count for transaction type: 2\", \"data\", hexlify(data));\n const tx = {\n type: 2,\n chainId: handleUint(fields[0], \"chainId\"),\n nonce: handleNumber(fields[1], \"nonce\"),\n maxPriorityFeePerGas: handleUint(fields[2], \"maxPriorityFeePerGas\"),\n maxFeePerGas: handleUint(fields[3], \"maxFeePerGas\"),\n gasPrice: null,\n gasLimit: handleUint(fields[4], \"gasLimit\"),\n to: handleAddress(fields[5]),\n value: handleUint(fields[6], \"value\"),\n data: hexlify(fields[7]),\n accessList: handleAccessList(fields[8], \"accessList\"),\n };\n // Unsigned EIP-1559 Transaction\n if (fields.length === 9) {\n return tx;\n }\n //tx.hash = keccak256(data);\n _parseEipSignature(tx, fields.slice(9));\n return tx;\n}\nfunction _serializeEip1559(tx, sig) {\n const fields = [\n formatNumber(tx.chainId, \"chainId\"),\n formatNumber(tx.nonce, \"nonce\"),\n formatNumber(tx.maxPriorityFeePerGas || 0, \"maxPriorityFeePerGas\"),\n formatNumber(tx.maxFeePerGas || 0, \"maxFeePerGas\"),\n formatNumber(tx.gasLimit, \"gasLimit\"),\n (tx.to || \"0x\"),\n formatNumber(tx.value, \"value\"),\n tx.data,\n formatAccessList(tx.accessList || [])\n ];\n if (sig) {\n fields.push(formatNumber(sig.yParity, \"yParity\"));\n fields.push(toBeArray(sig.r));\n fields.push(toBeArray(sig.s));\n }\n return concat([\"0x02\", encodeRlp(fields)]);\n}\nfunction _parseEip2930(data) {\n const fields = decodeRlp(getBytes(data).slice(1));\n assertArgument(Array.isArray(fields) && (fields.length === 8 || fields.length === 11), \"invalid field count for transaction type: 1\", \"data\", hexlify(data));\n const tx = {\n type: 1,\n chainId: handleUint(fields[0], \"chainId\"),\n nonce: handleNumber(fields[1], \"nonce\"),\n gasPrice: handleUint(fields[2], \"gasPrice\"),\n gasLimit: handleUint(fields[3], \"gasLimit\"),\n to: handleAddress(fields[4]),\n value: handleUint(fields[5], \"value\"),\n data: hexlify(fields[6]),\n accessList: handleAccessList(fields[7], \"accessList\")\n };\n // Unsigned EIP-2930 Transaction\n if (fields.length === 8) {\n return tx;\n }\n //tx.hash = keccak256(data);\n _parseEipSignature(tx, fields.slice(8));\n return tx;\n}\nfunction _serializeEip2930(tx, sig) {\n const fields = [\n formatNumber(tx.chainId, \"chainId\"),\n formatNumber(tx.nonce, \"nonce\"),\n formatNumber(tx.gasPrice || 0, \"gasPrice\"),\n formatNumber(tx.gasLimit, \"gasLimit\"),\n (tx.to || \"0x\"),\n formatNumber(tx.value, \"value\"),\n tx.data,\n formatAccessList(tx.accessList || [])\n ];\n if (sig) {\n fields.push(formatNumber(sig.yParity, \"recoveryParam\"));\n fields.push(toBeArray(sig.r));\n fields.push(toBeArray(sig.s));\n }\n return concat([\"0x01\", encodeRlp(fields)]);\n}\nfunction _parseEip4844(data) {\n let fields = decodeRlp(getBytes(data).slice(1));\n let typeName = \"3\";\n let blobWrapperVersion = null;\n let blobs = null;\n // Parse the network format\n if (fields.length === 4 && Array.isArray(fields[0])) {\n // EIP-4844 format with sidecar\n typeName = \"3 (network format)\";\n const fBlobs = fields[1], fCommits = fields[2], fProofs = fields[3];\n assertArgument(Array.isArray(fBlobs), \"invalid network format: blobs not an array\", \"fields[1]\", fBlobs);\n assertArgument(Array.isArray(fCommits), \"invalid network format: commitments not an array\", \"fields[2]\", fCommits);\n assertArgument(Array.isArray(fProofs), \"invalid network format: proofs not an array\", \"fields[3]\", fProofs);\n assertArgument(fBlobs.length === fCommits.length, \"invalid network format: blobs/commitments length mismatch\", \"fields\", fields);\n assertArgument(fBlobs.length === fProofs.length, \"invalid network format: blobs/proofs length mismatch\", \"fields\", fields);\n blobs = [];\n for (let i = 0; i < fields[1].length; i++) {\n blobs.push({\n data: fBlobs[i],\n commitment: fCommits[i],\n proof: fProofs[i],\n });\n }\n fields = fields[0];\n }\n else if (fields.length === 5 && Array.isArray(fields[0])) {\n // EIP-7594 format with sidecar\n typeName = \"3 (EIP-7594 network format)\";\n blobWrapperVersion = getNumber(fields[1]);\n const fBlobs = fields[2], fCommits = fields[3], fProofs = fields[4];\n assertArgument(blobWrapperVersion === 1, `unsupported EIP-7594 network format version: ${blobWrapperVersion}`, \"fields[1]\", blobWrapperVersion);\n assertArgument(Array.isArray(fBlobs), \"invalid EIP-7594 network format: blobs not an array\", \"fields[2]\", fBlobs);\n assertArgument(Array.isArray(fCommits), \"invalid EIP-7594 network format: commitments not an array\", \"fields[3]\", fCommits);\n assertArgument(Array.isArray(fProofs), \"invalid EIP-7594 network format: proofs not an array\", \"fields[4]\", fProofs);\n assertArgument(fBlobs.length === fCommits.length, \"invalid network format: blobs/commitments length mismatch\", \"fields\", fields);\n assertArgument(fBlobs.length * CELL_COUNT === fProofs.length, \"invalid network format: blobs/proofs length mismatch\", \"fields\", fields);\n blobs = [];\n for (let i = 0; i < fBlobs.length; i++) {\n const proof = [];\n for (let j = 0; j < CELL_COUNT; j++) {\n proof.push(fProofs[(i * CELL_COUNT) + j]);\n }\n blobs.push({\n data: fBlobs[i],\n commitment: fCommits[i],\n proof: concat(proof)\n });\n }\n fields = fields[0];\n }\n assertArgument(Array.isArray(fields) && (fields.length === 11 || fields.length === 14), `invalid field count for transaction type: ${typeName}`, \"data\", hexlify(data));\n const tx = {\n type: 3,\n chainId: handleUint(fields[0], \"chainId\"),\n nonce: handleNumber(fields[1], \"nonce\"),\n maxPriorityFeePerGas: handleUint(fields[2], \"maxPriorityFeePerGas\"),\n maxFeePerGas: handleUint(fields[3], \"maxFeePerGas\"),\n gasPrice: null,\n gasLimit: handleUint(fields[4], \"gasLimit\"),\n to: handleAddress(fields[5]),\n value: handleUint(fields[6], \"value\"),\n data: hexlify(fields[7]),\n accessList: handleAccessList(fields[8], \"accessList\"),\n maxFeePerBlobGas: handleUint(fields[9], \"maxFeePerBlobGas\"),\n blobVersionedHashes: fields[10],\n blobWrapperVersion\n };\n if (blobs) {\n tx.blobs = blobs;\n }\n assertArgument(tx.to != null, `invalid address for transaction type: ${typeName}`, \"data\", data);\n assertArgument(Array.isArray(tx.blobVersionedHashes), \"invalid blobVersionedHashes: must be an array\", \"data\", data);\n for (let i = 0; i < tx.blobVersionedHashes.length; i++) {\n assertArgument(isHexString(tx.blobVersionedHashes[i], 32), `invalid blobVersionedHash at index ${i}: must be length 32`, \"data\", data);\n }\n // Unsigned EIP-4844 Transaction\n if (fields.length === 11) {\n return tx;\n }\n // @TODO: Do we need to do this? This is only called internally\n // and used to verify hashes; it might save time to not do this\n //tx.hash = keccak256(concat([ \"0x03\", encodeRlp(fields) ]));\n _parseEipSignature(tx, fields.slice(11));\n return tx;\n}\nfunction _serializeEip4844(tx, sig, blobs) {\n const fields = [\n formatNumber(tx.chainId, \"chainId\"),\n formatNumber(tx.nonce, \"nonce\"),\n formatNumber(tx.maxPriorityFeePerGas || 0, \"maxPriorityFeePerGas\"),\n formatNumber(tx.maxFeePerGas || 0, \"maxFeePerGas\"),\n formatNumber(tx.gasLimit, \"gasLimit\"),\n (tx.to || ZeroAddress),\n formatNumber(tx.value, \"value\"),\n tx.data,\n formatAccessList(tx.accessList || []),\n formatNumber(tx.maxFeePerBlobGas || 0, \"maxFeePerBlobGas\"),\n formatHashes(tx.blobVersionedHashes || [], \"blobVersionedHashes\")\n ];\n if (sig) {\n fields.push(formatNumber(sig.yParity, \"yParity\"));\n fields.push(toBeArray(sig.r));\n fields.push(toBeArray(sig.s));\n // We have blobs; return the network wrapped format\n if (blobs) {\n // Use EIP-7594\n if (tx.blobWrapperVersion != null) {\n const wrapperVersion = toBeArray(tx.blobWrapperVersion);\n const cellProofs = [];\n for (const { proof } of blobs) {\n const p = getBytes(proof);\n const cellSize = p.length / CELL_COUNT;\n for (let i = 0; i < p.length; i += cellSize) {\n cellProofs.push(p.subarray(i, i + cellSize));\n }\n }\n return concat([\n \"0x03\",\n encodeRlp([\n fields,\n wrapperVersion,\n blobs.map((b) => b.data),\n blobs.map((b) => b.commitment),\n cellProofs\n ])\n ]);\n }\n // Fall back onto classic EIP-4844 behavior\n return concat([\n \"0x03\",\n encodeRlp([\n fields,\n blobs.map((b) => b.data),\n blobs.map((b) => b.commitment),\n blobs.map((b) => b.proof),\n ])\n ]);\n }\n }\n return concat([\"0x03\", encodeRlp(fields)]);\n}\nfunction _parseEip7702(data) {\n const fields = decodeRlp(getBytes(data).slice(1));\n assertArgument(Array.isArray(fields) && (fields.length === 10 || fields.length === 13), \"invalid field count for transaction type: 4\", \"data\", hexlify(data));\n const tx = {\n type: 4,\n chainId: handleUint(fields[0], \"chainId\"),\n nonce: handleNumber(fields[1], \"nonce\"),\n maxPriorityFeePerGas: handleUint(fields[2], \"maxPriorityFeePerGas\"),\n maxFeePerGas: handleUint(fields[3], \"maxFeePerGas\"),\n gasPrice: null,\n gasLimit: handleUint(fields[4], \"gasLimit\"),\n to: handleAddress(fields[5]),\n value: handleUint(fields[6], \"value\"),\n data: hexlify(fields[7]),\n accessList: handleAccessList(fields[8], \"accessList\"),\n authorizationList: handleAuthorizationList(fields[9], \"authorizationList\"),\n };\n // Unsigned EIP-7702 Transaction\n if (fields.length === 10) {\n return tx;\n }\n _parseEipSignature(tx, fields.slice(10));\n return tx;\n}\nfunction _serializeEip7702(tx, sig) {\n const fields = [\n formatNumber(tx.chainId, \"chainId\"),\n formatNumber(tx.nonce, \"nonce\"),\n formatNumber(tx.maxPriorityFeePerGas || 0, \"maxPriorityFeePerGas\"),\n formatNumber(tx.maxFeePerGas || 0, \"maxFeePerGas\"),\n formatNumber(tx.gasLimit, \"gasLimit\"),\n (tx.to || \"0x\"),\n formatNumber(tx.value, \"value\"),\n tx.data,\n formatAccessList(tx.accessList || []),\n formatAuthorizationList(tx.authorizationList || [])\n ];\n if (sig) {\n fields.push(formatNumber(sig.yParity, \"yParity\"));\n fields.push(toBeArray(sig.r));\n fields.push(toBeArray(sig.s));\n }\n return concat([\"0x04\", encodeRlp(fields)]);\n}\n/**\n * A **Transaction** describes an operation to be executed on\n * Ethereum by an Externally Owned Account (EOA). It includes\n * who (the [[to]] address), what (the [[data]]) and how much (the\n * [[value]] in ether) the operation should entail.\n *\n * @example:\n * tx = new Transaction()\n * //_result:\n *\n * tx.data = \"0x1234\";\n * //_result:\n */\nexport class Transaction {\n #type;\n #to;\n #data;\n #nonce;\n #gasLimit;\n #gasPrice;\n #maxPriorityFeePerGas;\n #maxFeePerGas;\n #value;\n #chainId;\n #sig;\n #accessList;\n #maxFeePerBlobGas;\n #blobVersionedHashes;\n #kzg;\n #blobs;\n #auths;\n #blobWrapperVersion;\n /**\n * The transaction type.\n *\n * If null, the type will be automatically inferred based on\n * explicit properties.\n */\n get type() { return this.#type; }\n set type(value) {\n switch (value) {\n case null:\n this.#type = null;\n break;\n case 0:\n case \"legacy\":\n this.#type = 0;\n break;\n case 1:\n case \"berlin\":\n case \"eip-2930\":\n this.#type = 1;\n break;\n case 2:\n case \"london\":\n case \"eip-1559\":\n this.#type = 2;\n break;\n case 3:\n case \"cancun\":\n case \"eip-4844\":\n this.#type = 3;\n break;\n case 4:\n case \"pectra\":\n case \"eip-7702\":\n this.#type = 4;\n break;\n default:\n assertArgument(false, \"unsupported transaction type\", \"type\", value);\n }\n }\n /**\n * The name of the transaction type.\n */\n get typeName() {\n switch (this.type) {\n case 0: return \"legacy\";\n case 1: return \"eip-2930\";\n case 2: return \"eip-1559\";\n case 3: return \"eip-4844\";\n case 4: return \"eip-7702\";\n }\n return null;\n }\n /**\n * The ``to`` address for the transaction or ``null`` if the\n * transaction is an ``init`` transaction.\n */\n get to() {\n const value = this.#to;\n if (value == null && this.type === 3) {\n return ZeroAddress;\n }\n return value;\n }\n set to(value) {\n this.#to = (value == null) ? null : getAddress(value);\n }\n /**\n * The transaction nonce.\n */\n get nonce() { return this.#nonce; }\n set nonce(value) { this.#nonce = getNumber(value, \"value\"); }\n /**\n * The gas limit.\n */\n get gasLimit() { return this.#gasLimit; }\n set gasLimit(value) { this.#gasLimit = getBigInt(value); }\n /**\n * The gas price.\n *\n * On legacy networks this defines the fee that will be paid. On\n * EIP-1559 networks, this should be ``null``.\n */\n get gasPrice() {\n const value = this.#gasPrice;\n if (value == null && (this.type === 0 || this.type === 1)) {\n return BN_0;\n }\n return value;\n }\n set gasPrice(value) {\n this.#gasPrice = (value == null) ? null : getBigInt(value, \"gasPrice\");\n }\n /**\n * The maximum priority fee per unit of gas to pay. On legacy\n * networks this should be ``null``.\n */\n get maxPriorityFeePerGas() {\n const value = this.#maxPriorityFeePerGas;\n if (value == null) {\n if (this.type === 2 || this.type === 3) {\n return BN_0;\n }\n return null;\n }\n return value;\n }\n set maxPriorityFeePerGas(value) {\n this.#maxPriorityFeePerGas = (value == null) ? null : getBigInt(value, \"maxPriorityFeePerGas\");\n }\n /**\n * The maximum total fee per unit of gas to pay. On legacy\n * networks this should be ``null``.\n */\n get maxFeePerGas() {\n const value = this.#maxFeePerGas;\n if (value == null) {\n if (this.type === 2 || this.type === 3) {\n return BN_0;\n }\n return null;\n }\n return value;\n }\n set maxFeePerGas(value) {\n this.#maxFeePerGas = (value == null) ? null : getBigInt(value, \"maxFeePerGas\");\n }\n /**\n * The transaction data. For ``init`` transactions this is the\n * deployment code.\n */\n get data() { return this.#data; }\n set data(value) { this.#data = hexlify(value); }\n /**\n * The amount of ether (in wei) to send in this transactions.\n */\n get value() { return this.#value; }\n set value(value) {\n this.#value = getBigInt(value, \"value\");\n }\n /**\n * The chain ID this transaction is valid on.\n */\n get chainId() { return this.#chainId; }\n set chainId(value) { this.#chainId = getBigInt(value); }\n /**\n * If signed, the signature for this transaction.\n */\n get signature() { return this.#sig || null; }\n set signature(value) {\n this.#sig = (value == null) ? null : Signature.from(value);\n }\n isValid() {\n const sig = this.signature;\n if (sig && !sig.isValid()) {\n return false;\n }\n const auths = this.authorizationList;\n if (auths) {\n for (const auth of auths) {\n if (!auth.signature.isValid()) {\n return false;\n }\n }\n }\n return true;\n }\n /**\n * The access list.\n *\n * An access list permits discounted (but pre-paid) access to\n * bytecode and state variable access within contract execution.\n */\n get accessList() {\n const value = this.#accessList || null;\n if (value == null) {\n if (this.type === 1 || this.type === 2 || this.type === 3) {\n // @TODO: in v7, this should assign the value or become\n // a live object itself, otherwise mutation is inconsistent\n return [];\n }\n return null;\n }\n return value;\n }\n set accessList(value) {\n this.#accessList = (value == null) ? null : accessListify(value);\n }\n get authorizationList() {\n const value = this.#auths || null;\n if (value == null) {\n if (this.type === 4) {\n // @TODO: in v7, this should become a live object itself,\n // otherwise mutation is inconsistent\n return [];\n }\n }\n return value;\n }\n set authorizationList(auths) {\n this.#auths = (auths == null) ? null : auths.map((a) => authorizationify(a));\n }\n /**\n * The max fee per blob gas for Cancun transactions.\n */\n get maxFeePerBlobGas() {\n const value = this.#maxFeePerBlobGas;\n if (value == null && this.type === 3) {\n return BN_0;\n }\n return value;\n }\n set maxFeePerBlobGas(value) {\n this.#maxFeePerBlobGas = (value == null) ? null : getBigInt(value, \"maxFeePerBlobGas\");\n }\n /**\n * The BLOb versioned hashes for Cancun transactions.\n */\n get blobVersionedHashes() {\n // @TODO: Mutation is inconsistent; if unset, the returned value\n // cannot mutate the object, if set it can\n let value = this.#blobVersionedHashes;\n if (value == null && this.type === 3) {\n return [];\n }\n return value;\n }\n set blobVersionedHashes(value) {\n if (value != null) {\n assertArgument(Array.isArray(value), \"blobVersionedHashes must be an Array\", \"value\", value);\n value = value.slice();\n for (let i = 0; i < value.length; i++) {\n assertArgument(isHexString(value[i], 32), \"invalid blobVersionedHash\", `value[${i}]`, value[i]);\n }\n }\n this.#blobVersionedHashes = value;\n }\n /**\n * The BLObs for the Transaction, if any.\n *\n * If ``blobs`` is non-``null``, then the [[seriailized]]\n * will return the network formatted sidecar, otherwise it\n * will return the standard [[link-eip-2718]] payload. The\n * [[unsignedSerialized]] is unaffected regardless.\n *\n * When setting ``blobs``, either fully valid [[Blob]] objects\n * may be specified (i.e. correctly padded, with correct\n * committments and proofs) or a raw [[BytesLike]] may\n * be provided.\n *\n * If raw [[BytesLike]] are provided, the [[kzg]] property **must**\n * be already set. The blob will be correctly padded and the\n * [[KzgLibrary]] will be used to compute the committment and\n * proof for the blob.\n *\n * A BLOb is a sequence of field elements, each of which must\n * be within the BLS field modulo, so some additional processing\n * may be required to encode arbitrary data to ensure each 32 byte\n * field is within the valid range.\n *\n * Setting this automatically populates [[blobVersionedHashes]],\n * overwriting any existing values. Setting this to ``null``\n * does **not** remove the [[blobVersionedHashes]], leaving them\n * present.\n */\n get blobs() {\n if (this.#blobs == null) {\n return null;\n }\n return this.#blobs.map((b) => Object.assign({}, b));\n }\n set blobs(_blobs) {\n if (_blobs == null) {\n this.#blobs = null;\n return;\n }\n const blobs = [];\n const versionedHashes = [];\n for (let i = 0; i < _blobs.length; i++) {\n const blob = _blobs[i];\n if (isBytesLike(blob)) {\n assert(this.#kzg, \"adding a raw blob requires a KZG library\", \"UNSUPPORTED_OPERATION\", {\n operation: \"set blobs()\"\n });\n let data = getBytes(blob);\n assertArgument(data.length <= BLOB_SIZE, \"blob is too large\", `blobs[${i}]`, blob);\n // Pad blob if necessary\n if (data.length !== BLOB_SIZE) {\n const padded = new Uint8Array(BLOB_SIZE);\n padded.set(data);\n data = padded;\n }\n const commit = this.#kzg.blobToKzgCommitment(data);\n const proof = hexlify(this.#kzg.computeBlobKzgProof(data, commit));\n blobs.push({\n data: hexlify(data),\n commitment: hexlify(commit),\n proof\n });\n versionedHashes.push(getVersionedHash(1, commit));\n }\n else {\n const data = hexlify(blob.data);\n const commitment = hexlify(blob.commitment);\n const proof = hexlify(blob.proof);\n blobs.push({ data, commitment, proof });\n versionedHashes.push(getVersionedHash(1, commitment));\n }\n }\n this.#blobs = blobs;\n this.#blobVersionedHashes = versionedHashes;\n }\n get kzg() { return this.#kzg; }\n set kzg(kzg) {\n if (kzg == null) {\n this.#kzg = null;\n }\n else {\n this.#kzg = getKzgLibrary(kzg);\n }\n }\n get blobWrapperVersion() {\n return this.#blobWrapperVersion;\n }\n set blobWrapperVersion(value) {\n this.#blobWrapperVersion = value;\n }\n /**\n * Creates a new Transaction with default values.\n */\n constructor() {\n this.#type = null;\n this.#to = null;\n this.#nonce = 0;\n this.#gasLimit = BN_0;\n this.#gasPrice = null;\n this.#maxPriorityFeePerGas = null;\n this.#maxFeePerGas = null;\n this.#data = \"0x\";\n this.#value = BN_0;\n this.#chainId = BN_0;\n this.#sig = null;\n this.#accessList = null;\n this.#maxFeePerBlobGas = null;\n this.#blobVersionedHashes = null;\n this.#kzg = null;\n this.#blobs = null;\n this.#auths = null;\n this.#blobWrapperVersion = null;\n }\n /**\n * The transaction hash, if signed. Otherwise, ``null``.\n */\n get hash() {\n if (this.signature == null) {\n return null;\n }\n return keccak256(this.#getSerialized(true, false));\n }\n /**\n * The pre-image hash of this transaction.\n *\n * This is the digest that a [[Signer]] must sign to authorize\n * this transaction.\n */\n get unsignedHash() {\n return keccak256(this.unsignedSerialized);\n }\n /**\n * The sending address, if signed. Otherwise, ``null``.\n */\n get from() {\n if (this.signature == null) {\n return null;\n }\n return recoverAddress(this.unsignedHash, this.signature.getCanonical());\n }\n /**\n * The public key of the sender, if signed. Otherwise, ``null``.\n */\n get fromPublicKey() {\n if (this.signature == null) {\n return null;\n }\n return SigningKey.recoverPublicKey(this.unsignedHash, this.signature.getCanonical());\n }\n /**\n * Returns true if signed.\n *\n * This provides a Type Guard that properties requiring a signed\n * transaction are non-null.\n */\n isSigned() {\n return this.signature != null;\n }\n #getSerialized(signed, sidecar) {\n assert(!signed || this.signature != null, \"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized\", \"UNSUPPORTED_OPERATION\", { operation: \".serialized\" });\n const sig = signed ? this.signature : null;\n switch (this.inferType()) {\n case 0:\n return _serializeLegacy(this, sig);\n case 1:\n return _serializeEip2930(this, sig);\n case 2:\n return _serializeEip1559(this, sig);\n case 3:\n return _serializeEip4844(this, sig, sidecar ? this.blobs : null);\n case 4:\n return _serializeEip7702(this, sig);\n }\n assert(false, \"unsupported transaction type\", \"UNSUPPORTED_OPERATION\", { operation: \".serialized\" });\n }\n /**\n * The serialized transaction.\n *\n * This throws if the transaction is unsigned. For the pre-image,\n * use [[unsignedSerialized]].\n */\n get serialized() {\n return this.#getSerialized(true, true);\n }\n /**\n * The transaction pre-image.\n *\n * The hash of this is the digest which needs to be signed to\n * authorize this transaction.\n */\n get unsignedSerialized() {\n return this.#getSerialized(false, false);\n }\n /**\n * Return the most \"likely\" type; currently the highest\n * supported transaction type.\n */\n inferType() {\n const types = this.inferTypes();\n // Prefer London (EIP-1559) over Cancun (BLOb)\n if (types.indexOf(2) >= 0) {\n return 2;\n }\n // Return the highest inferred type\n return (types.pop());\n }\n /**\n * Validates the explicit properties and returns a list of compatible\n * transaction types.\n */\n inferTypes() {\n // Checks that there are no conflicting properties set\n const hasGasPrice = this.gasPrice != null;\n const hasFee = (this.maxFeePerGas != null || this.maxPriorityFeePerGas != null);\n const hasAccessList = (this.accessList != null);\n const hasBlob = (this.#maxFeePerBlobGas != null || this.#blobVersionedHashes);\n //if (hasGasPrice && hasFee) {\n // throw new Error(\"transaction cannot have gasPrice and maxFeePerGas\");\n //}\n if (this.maxFeePerGas != null && this.maxPriorityFeePerGas != null) {\n assert(this.maxFeePerGas >= this.maxPriorityFeePerGas, \"priorityFee cannot be more than maxFee\", \"BAD_DATA\", { value: this });\n }\n //if (this.type === 2 && hasGasPrice) {\n // throw new Error(\"eip-1559 transaction cannot have gasPrice\");\n //}\n assert(!hasFee || (this.type !== 0 && this.type !== 1), \"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas\", \"BAD_DATA\", { value: this });\n assert(this.type !== 0 || !hasAccessList, \"legacy transaction cannot have accessList\", \"BAD_DATA\", { value: this });\n const types = [];\n // Explicit type\n if (this.type != null) {\n types.push(this.type);\n }\n else {\n if (this.authorizationList && this.authorizationList.length) {\n types.push(4);\n }\n else if (hasFee) {\n types.push(2);\n }\n else if (hasGasPrice) {\n types.push(1);\n if (!hasAccessList) {\n types.push(0);\n }\n }\n else if (hasAccessList) {\n types.push(1);\n types.push(2);\n }\n else if (hasBlob && this.to) {\n types.push(3);\n }\n else {\n types.push(0);\n types.push(1);\n types.push(2);\n types.push(3);\n }\n }\n types.sort();\n return types;\n }\n /**\n * Returns true if this transaction is a legacy transaction (i.e.\n * ``type === 0``).\n *\n * This provides a Type Guard that the related properties are\n * non-null.\n */\n isLegacy() {\n return (this.type === 0);\n }\n /**\n * Returns true if this transaction is berlin hardform transaction (i.e.\n * ``type === 1``).\n *\n * This provides a Type Guard that the related properties are\n * non-null.\n */\n isBerlin() {\n return (this.type === 1);\n }\n /**\n * Returns true if this transaction is london hardform transaction (i.e.\n * ``type === 2``).\n *\n * This provides a Type Guard that the related properties are\n * non-null.\n */\n isLondon() {\n return (this.type === 2);\n }\n /**\n * Returns true if this transaction is an [[link-eip-4844]] BLOB\n * transaction.\n *\n * This provides a Type Guard that the related properties are\n * non-null.\n */\n isCancun() {\n return (this.type === 3);\n }\n /**\n * Create a copy of this transaciton.\n */\n clone() {\n return Transaction.from(this);\n }\n /**\n * Return a JSON-friendly object.\n */\n toJSON() {\n const s = (v) => {\n if (v == null) {\n return null;\n }\n return v.toString();\n };\n return {\n type: this.type,\n to: this.to,\n // from: this.from,\n data: this.data,\n nonce: this.nonce,\n gasLimit: s(this.gasLimit),\n gasPrice: s(this.gasPrice),\n maxPriorityFeePerGas: s(this.maxPriorityFeePerGas),\n maxFeePerGas: s(this.maxFeePerGas),\n value: s(this.value),\n chainId: s(this.chainId),\n sig: this.signature ? this.signature.toJSON() : null,\n accessList: this.accessList\n };\n }\n [inspect]() {\n return this.toString();\n }\n toString() {\n const output = [];\n const add = (key) => {\n let value = this[key];\n if (typeof (value) === \"string\") {\n value = JSON.stringify(value);\n }\n output.push(`${key}: ${value}`);\n };\n if (this.type) {\n add(\"type\");\n }\n add(\"to\");\n add(\"data\");\n add(\"nonce\");\n add(\"gasLimit\");\n add(\"value\");\n if (this.chainId != null) {\n add(\"chainId\");\n }\n if (this.signature) {\n add(\"from\");\n output.push(`signature: ${this.signature.toString()}`);\n }\n // @TODO: accessList\n // @TODO: blobs (might make output huge; maybe just include a flag?)\n const auths = this.authorizationList;\n if (auths) {\n const outputAuths = [];\n for (const auth of auths) {\n const o = [];\n o.push(`address: ${JSON.stringify(auth.address)}`);\n if (auth.nonce != null) {\n o.push(`nonce: ${auth.nonce}`);\n }\n if (auth.chainId != null) {\n o.push(`chainId: ${auth.chainId}`);\n }\n if (auth.signature) {\n o.push(`signature: ${auth.signature.toString()}`);\n }\n outputAuths.push(`Authorization { ${o.join(\", \")} }`);\n }\n output.push(`authorizations: [ ${outputAuths.join(\", \")} ]`);\n }\n return `Transaction { ${output.join(\", \")} }`;\n }\n /**\n * Create a **Transaction** from a serialized transaction or a\n * Transaction-like object.\n */\n static from(tx) {\n if (tx == null) {\n return new Transaction();\n }\n if (typeof (tx) === \"string\") {\n const payload = getBytes(tx);\n if (payload[0] >= 0x7f) { // @TODO: > vs >= ??\n return Transaction.from(_parseLegacy(payload));\n }\n switch (payload[0]) {\n case 1: return Transaction.from(_parseEip2930(payload));\n case 2: return Transaction.from(_parseEip1559(payload));\n case 3: return Transaction.from(_parseEip4844(payload));\n case 4: return Transaction.from(_parseEip7702(payload));\n }\n assert(false, \"unsupported transaction type\", \"UNSUPPORTED_OPERATION\", { operation: \"from\" });\n }\n const result = new Transaction();\n if (tx.type != null) {\n result.type = tx.type;\n }\n if (tx.to != null) {\n result.to = tx.to;\n }\n if (tx.nonce != null) {\n result.nonce = tx.nonce;\n }\n if (tx.gasLimit != null) {\n result.gasLimit = tx.gasLimit;\n }\n if (tx.gasPrice != null) {\n result.gasPrice = tx.gasPrice;\n }\n if (tx.maxPriorityFeePerGas != null) {\n result.maxPriorityFeePerGas = tx.maxPriorityFeePerGas;\n }\n if (tx.maxFeePerGas != null) {\n result.maxFeePerGas = tx.maxFeePerGas;\n }\n if (tx.maxFeePerBlobGas != null) {\n result.maxFeePerBlobGas = tx.maxFeePerBlobGas;\n }\n if (tx.data != null) {\n result.data = tx.data;\n }\n if (tx.value != null) {\n result.value = tx.value;\n }\n if (tx.chainId != null) {\n result.chainId = tx.chainId;\n }\n if (tx.signature != null) {\n result.signature = Signature.from(tx.signature);\n }\n if (tx.accessList != null) {\n result.accessList = tx.accessList;\n }\n if (tx.authorizationList != null) {\n result.authorizationList = tx.authorizationList;\n }\n // This will get overwritten by blobs, if present\n if (tx.blobVersionedHashes != null) {\n result.blobVersionedHashes = tx.blobVersionedHashes;\n }\n // Make sure we assign the kzg before assigning blobs, which\n // require the library in the event raw blob data is provided.\n if (tx.kzg != null) {\n result.kzg = tx.kzg;\n }\n if (tx.blobWrapperVersion != null) {\n result.blobWrapperVersion = tx.blobWrapperVersion;\n }\n if (tx.blobs != null) {\n result.blobs = tx.blobs;\n }\n if (tx.hash != null) {\n assertArgument(result.isSigned(), \"unsigned transaction cannot define '.hash'\", \"tx\", tx);\n assertArgument(result.hash === tx.hash, \"hash mismatch\", \"tx\", tx);\n }\n if (tx.from != null) {\n assertArgument(result.isSigned(), \"unsigned transaction cannot define '.from'\", \"tx\", tx);\n assertArgument(result.from.toLowerCase() === (tx.from || \"\").toLowerCase(), \"from mismatch\", \"tx\", tx);\n }\n return result;\n }\n}\n//# sourceMappingURL=transaction.js.map","//import { TypedDataDomain, TypedDataField } from \"@ethersproject/providerabstract-signer\";\nimport { getAddress } from \"../address/index.js\";\nimport { keccak256 } from \"../crypto/index.js\";\nimport { recoverAddress } from \"../transaction/index.js\";\nimport { concat, defineProperties, getBigInt, getBytes, hexlify, isHexString, mask, toBeHex, toQuantity, toTwos, zeroPadValue, assertArgument } from \"../utils/index.js\";\nimport { id } from \"./id.js\";\nconst padding = new Uint8Array(32);\npadding.fill(0);\nconst BN__1 = BigInt(-1);\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_MAX_UINT256 = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n;\n;\nfunction hexPadRight(value) {\n const bytes = getBytes(value);\n const padOffset = bytes.length % 32;\n if (padOffset) {\n return concat([bytes, padding.slice(padOffset)]);\n }\n return hexlify(bytes);\n}\nconst hexTrue = toBeHex(BN_1, 32);\nconst hexFalse = toBeHex(BN_0, 32);\nconst domainFieldTypes = {\n name: \"string\",\n version: \"string\",\n chainId: \"uint256\",\n verifyingContract: \"address\",\n salt: \"bytes32\"\n};\nconst domainFieldNames = [\n \"name\", \"version\", \"chainId\", \"verifyingContract\", \"salt\"\n];\nfunction checkString(key) {\n return function (value) {\n assertArgument(typeof (value) === \"string\", `invalid domain value for ${JSON.stringify(key)}`, `domain.${key}`, value);\n return value;\n };\n}\nconst domainChecks = {\n name: checkString(\"name\"),\n version: checkString(\"version\"),\n chainId: function (_value) {\n const value = getBigInt(_value, \"domain.chainId\");\n assertArgument(value >= 0, \"invalid chain ID\", \"domain.chainId\", _value);\n if (Number.isSafeInteger(value)) {\n return Number(value);\n }\n return toQuantity(value);\n },\n verifyingContract: function (value) {\n try {\n return getAddress(value).toLowerCase();\n }\n catch (error) { }\n assertArgument(false, `invalid domain value \"verifyingContract\"`, \"domain.verifyingContract\", value);\n },\n salt: function (value) {\n const bytes = getBytes(value, \"domain.salt\");\n assertArgument(bytes.length === 32, `invalid domain value \"salt\"`, \"domain.salt\", value);\n return hexlify(bytes);\n }\n};\nfunction getBaseEncoder(type) {\n // intXX and uintXX\n {\n const match = type.match(/^(u?)int(\\d+)$/);\n if (match) {\n const signed = (match[1] === \"\");\n const width = parseInt(match[2]);\n assertArgument(width % 8 === 0 && width !== 0 && width <= 256 && match[2] === String(width), \"invalid numeric width\", \"type\", type);\n const boundsUpper = mask(BN_MAX_UINT256, signed ? (width - 1) : width);\n const boundsLower = signed ? ((boundsUpper + BN_1) * BN__1) : BN_0;\n return function (_value) {\n const value = getBigInt(_value, \"value\");\n assertArgument(value >= boundsLower && value <= boundsUpper, `value out-of-bounds for ${type}`, \"value\", value);\n return toBeHex(signed ? toTwos(value, 256) : value, 32);\n };\n }\n }\n // bytesXX\n {\n const match = type.match(/^bytes(\\d+)$/);\n if (match) {\n const width = parseInt(match[1]);\n assertArgument(width !== 0 && width <= 32 && match[1] === String(width), \"invalid bytes width\", \"type\", type);\n return function (value) {\n const bytes = getBytes(value);\n assertArgument(bytes.length === width, `invalid length for ${type}`, \"value\", value);\n return hexPadRight(value);\n };\n }\n }\n switch (type) {\n case \"address\": return function (value) {\n return zeroPadValue(getAddress(value), 32);\n };\n case \"bool\": return function (value) {\n return ((!value) ? hexFalse : hexTrue);\n };\n case \"bytes\": return function (value) {\n return keccak256(value);\n };\n case \"string\": return function (value) {\n return id(value);\n };\n }\n return null;\n}\nfunction encodeType(name, fields) {\n return `${name}(${fields.map(({ name, type }) => (type + \" \" + name)).join(\",\")})`;\n}\n// foo[][3] => { base: \"foo\", index: \"[][3]\", array: {\n// base: \"foo\", prefix: \"foo[]\", count: 3 } }\nfunction splitArray(type) {\n const match = type.match(/^([^\\x5b]*)((\\x5b\\d*\\x5d)*)(\\x5b(\\d*)\\x5d)$/);\n if (match) {\n return {\n base: match[1],\n index: (match[2] + match[4]),\n array: {\n base: match[1],\n prefix: (match[1] + match[2]),\n count: (match[5] ? parseInt(match[5]) : -1),\n }\n };\n }\n return { base: type };\n}\n/**\n * A **TypedDataEncode** prepares and encodes [[link-eip-712]] payloads\n * for signed typed data.\n *\n * This is useful for those that wish to compute various components of a\n * typed data hash, primary types, or sub-components, but generally the\n * higher level [[Signer-signTypedData]] is more useful.\n */\nexport class TypedDataEncoder {\n /**\n * The primary type for the structured [[types]].\n *\n * This is derived automatically from the [[types]], since no\n * recursion is possible, once the DAG for the types is consturcted\n * internally, the primary type must be the only remaining type with\n * no parent nodes.\n */\n primaryType;\n #types;\n /**\n * The types.\n */\n get types() {\n return JSON.parse(this.#types);\n }\n #fullTypes;\n #encoderCache;\n /**\n * Create a new **TypedDataEncoder** for %%types%%.\n *\n * This performs all necessary checking that types are valid and\n * do not violate the [[link-eip-712]] structural constraints as\n * well as computes the [[primaryType]].\n */\n constructor(_types) {\n this.#fullTypes = new Map();\n this.#encoderCache = new Map();\n // Link struct types to their direct child structs\n const links = new Map();\n // Link structs to structs which contain them as a child\n const parents = new Map();\n // Link all subtypes within a given struct\n const subtypes = new Map();\n const types = {};\n Object.keys(_types).forEach((type) => {\n types[type] = _types[type].map(({ name, type }) => {\n // Normalize the base type (unless name conflict)\n let { base, index } = splitArray(type);\n if (base === \"int\" && !_types[\"int\"]) {\n base = \"int256\";\n }\n if (base === \"uint\" && !_types[\"uint\"]) {\n base = \"uint256\";\n }\n return { name, type: (base + (index || \"\")) };\n });\n links.set(type, new Set());\n parents.set(type, []);\n subtypes.set(type, new Set());\n });\n this.#types = JSON.stringify(types);\n for (const name in types) {\n const uniqueNames = new Set();\n for (const field of types[name]) {\n // Check each field has a unique name\n assertArgument(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, \"types\", _types);\n uniqueNames.add(field.name);\n // Get the base type (drop any array specifiers)\n const baseType = splitArray(field.type).base;\n assertArgument(baseType !== name, `circular type reference to ${JSON.stringify(baseType)}`, \"types\", _types);\n // Is this a base encoding type?\n const encoder = getBaseEncoder(baseType);\n if (encoder) {\n continue;\n }\n assertArgument(parents.has(baseType), `unknown type ${JSON.stringify(baseType)}`, \"types\", _types);\n // Add linkage\n parents.get(baseType).push(name);\n links.get(name).add(baseType);\n }\n }\n // Deduce the primary type\n const primaryTypes = Array.from(parents.keys()).filter((n) => (parents.get(n).length === 0));\n assertArgument(primaryTypes.length !== 0, \"missing primary type\", \"types\", _types);\n assertArgument(primaryTypes.length === 1, `ambiguous primary types or unused types: ${primaryTypes.map((t) => (JSON.stringify(t))).join(\", \")}`, \"types\", _types);\n defineProperties(this, { primaryType: primaryTypes[0] });\n // Check for circular type references\n function checkCircular(type, found) {\n assertArgument(!found.has(type), `circular type reference to ${JSON.stringify(type)}`, \"types\", _types);\n found.add(type);\n for (const child of links.get(type)) {\n if (!parents.has(child)) {\n continue;\n }\n // Recursively check children\n checkCircular(child, found);\n // Mark all ancestors as having this decendant\n for (const subtype of found) {\n subtypes.get(subtype).add(child);\n }\n }\n found.delete(type);\n }\n checkCircular(this.primaryType, new Set());\n // Compute each fully describe type\n for (const [name, set] of subtypes) {\n const st = Array.from(set);\n st.sort();\n this.#fullTypes.set(name, encodeType(name, types[name]) + st.map((t) => encodeType(t, types[t])).join(\"\"));\n }\n }\n /**\n * Returnthe encoder for the specific %%type%%.\n */\n getEncoder(type) {\n let encoder = this.#encoderCache.get(type);\n if (!encoder) {\n encoder = this.#getEncoder(type);\n this.#encoderCache.set(type, encoder);\n }\n return encoder;\n }\n #getEncoder(type) {\n // Basic encoder type (address, bool, uint256, etc)\n {\n const encoder = getBaseEncoder(type);\n if (encoder) {\n return encoder;\n }\n }\n // Array\n const array = splitArray(type).array;\n if (array) {\n const subtype = array.prefix;\n const subEncoder = this.getEncoder(subtype);\n return (value) => {\n assertArgument(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${array.count}`, \"value\", value);\n let result = value.map(subEncoder);\n if (this.#fullTypes.has(subtype)) {\n result = result.map(keccak256);\n }\n return keccak256(concat(result));\n };\n }\n // Struct\n const fields = this.types[type];\n if (fields) {\n const encodedType = id(this.#fullTypes.get(type));\n return (value) => {\n const values = fields.map(({ name, type }) => {\n const result = this.getEncoder(type)(value[name]);\n if (this.#fullTypes.has(type)) {\n return keccak256(result);\n }\n return result;\n });\n values.unshift(encodedType);\n return concat(values);\n };\n }\n assertArgument(false, `unknown type: ${type}`, \"type\", type);\n }\n /**\n * Return the full type for %%name%%.\n */\n encodeType(name) {\n const result = this.#fullTypes.get(name);\n assertArgument(result, `unknown type: ${JSON.stringify(name)}`, \"name\", name);\n return result;\n }\n /**\n * Return the encoded %%value%% for the %%type%%.\n */\n encodeData(type, value) {\n return this.getEncoder(type)(value);\n }\n /**\n * Returns the hash of %%value%% for the type of %%name%%.\n */\n hashStruct(name, value) {\n return keccak256(this.encodeData(name, value));\n }\n /**\n * Return the fulled encoded %%value%% for the [[types]].\n */\n encode(value) {\n return this.encodeData(this.primaryType, value);\n }\n /**\n * Return the hash of the fully encoded %%value%% for the [[types]].\n */\n hash(value) {\n return this.hashStruct(this.primaryType, value);\n }\n /**\n * @_ignore:\n */\n _visit(type, value, callback) {\n // Basic encoder type (address, bool, uint256, etc)\n {\n const encoder = getBaseEncoder(type);\n if (encoder) {\n return callback(type, value);\n }\n }\n // Array\n const array = splitArray(type).array;\n if (array) {\n assertArgument(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${array.count}`, \"value\", value);\n return value.map((v) => this._visit(array.prefix, v, callback));\n }\n // Struct\n const fields = this.types[type];\n if (fields) {\n return fields.reduce((accum, { name, type }) => {\n accum[name] = this._visit(type, value[name], callback);\n return accum;\n }, {});\n }\n assertArgument(false, `unknown type: ${type}`, \"type\", type);\n }\n /**\n * Call %%calback%% for each value in %%value%%, passing the type and\n * component within %%value%%.\n *\n * This is useful for replacing addresses or other transformation that\n * may be desired on each component, based on its type.\n */\n visit(value, callback) {\n return this._visit(this.primaryType, value, callback);\n }\n /**\n * Create a new **TypedDataEncoder** for %%types%%.\n */\n static from(types) {\n return new TypedDataEncoder(types);\n }\n /**\n * Return the primary type for %%types%%.\n */\n static getPrimaryType(types) {\n return TypedDataEncoder.from(types).primaryType;\n }\n /**\n * Return the hashed struct for %%value%% using %%types%% and %%name%%.\n */\n static hashStruct(name, types, value) {\n return TypedDataEncoder.from(types).hashStruct(name, value);\n }\n /**\n * Return the domain hash for %%domain%%.\n */\n static hashDomain(domain) {\n const domainFields = [];\n for (const name in domain) {\n if (domain[name] == null) {\n continue;\n }\n const type = domainFieldTypes[name];\n assertArgument(type, `invalid typed-data domain key: ${JSON.stringify(name)}`, \"domain\", domain);\n domainFields.push({ name, type });\n }\n domainFields.sort((a, b) => {\n return domainFieldNames.indexOf(a.name) - domainFieldNames.indexOf(b.name);\n });\n return TypedDataEncoder.hashStruct(\"EIP712Domain\", { EIP712Domain: domainFields }, domain);\n }\n /**\n * Return the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%.\n */\n static encode(domain, types, value) {\n return concat([\n \"0x1901\",\n TypedDataEncoder.hashDomain(domain),\n TypedDataEncoder.from(types).hash(value)\n ]);\n }\n /**\n * Return the hash of the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%.\n */\n static hash(domain, types, value) {\n return keccak256(TypedDataEncoder.encode(domain, types, value));\n }\n // Replaces all address types with ENS names with their looked up address\n /**\n * Resolves to the value from resolving all addresses in %%value%% for\n * %%types%% and the %%domain%%.\n */\n static async resolveNames(domain, types, value, resolveName) {\n // Make a copy to isolate it from the object passed in\n domain = Object.assign({}, domain);\n // Allow passing null to ignore value\n for (const key in domain) {\n if (domain[key] == null) {\n delete domain[key];\n }\n }\n // Look up all ENS names\n const ensCache = {};\n // Do we need to look up the domain's verifyingContract?\n if (domain.verifyingContract && !isHexString(domain.verifyingContract, 20)) {\n ensCache[domain.verifyingContract] = \"0x\";\n }\n // We are going to use the encoder to visit all the base values\n const encoder = TypedDataEncoder.from(types);\n // Get a list of all the addresses\n encoder.visit(value, (type, value) => {\n if (type === \"address\" && !isHexString(value, 20)) {\n ensCache[value] = \"0x\";\n }\n return value;\n });\n // Lookup each name\n for (const name in ensCache) {\n ensCache[name] = await resolveName(name);\n }\n // Replace the domain verifyingContract if needed\n if (domain.verifyingContract && ensCache[domain.verifyingContract]) {\n domain.verifyingContract = ensCache[domain.verifyingContract];\n }\n // Replace all ENS names with their address\n value = encoder.visit(value, (type, value) => {\n if (type === \"address\" && ensCache[value]) {\n return ensCache[value];\n }\n return value;\n });\n return { domain, value };\n }\n /**\n * Returns the JSON-encoded payload expected by nodes which implement\n * the JSON-RPC [[link-eip-712]] method.\n */\n static getPayload(domain, types, value) {\n // Validate the domain fields\n TypedDataEncoder.hashDomain(domain);\n // Derive the EIP712Domain Struct reference type\n const domainValues = {};\n const domainTypes = [];\n domainFieldNames.forEach((name) => {\n const value = domain[name];\n if (value == null) {\n return;\n }\n domainValues[name] = domainChecks[name](value);\n domainTypes.push({ name, type: domainFieldTypes[name] });\n });\n const encoder = TypedDataEncoder.from(types);\n // Get the normalized types\n types = encoder.types;\n const typesWithDomain = Object.assign({}, types);\n assertArgument(typesWithDomain.EIP712Domain == null, \"types must not contain EIP712Domain type\", \"types.EIP712Domain\", types);\n typesWithDomain.EIP712Domain = domainTypes;\n // Validate the data structures and types\n encoder.encode(value);\n return {\n types: typesWithDomain,\n domain: domainValues,\n primaryType: encoder.primaryType,\n message: encoder.visit(value, (type, value) => {\n // bytes\n if (type.match(/^bytes(\\d*)/)) {\n return hexlify(getBytes(value));\n }\n // uint or int\n if (type.match(/^u?int/)) {\n return getBigInt(value).toString();\n }\n switch (type) {\n case \"address\":\n return value.toLowerCase();\n case \"bool\":\n return !!value;\n case \"string\":\n assertArgument(typeof (value) === \"string\", \"invalid string\", \"value\", value);\n return value;\n }\n assertArgument(false, \"unsupported type\", \"type\", type);\n })\n };\n }\n}\n/**\n * Compute the address used to sign the typed data for the %%signature%%.\n */\nexport function verifyTypedData(domain, types, value, signature) {\n return recoverAddress(TypedDataEncoder.hash(domain, types, value), signature);\n}\n//# sourceMappingURL=typed-data.js.map","/**\n * About bytes32 strings...\n *\n * @_docloc: api/utils:Bytes32 Strings\n */\nimport { getBytes, toUtf8Bytes, toUtf8String, zeroPadBytes } from \"../utils/index.js\";\n/**\n * Encodes %%text%% as a Bytes32 string.\n */\nexport function encodeBytes32String(text) {\n // Get the bytes\n const bytes = toUtf8Bytes(text);\n // Check we have room for null-termination\n if (bytes.length > 31) {\n throw new Error(\"bytes32 string must be less than 32 bytes\");\n }\n // Zero-pad (implicitly null-terminates)\n return zeroPadBytes(bytes, 32);\n}\n/**\n * Encodes the Bytes32-encoded %%bytes%% into a string.\n */\nexport function decodeBytes32String(_bytes) {\n const data = getBytes(_bytes, \"bytes\");\n // Must be 32 bytes with a null-termination\n if (data.length !== 32) {\n throw new Error(\"invalid bytes32 - not 32 bytes long\");\n }\n if (data[31] !== 0) {\n throw new Error(\"invalid bytes32 string - no null terminator\");\n }\n // Find the null termination\n let length = 31;\n while (data[length - 1] === 0) {\n length--;\n }\n // Determine the string value\n return toUtf8String(data.slice(0, length));\n}\n//# sourceMappingURL=bytes32.js.map","import { defineProperties } from \"../utils/properties.js\";\nimport { assertArgument } from \"../utils/index.js\";\nconst EnsAddress = \"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e\";\nconst inspect = Symbol.for(\"nodejs.util.inspect.custom\");\n/**\n * A **NetworkPlugin** provides additional functionality on a [[Network]].\n */\nexport class NetworkPlugin {\n /**\n * The name of the plugin.\n *\n * It is recommended to use reverse-domain-notation, which permits\n * unique names with a known authority as well as hierarchal entries.\n */\n name;\n /**\n * Creates a new **NetworkPlugin**.\n */\n constructor(name) {\n defineProperties(this, { name });\n }\n [inspect]() { return this.toString(); }\n toString() {\n return `${this.name} { }`;\n }\n /**\n * Creates a copy of this plugin.\n */\n clone() {\n return new NetworkPlugin(this.name);\n }\n}\n/**\n * A **GasCostPlugin** allows a network to provide alternative values when\n * computing the intrinsic gas required for a transaction.\n */\nexport class GasCostPlugin extends NetworkPlugin {\n /**\n * The block number to treat these values as valid from.\n *\n * This allows a hardfork to have updated values included as well as\n * mulutiple hardforks to be supported.\n */\n effectiveBlock;\n /**\n * The transactions base fee.\n */\n txBase;\n /**\n * The fee for creating a new account.\n */\n txCreate;\n /**\n * The fee per zero-byte in the data.\n */\n txDataZero;\n /**\n * The fee per non-zero-byte in the data.\n */\n txDataNonzero;\n /**\n * The fee per storage key in the [[link-eip-2930]] access list.\n */\n txAccessListStorageKey;\n /**\n * The fee per address in the [[link-eip-2930]] access list.\n */\n txAccessListAddress;\n /**\n * Creates a new GasCostPlugin from %%effectiveBlock%% until the\n * latest block or another GasCostPlugin supercedes that block number,\n * with the associated %%costs%%.\n */\n constructor(effectiveBlock, costs) {\n if (effectiveBlock == null) {\n effectiveBlock = 0;\n }\n super(`org.ethers.network.plugins.GasCost#${(effectiveBlock || 0)}`);\n const props = { effectiveBlock };\n function set(name, nullish) {\n let value = (costs || {})[name];\n if (value == null) {\n value = nullish;\n }\n assertArgument(typeof (value) === \"number\", `invalud value for ${name}`, \"costs\", costs);\n props[name] = value;\n }\n set(\"txBase\", 21000);\n set(\"txCreate\", 32000);\n set(\"txDataZero\", 4);\n set(\"txDataNonzero\", 16);\n set(\"txAccessListStorageKey\", 1900);\n set(\"txAccessListAddress\", 2400);\n defineProperties(this, props);\n }\n toString() {\n return `${this.name} { txBase: ${this.txBase}, txCreate: ${this.txCreate}, txDataZero: ${this.txDataZero}, txAccessListStorageKey: ${this.txAccessListStorageKey}, txAccessListAddress: ${this.txAccessListAddress} }`;\n }\n clone() {\n return new GasCostPlugin(this.effectiveBlock, this);\n }\n}\n/**\n * An **EnsPlugin** allows a [[Network]] to specify the ENS Registry\n * Contract address and the target network to use when using that\n * contract.\n *\n * Various testnets have their own instance of the contract to use, but\n * in general, the mainnet instance supports multi-chain addresses and\n * should be used.\n */\nexport class EnsPlugin extends NetworkPlugin {\n /**\n * The ENS Registrty Contract address.\n */\n address;\n /**\n * The chain ID that the ENS contract lives on.\n */\n targetNetwork;\n /**\n * The Universal Resolver Contract Address.\n */\n universalResolver;\n /**\n * Creates a new **EnsPlugin** connected to %%address%% on the\n * %%targetNetwork%%. The default ENS address and mainnet is used\n * if unspecified.\n */\n constructor(address, targetNetwork, universalResolver) {\n super(\"org.ethers.plugins.network.Ens\");\n defineProperties(this, {\n address: (address || EnsAddress),\n targetNetwork: ((targetNetwork == null) ? 1 : targetNetwork),\n universalResolver\n });\n }\n toString() {\n return `${this.name} { address: ${this.address}, targetNetwork: ${this.targetNetwork}, universalResolver: ${this.universalResolver} }`;\n }\n clone() {\n return new EnsPlugin(this.address, this.targetNetwork, this.universalResolver);\n }\n}\n/**\n * A **FeeDataNetworkPlugin** allows a network to provide and alternate\n * means to specify its fee data.\n *\n * For example, a network which does not support [[link-eip-1559]] may\n * choose to use a Gas Station site to approximate the gas price.\n */\nexport class FeeDataNetworkPlugin extends NetworkPlugin {\n #feeDataFunc;\n /**\n * The fee data function provided to the constructor.\n */\n get feeDataFunc() {\n return this.#feeDataFunc;\n }\n /**\n * Creates a new **FeeDataNetworkPlugin**.\n */\n constructor(feeDataFunc) {\n super(\"org.ethers.plugins.network.FeeData\");\n this.#feeDataFunc = feeDataFunc;\n }\n /**\n * Resolves to the fee data.\n */\n async getFeeData(provider) {\n return await this.#feeDataFunc(provider);\n }\n clone() {\n return new FeeDataNetworkPlugin(this.#feeDataFunc);\n }\n}\nexport class FetchUrlFeeDataNetworkPlugin extends NetworkPlugin {\n #url;\n #processFunc;\n /**\n * The URL to initialize the FetchRequest with in %%processFunc%%.\n */\n get url() { return this.#url; }\n /**\n * The callback to use when computing the FeeData.\n */\n get processFunc() { return this.#processFunc; }\n /**\n * Creates a new **FetchUrlFeeDataNetworkPlugin** which will\n * be used when computing the fee data for the network.\n */\n constructor(url, processFunc) {\n super(\"org.ethers.plugins.network.FetchUrlFeeDataPlugin\");\n this.#url = url;\n this.#processFunc = processFunc;\n }\n toString() {\n return `${this.name} { url: ${this.url} }`;\n }\n // We are immutable, so we can serve as our own clone\n clone() { return this; }\n}\n/*\nexport class CustomBlockNetworkPlugin extends NetworkPlugin {\n readonly #blockFunc: (provider: Provider, block: BlockParams<string>) => Block<string>;\n readonly #blockWithTxsFunc: (provider: Provider, block: BlockParams<TransactionResponseParams>) => Block<TransactionResponse>;\n\n constructor(blockFunc: (provider: Provider, block: BlockParams<string>) => Block<string>, blockWithTxsFunc: (provider: Provider, block: BlockParams<TransactionResponseParams>) => Block<TransactionResponse>) {\n super(\"org.ethers.network-plugins.custom-block\");\n this.#blockFunc = blockFunc;\n this.#blockWithTxsFunc = blockWithTxsFunc;\n }\n\n async getBlock(provider: Provider, block: BlockParams<string>): Promise<Block<string>> {\n return await this.#blockFunc(provider, block);\n }\n\n async getBlockions(provider: Provider, block: BlockParams<TransactionResponseParams>): Promise<Block<TransactionResponse>> {\n return await this.#blockWithTxsFunc(provider, block);\n }\n\n clone(): CustomBlockNetworkPlugin {\n return new CustomBlockNetworkPlugin(this.#blockFunc, this.#blockWithTxsFunc);\n }\n}\n*/\n//# sourceMappingURL=plugins-network.js.map","/**\n * A **Network** encapsulates the various properties required to\n * interact with a specific chain.\n *\n * @_subsection: api/providers:Networks [networks]\n */\nimport { accessListify } from \"../transaction/index.js\";\nimport { getBigInt, assert, assertArgument } from \"../utils/index.js\";\nimport { EnsPlugin, FetchUrlFeeDataNetworkPlugin, GasCostPlugin } from \"./plugins-network.js\";\nconst inspect = Symbol.for(\"nodejs.util.inspect.custom\");\n/* * * *\n// Networks which operation against an L2 can use this plugin to\n// specify how to access L1, for the purpose of resolving ENS,\n// for example.\nexport class LayerOneConnectionPlugin extends NetworkPlugin {\n readonly provider!: Provider;\n// @TODO: Rename to ChainAccess and allow for connecting to any chain\n constructor(provider: Provider) {\n super(\"org.ethers.plugins.layer-one-connection\");\n defineProperties<LayerOneConnectionPlugin>(this, { provider });\n }\n\n clone(): LayerOneConnectionPlugin {\n return new LayerOneConnectionPlugin(this.provider);\n }\n}\n*/\nconst Networks = new Map();\n/**\n * A **Network** provides access to a chain's properties and allows\n * for plug-ins to extend functionality.\n */\nexport class Network {\n #name;\n #chainId;\n #plugins;\n /**\n * Creates a new **Network** for %%name%% and %%chainId%%.\n */\n constructor(name, chainId) {\n this.#name = name;\n this.#chainId = getBigInt(chainId);\n this.#plugins = new Map();\n }\n [inspect]() { return this.toString(); }\n toString() {\n const plugins = [];\n for (const plugin of this.#plugins.values()) {\n plugins.push(plugin.toString());\n }\n return `Network { name: ${this.name}, chainId: ${this.chainId}, plugins: [ ${plugins.join(\", \")} ] }`;\n }\n /**\n * Returns a JSON-compatible representation of a Network.\n */\n toJSON() {\n return { name: this.name, chainId: String(this.chainId) };\n }\n /**\n * The network common name.\n *\n * This is the canonical name, as networks migh have multiple\n * names.\n */\n get name() { return this.#name; }\n set name(value) { this.#name = value; }\n /**\n * The network chain ID.\n */\n get chainId() { return this.#chainId; }\n set chainId(value) { this.#chainId = getBigInt(value, \"chainId\"); }\n /**\n * Returns true if %%other%% matches this network. Any chain ID\n * must match, and if no chain ID is present, the name must match.\n *\n * This method does not currently check for additional properties,\n * such as ENS address or plug-in compatibility.\n */\n matches(other) {\n if (other == null) {\n return false;\n }\n if (typeof (other) === \"string\") {\n try {\n return (this.chainId === getBigInt(other));\n }\n catch (error) { }\n return (this.name === other);\n }\n if (typeof (other) === \"number\" || typeof (other) === \"bigint\") {\n try {\n return (this.chainId === getBigInt(other));\n }\n catch (error) { }\n return false;\n }\n if (typeof (other) === \"object\") {\n if (other.chainId != null) {\n try {\n return (this.chainId === getBigInt(other.chainId));\n }\n catch (error) { }\n return false;\n }\n if (other.name != null) {\n return (this.name === other.name);\n }\n return false;\n }\n return false;\n }\n /**\n * Returns the list of plugins currently attached to this Network.\n */\n get plugins() {\n return Array.from(this.#plugins.values());\n }\n /**\n * Attach a new %%plugin%% to this Network. The network name\n * must be unique, excluding any fragment.\n */\n attachPlugin(plugin) {\n if (this.#plugins.get(plugin.name)) {\n throw new Error(`cannot replace existing plugin: ${plugin.name} `);\n }\n this.#plugins.set(plugin.name, plugin.clone());\n return this;\n }\n /**\n * Return the plugin, if any, matching %%name%% exactly. Plugins\n * with fragments will not be returned unless %%name%% includes\n * a fragment.\n */\n getPlugin(name) {\n return (this.#plugins.get(name)) || null;\n }\n /**\n * Gets a list of all plugins that match %%name%%, with otr without\n * a fragment.\n */\n getPlugins(basename) {\n return (this.plugins.filter((p) => (p.name.split(\"#\")[0] === basename)));\n }\n /**\n * Create a copy of this Network.\n */\n clone() {\n const clone = new Network(this.name, this.chainId);\n this.plugins.forEach((plugin) => {\n clone.attachPlugin(plugin.clone());\n });\n return clone;\n }\n /**\n * Compute the intrinsic gas required for a transaction.\n *\n * A GasCostPlugin can be attached to override the default\n * values.\n */\n computeIntrinsicGas(tx) {\n const costs = this.getPlugin(\"org.ethers.plugins.network.GasCost\") || (new GasCostPlugin());\n let gas = costs.txBase;\n if (tx.to == null) {\n gas += costs.txCreate;\n }\n if (tx.data) {\n for (let i = 2; i < tx.data.length; i += 2) {\n if (tx.data.substring(i, i + 2) === \"00\") {\n gas += costs.txDataZero;\n }\n else {\n gas += costs.txDataNonzero;\n }\n }\n }\n if (tx.accessList) {\n const accessList = accessListify(tx.accessList);\n for (const addr in accessList) {\n gas += costs.txAccessListAddress + costs.txAccessListStorageKey * accessList[addr].storageKeys.length;\n }\n }\n return gas;\n }\n /**\n * Returns a new Network for the %%network%% name or chainId.\n */\n static from(network) {\n injectCommonNetworks();\n // Default network\n if (network == null) {\n return Network.from(\"mainnet\");\n }\n // Canonical name or chain ID\n if (typeof (network) === \"number\") {\n network = BigInt(network);\n }\n if (typeof (network) === \"string\" || typeof (network) === \"bigint\") {\n const networkFunc = Networks.get(network);\n if (networkFunc) {\n return networkFunc();\n }\n if (typeof (network) === \"bigint\") {\n return new Network(\"unknown\", network);\n }\n assertArgument(false, \"unknown network\", \"network\", network);\n }\n // Clonable with network-like abilities\n if (typeof (network.clone) === \"function\") {\n const clone = network.clone();\n //if (typeof(network.name) !== \"string\" || typeof(network.chainId) !== \"number\") {\n //}\n return clone;\n }\n // Networkish\n if (typeof (network) === \"object\") {\n assertArgument(typeof (network.name) === \"string\" && typeof (network.chainId) === \"number\", \"invalid network object name or chainId\", \"network\", network);\n const custom = new Network((network.name), (network.chainId));\n const n = network;\n if (n.ensAddress || n.ensNetwork != null || n.ensUniversalResolver) {\n custom.attachPlugin(new EnsPlugin(n.ensAddress, n.ensNetwork, n.ensUniversalResolver));\n }\n //if ((<any>network).layerOneConnection) {\n // custom.attachPlugin(new LayerOneConnectionPlugin((<any>network).layerOneConnection));\n //}\n return custom;\n }\n assertArgument(false, \"invalid network\", \"network\", network);\n }\n /**\n * Register %%nameOrChainId%% with a function which returns\n * an instance of a Network representing that chain.\n */\n static register(nameOrChainId, networkFunc) {\n if (typeof (nameOrChainId) === \"number\") {\n nameOrChainId = BigInt(nameOrChainId);\n }\n const existing = Networks.get(nameOrChainId);\n if (existing) {\n assertArgument(false, `conflicting network for ${JSON.stringify(existing.name)}`, \"nameOrChainId\", nameOrChainId);\n }\n Networks.set(nameOrChainId, networkFunc);\n }\n}\n// We don't want to bring in formatUnits because it is backed by\n// FixedNumber and we want to keep Networks tiny. The values\n// included by the Gas Stations are also IEEE 754 with lots of\n// rounding issues and exceed the strict checks formatUnits has.\nfunction parseUnits(_value, decimals) {\n const value = String(_value);\n if (!value.match(/^[0-9.]+$/)) {\n throw new Error(`invalid gwei value: ${_value}`);\n }\n // Break into [ whole, fraction ]\n const comps = value.split(\".\");\n if (comps.length === 1) {\n comps.push(\"\");\n }\n // More than 1 decimal point or too many fractional positions\n if (comps.length !== 2) {\n throw new Error(`invalid gwei value: ${_value}`);\n }\n // Pad the fraction to 9 decimalplaces\n while (comps[1].length < decimals) {\n comps[1] += \"0\";\n }\n // Too many decimals and some non-zero ending, take the ceiling\n if (comps[1].length > 9) {\n let frac = BigInt(comps[1].substring(0, 9));\n if (!comps[1].substring(9).match(/^0+$/)) {\n frac++;\n }\n comps[1] = frac.toString();\n }\n return BigInt(comps[0] + comps[1]);\n}\n// Used by Polygon to use a gas station for fee data\nfunction getGasStationPlugin(url) {\n return new FetchUrlFeeDataNetworkPlugin(url, async (fetchFeeData, provider, request) => {\n // Prevent Cloudflare from blocking our request in node.js\n request.setHeader(\"User-Agent\", \"ethers\");\n let response;\n try {\n const [_response, _feeData] = await Promise.all([\n request.send(), fetchFeeData()\n ]);\n response = _response;\n const payload = response.bodyJson.standard;\n const feeData = {\n gasPrice: _feeData.gasPrice,\n maxFeePerGas: parseUnits(payload.maxFee, 9),\n maxPriorityFeePerGas: parseUnits(payload.maxPriorityFee, 9),\n };\n return feeData;\n }\n catch (error) {\n assert(false, `error encountered with polygon gas station (${JSON.stringify(request.url)})`, \"SERVER_ERROR\", { request, response, error });\n }\n });\n}\n// See: https://chainlist.org\nlet injected = false;\nfunction injectCommonNetworks() {\n if (injected) {\n return;\n }\n injected = true;\n /// Register popular Ethereum networks\n function registerEth(name, chainId, options) {\n const func = function () {\n const network = new Network(name, chainId);\n // We use 0 to disable ENS\n if (options.ensNetwork != null) {\n network.attachPlugin(new EnsPlugin(null, options.ensNetwork, options.ensUniversalResolver));\n }\n network.attachPlugin(new GasCostPlugin());\n (options.plugins || []).forEach((plugin) => {\n network.attachPlugin(plugin);\n });\n return network;\n };\n // Register the network by name and chain ID\n Network.register(name, func);\n Network.register(chainId, func);\n if (options.altNames) {\n options.altNames.forEach((name) => {\n Network.register(name, func);\n });\n }\n }\n // Proxy address\n const ensUniversalResolver = \"0xeEeEEEeE14D718C2B47D9923Deab1335E144EeEe\";\n registerEth(\"mainnet\", 1, {\n ensUniversalResolver, ensNetwork: 1, altNames: [\"homestead\"]\n });\n registerEth(\"ropsten\", 3, { ensNetwork: 3 });\n registerEth(\"rinkeby\", 4, { ensNetwork: 4 });\n registerEth(\"goerli\", 5, { ensNetwork: 5 });\n registerEth(\"kovan\", 42, { ensNetwork: 42 });\n registerEth(\"sepolia\", 11155111, {\n ensUniversalResolver, ensNetwork: 11155111\n });\n registerEth(\"holesky\", 17000, { ensNetwork: 17000 });\n registerEth(\"classic\", 61, {});\n registerEth(\"classicKotti\", 6, {});\n registerEth(\"arbitrum\", 42161, {\n ensNetwork: 1,\n });\n registerEth(\"arbitrum-goerli\", 421613, {});\n registerEth(\"arbitrum-sepolia\", 421614, {});\n registerEth(\"base\", 8453, { ensNetwork: 1 });\n registerEth(\"base-goerli\", 84531, {});\n registerEth(\"base-sepolia\", 84532, {});\n registerEth(\"bnb\", 56, { ensNetwork: 1 });\n registerEth(\"bnbt\", 97, {});\n registerEth(\"filecoin\", 314, {});\n registerEth(\"filecoin-calibration\", 314159, {});\n registerEth(\"linea\", 59144, { ensNetwork: 1 });\n registerEth(\"linea-goerli\", 59140, {});\n registerEth(\"linea-sepolia\", 59141, {});\n registerEth(\"matic\", 137, {\n ensNetwork: 1,\n plugins: [\n getGasStationPlugin(\"https:/\\/gasstation.polygon.technology/v2\")\n ]\n });\n registerEth(\"matic-amoy\", 80002, {});\n registerEth(\"matic-mumbai\", 80001, {\n altNames: [\"maticMumbai\", \"maticmum\"],\n plugins: [\n getGasStationPlugin(\"https:/\\/gasstation-testnet.polygon.technology/v2\")\n ]\n });\n registerEth(\"optimism\", 10, {\n ensNetwork: 1,\n plugins: []\n });\n registerEth(\"optimism-goerli\", 420, {});\n registerEth(\"optimism-sepolia\", 11155420, {});\n registerEth(\"xdai\", 100, { ensNetwork: 1 });\n}\n//# sourceMappingURL=network.js.map","/**\n * ENS is a service which allows easy-to-remember names to map to\n * network addresses.\n *\n * @_section: api/providers/ens-resolver:ENS Resolver [about-ens-rsolver]\n */\nimport { getAddress } from \"../address/index.js\";\nimport { ZeroAddress } from \"../constants/index.js\";\nimport { Contract } from \"../contract/index.js\";\nimport { dnsEncode, ensNormalize, isValidName, namehash } from \"../hash/index.js\";\nimport { getBigInt, hexlify, isHexString, toBeHex, defineProperties, encodeBase58, assert, assertArgument, isError, FetchRequest } from \"../utils/index.js\";\nconst BN_60 = BigInt(60);\n// @TODO: This should use the fetch-data:ipfs gateway\n// Trim off the ipfs:// prefix and return the default gateway URL\nfunction getIpfsLink(link) {\n if (link.match(/^ipfs:\\/\\/ipfs\\//i)) {\n link = link.substring(12);\n }\n else if (link.match(/^ipfs:\\/\\//i)) {\n link = link.substring(7);\n }\n else {\n assertArgument(false, \"unsupported IPFS format\", \"link\", link);\n }\n return `https:/\\/gateway.ipfs.io/ipfs/${link}`;\n}\n;\n;\n/**\n * A provider plugin super-class for processing multicoin address types.\n */\nexport class MulticoinProviderPlugin {\n /**\n * The name.\n */\n name;\n /**\n * Creates a new **MulticoinProviderPluing** for %%name%%.\n */\n constructor(name) {\n defineProperties(this, { name });\n }\n connect(provider) {\n return this;\n }\n /**\n * Returns ``true`` if %%coinType%% is supported by this plugin.\n */\n supportsCoinType(coinType) {\n return false;\n }\n /**\n * Resolves to the encoded %%address%% for %%coinType%%.\n */\n async encodeAddress(coinType, address) {\n throw new Error(\"unsupported coin\");\n }\n /**\n * Resolves to the decoded %%data%% for %%coinType%%.\n */\n async decodeAddress(coinType, data) {\n throw new Error(\"unsupported coin\");\n }\n}\nconst BasicMulticoinPluginId = \"org.ethers.plugins.provider.BasicMulticoin\";\n/**\n * A **BasicMulticoinProviderPlugin** provides service for common\n * coin types, which do not require additional libraries to encode or\n * decode.\n */\nexport class BasicMulticoinProviderPlugin extends MulticoinProviderPlugin {\n /**\n * Creates a new **BasicMulticoinProviderPlugin**.\n */\n constructor() {\n super(BasicMulticoinPluginId);\n }\n}\nconst matcherIpfs = new RegExp(\"^(ipfs):/\\/(.*)$\", \"i\");\nconst matchers = [\n new RegExp(\"^(https):/\\/(.*)$\", \"i\"),\n new RegExp(\"^(data):(.*)$\", \"i\"),\n matcherIpfs,\n new RegExp(\"^eip155:[0-9]+/(erc[0-9]+):(.*)$\", \"i\"),\n];\nfunction isEvmCoinType(coinType) {\n return (coinType === BN_60) ||\n (coinType >= 0x80000000 && coinType <= 0xffffffff);\n}\n/**\n * A connected object to a resolved ENS name resolver, which can be\n * used to query additional details.\n */\nexport class EnsResolver {\n /**\n * The connected provider.\n */\n provider;\n /**\n * The address of the resolver.\n */\n address;\n /**\n * The name this resolver was resolved against.\n */\n name;\n // For EIP-2544 names, the ancestor that provided the resolver\n #supports2544;\n #resolver;\n constructor(provider, address, name, supportsWildcard) {\n defineProperties(this, { provider, address, name });\n this.#supports2544 = (supportsWildcard != null) ? Promise.resolve(supportsWildcard) : null;\n this.#resolver = new Contract(address, [\n \"function supportsInterface(bytes4) view returns (bool)\",\n \"function resolve(bytes, bytes) view returns (bytes)\",\n \"function addr(bytes32) view returns (address)\",\n \"function addr(bytes32, uint) view returns (bytes)\",\n \"function text(bytes32, string) view returns (string)\",\n \"function contenthash(bytes32) view returns (bytes)\",\n \"function name(bytes32) view returns (string)\",\n ], provider);\n }\n /**\n * Resolves to true if the resolver supports wildcard resolution.\n */\n async supportsWildcard() {\n if (this.#supports2544 == null) {\n this.#supports2544 = (async () => {\n try {\n return await this.#resolver.supportsInterface(\"0x9061b923\");\n }\n catch (error) {\n // Wildcard resolvers must understand supportsInterface\n // and return true.\n if (isError(error, \"CALL_EXCEPTION\")) {\n return false;\n }\n // Let future attempts try again...\n this.#supports2544 = null;\n throw error;\n }\n })();\n }\n return await this.#supports2544;\n }\n async #fetch(funcName, params) {\n params = (params || []).slice();\n const iface = this.#resolver.interface;\n // The first parameters is always the nodehash\n params.unshift(namehash(this.name));\n let fragment = null;\n if (await this.supportsWildcard()) {\n fragment = iface.getFunction(funcName);\n assert(fragment, \"missing fragment\", \"UNKNOWN_ERROR\", {\n info: { funcName }\n });\n params = [\n dnsEncode(this.name, 255),\n iface.encodeFunctionData(fragment, params)\n ];\n funcName = \"resolve(bytes,bytes)\";\n }\n params.push({ enableCcipRead: true });\n try {\n const result = await this.#resolver[funcName](...params);\n if (fragment) {\n return iface.decodeFunctionResult(fragment, result)[0];\n }\n return result;\n }\n catch (error) {\n if (!isError(error, \"CALL_EXCEPTION\")) {\n throw error;\n }\n }\n return null;\n }\n /**\n * Resolves to the address for %%coinType%% or null if the\n * provided %%coinType%% has not been configured.\n */\n async getAddress(_coinType) {\n const coinType = (_coinType == null) ? BN_60 : getBigInt(_coinType);\n if (coinType === BN_60) {\n try {\n const result = await this.#fetch(\"addr(bytes32)\");\n // No address\n if (result == null || result === ZeroAddress) {\n return null;\n }\n return result;\n }\n catch (error) {\n if (isError(error, \"CALL_EXCEPTION\")) {\n return null;\n }\n throw error;\n }\n }\n if (isEvmCoinType(coinType)) {\n const data = await this.#fetch(\"addr(bytes32,uint)\", [coinType]);\n if (isHexString(data, 20)) {\n return getAddress(data);\n }\n return null;\n }\n // Try decoding its EVM canonical chain as an EVM chain address first\n if (coinType >= 0 && coinType < 0x80000000) {\n let ethCoinType = coinType + BigInt(0x80000000);\n const data = await this.#fetch(\"addr(bytes32,uint)\", [ethCoinType]);\n if (isHexString(data, 20)) {\n return getAddress(data);\n }\n }\n // @TODO: add a new method to the MulticoinProviderPlugin and move\n // this check above the auto-eth-decoding chunk above to give the\n // plugin a chance to process the coinType and result\n let coinPlugin = null;\n for (const plugin of this.provider.plugins) {\n if (!(plugin instanceof MulticoinProviderPlugin)) {\n continue;\n }\n if (coinType <= 0x80000000 && plugin.supportsCoinType(Number(coinType))) {\n coinPlugin = plugin;\n break;\n }\n }\n if (coinPlugin == null) {\n return null;\n }\n // keccak256(\"addr(bytes32,uint256\")\n const data = await this.#fetch(\"addr(bytes32,uint)\", [coinType]);\n // No address\n if (data == null || data === \"0x\") {\n return null;\n }\n if (coinType < 0x80000000) {\n // Compute the address\n const address = await coinPlugin.decodeAddress(Number(coinType), data);\n if (address != null) {\n return address;\n }\n }\n assert(false, `invalid coin data`, \"UNSUPPORTED_OPERATION\", {\n operation: `getAddress(${coinType})`,\n info: { coinType, data }\n });\n }\n /**\n * Resolves to the EIP-634 text record for %%key%%, or ``null``\n * if unconfigured.\n */\n async getText(key) {\n const data = await this.#fetch(\"text(bytes32,string)\", [key]);\n if (data == null || data === \"0x\") {\n return null;\n }\n return data;\n }\n /**\n * Rsolves to the content-hash or ``null`` if unconfigured.\n */\n async getContentHash() {\n // keccak256(\"contenthash()\")\n const data = await this.#fetch(\"contenthash(bytes32)\");\n // No contenthash\n if (data == null || data === \"0x\") {\n return null;\n }\n // IPFS (CID: 1, Type: 70=DAG-PB, 72=libp2p-key)\n const ipfs = data.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);\n if (ipfs) {\n const scheme = (ipfs[1] === \"e3010170\") ? \"ipfs\" : \"ipns\";\n const length = parseInt(ipfs[4], 16);\n if (ipfs[5].length === length * 2) {\n return `${scheme}:/\\/${encodeBase58(\"0x\" + ipfs[2])}`;\n }\n }\n // Swarm (CID: 1, Type: swarm-manifest; hash/length hard-coded to keccak256/32)\n const swarm = data.match(/^0xe40101fa011b20([0-9a-f]*)$/);\n if (swarm && swarm[1].length === 64) {\n return `bzz:/\\/${swarm[1]}`;\n }\n assert(false, `invalid or unsupported content hash data`, \"UNSUPPORTED_OPERATION\", {\n operation: \"getContentHash()\",\n info: { data }\n });\n }\n async getName() {\n return await this.#fetch(\"name(bytes32)\");\n }\n /**\n * Resolves to the avatar url or ``null`` if the avatar is either\n * unconfigured or incorrectly configured (e.g. references an NFT\n * not owned by the address).\n *\n * If diagnosing issues with configurations, the [[_getAvatar]]\n * method may be useful.\n */\n async getAvatar() {\n const avatar = await this._getAvatar();\n return avatar.url;\n }\n /**\n * When resolving an avatar, there are many steps involved, such\n * fetching metadata and possibly validating ownership of an\n * NFT.\n *\n * This method can be used to examine each step and the value it\n * was working from.\n */\n async _getAvatar() {\n const linkage = [{ type: \"name\", value: this.name }];\n try {\n // test data for ricmoo.eth\n //const avatar = \"eip155:1/erc721:0x265385c7f4132228A0d54EB1A9e7460b91c0cC68/29233\";\n const avatar = await this.getText(\"avatar\");\n if (avatar == null) {\n linkage.push({ type: \"!avatar\", value: \"\" });\n return { url: null, linkage };\n }\n linkage.push({ type: \"avatar\", value: avatar });\n for (let i = 0; i < matchers.length; i++) {\n const match = avatar.match(matchers[i]);\n if (match == null) {\n continue;\n }\n const scheme = match[1].toLowerCase();\n switch (scheme) {\n case \"https\":\n case \"data\":\n linkage.push({ type: \"url\", value: avatar });\n return { linkage, url: avatar };\n case \"ipfs\": {\n const url = getIpfsLink(avatar);\n linkage.push({ type: \"ipfs\", value: avatar });\n linkage.push({ type: \"url\", value: url });\n return { linkage, url };\n }\n case \"erc721\":\n case \"erc1155\": {\n // Depending on the ERC type, use tokenURI(uint256) or url(uint256)\n const selector = (scheme === \"erc721\") ? \"tokenURI(uint256)\" : \"uri(uint256)\";\n linkage.push({ type: scheme, value: avatar });\n // The owner of this name\n const owner = await this.getAddress();\n if (owner == null) {\n linkage.push({ type: \"!owner\", value: \"\" });\n return { url: null, linkage };\n }\n const comps = (match[2] || \"\").split(\"/\");\n if (comps.length !== 2) {\n linkage.push({ type: `!${scheme}caip`, value: (match[2] || \"\") });\n return { url: null, linkage };\n }\n const tokenId = comps[1];\n const contract = new Contract(comps[0], [\n // ERC-721\n \"function tokenURI(uint) view returns (string)\",\n \"function ownerOf(uint) view returns (address)\",\n // ERC-1155\n \"function uri(uint) view returns (string)\",\n \"function balanceOf(address, uint256) view returns (uint)\"\n ], this.provider);\n // Check that this account owns the token\n if (scheme === \"erc721\") {\n const tokenOwner = await contract.ownerOf(tokenId);\n if (owner !== tokenOwner) {\n linkage.push({ type: \"!owner\", value: tokenOwner });\n return { url: null, linkage };\n }\n linkage.push({ type: \"owner\", value: tokenOwner });\n }\n else if (scheme === \"erc1155\") {\n const balance = await contract.balanceOf(owner, tokenId);\n if (!balance) {\n linkage.push({ type: \"!balance\", value: \"0\" });\n return { url: null, linkage };\n }\n linkage.push({ type: \"balance\", value: balance.toString() });\n }\n // Call the token contract for the metadata URL\n let metadataUrl = await contract[selector](tokenId);\n if (metadataUrl == null || metadataUrl === \"0x\") {\n linkage.push({ type: \"!metadata-url\", value: \"\" });\n return { url: null, linkage };\n }\n linkage.push({ type: \"metadata-url-base\", value: metadataUrl });\n // ERC-1155 allows a generic {id} in the URL\n if (scheme === \"erc1155\") {\n metadataUrl = metadataUrl.replace(\"{id}\", toBeHex(tokenId, 32).substring(2));\n linkage.push({ type: \"metadata-url-expanded\", value: metadataUrl });\n }\n // Transform IPFS metadata links\n if (metadataUrl.match(/^ipfs:/i)) {\n metadataUrl = getIpfsLink(metadataUrl);\n }\n linkage.push({ type: \"metadata-url\", value: metadataUrl });\n // Get the token metadata\n let metadata = {};\n const response = await (new FetchRequest(metadataUrl)).send();\n response.assertOk();\n try {\n metadata = response.bodyJson;\n }\n catch (error) {\n try {\n linkage.push({ type: \"!metadata\", value: response.bodyText });\n }\n catch (error) {\n const bytes = response.body;\n if (bytes) {\n linkage.push({ type: \"!metadata\", value: hexlify(bytes) });\n }\n return { url: null, linkage };\n }\n return { url: null, linkage };\n }\n if (!metadata) {\n linkage.push({ type: \"!metadata\", value: \"\" });\n return { url: null, linkage };\n }\n linkage.push({ type: \"metadata\", value: JSON.stringify(metadata) });\n // Pull the image URL out\n let imageUrl = metadata.image;\n if (typeof (imageUrl) !== \"string\") {\n linkage.push({ type: \"!imageUrl\", value: \"\" });\n return { url: null, linkage };\n }\n if (imageUrl.match(/^(https:\\/\\/|data:)/i)) {\n // Allow\n }\n else {\n // Transform IPFS link to gateway\n const ipfs = imageUrl.match(matcherIpfs);\n if (ipfs == null) {\n linkage.push({ type: \"!imageUrl-ipfs\", value: imageUrl });\n return { url: null, linkage };\n }\n linkage.push({ type: \"imageUrl-ipfs\", value: imageUrl });\n imageUrl = getIpfsLink(imageUrl);\n }\n linkage.push({ type: \"url\", value: imageUrl });\n return { linkage, url: imageUrl };\n }\n }\n }\n }\n catch (error) { }\n return { linkage, url: null };\n }\n static async getEnsAddress(provider) {\n const network = await provider.getNetwork();\n const ensPlugin = network.getPlugin(\"org.ethers.plugins.network.Ens\");\n // No ENS...\n assert(ensPlugin, \"network does not support ENS\", \"UNSUPPORTED_OPERATION\", {\n operation: \"getEnsAddress\", info: { network }\n });\n return ensPlugin.address;\n }\n static async getUniversalResolverAddress(provider) {\n const network = await provider.getNetwork();\n const ensPlugin = network.getPlugin(\"org.ethers.plugins.network.Ens\");\n if (ensPlugin && ensPlugin.universalResolver) {\n return ensPlugin.universalResolver;\n }\n return null;\n }\n static async #getResolver(provider, name) {\n const ensAddr = await EnsResolver.getEnsAddress(provider);\n try {\n const contract = new Contract(ensAddr, [\n \"function resolver(bytes32) view returns (address)\"\n ], provider);\n const addr = await contract.resolver(namehash(name), {\n enableCcipRead: true\n });\n if (addr === ZeroAddress) {\n return null;\n }\n return addr;\n }\n catch (error) {\n // ENS registry cannot throw errors on resolver(bytes32),\n // so probably a link error\n throw error;\n }\n return null;\n }\n static async lookupAddress(provider, address, _coinType) {\n const coinType = (_coinType == null) ? BN_60 : getBigInt(_coinType);\n if (isEvmCoinType(coinType)) {\n address = getAddress(address);\n }\n // We have a Universal resolver, use it\n const universal = await createUniversal(provider);\n if (universal) {\n try {\n const result = await universal.reverse(address, coinType, {\n enableCcipRead: true\n });\n const addr = result.primary;\n if (!isValidName(addr)) {\n return null;\n }\n return addr;\n }\n catch (e) {\n if (isError(e, \"CALL_EXCEPTION\") && e.reason === \"ResolverNotFound(bytes)\") {\n return null;\n }\n throw e;\n }\n }\n // Use legacy reverse lookup\n assert(coinType === BN_60, \"lookupAddress coinType requires ENS Universal Resolver\", \"UNSUPPORTED_OPERATION\", {\n operation: \"lookupAddress\"\n });\n try {\n const resolver = await EnsResolver.fromName(provider, `${address.toLowerCase().substring(2)}.addr.reverse`);\n if (!resolver) {\n return null;\n }\n const name = await resolver.getName();\n if (name == null || !isValidName(name)) {\n return null;\n }\n // Failed forward resolution\n const check = await provider.resolveName(name);\n if (check !== address) {\n return null;\n }\n return name;\n }\n catch (error) {\n // No data was returned from the resolver\n if (isError(error, \"BAD_DATA\") && error.value === \"0x\") {\n return null;\n }\n // Something reverted\n if (isError(error, \"CALL_EXCEPTION\")) {\n return null;\n }\n throw error;\n }\n }\n /**\n * Resolve to the ENS resolver for %%name%% using %%provider%% or\n * ``null`` if unconfigured.\n */\n static async fromName(provider, name) {\n // We have a Universal Resolver, use it\n const universal = await createUniversal(provider);\n if (universal) {\n let dnsName;\n try {\n dnsName = dnsEncode(ensNormalize(name), 255);\n }\n catch (error) {\n // Should this emit an error in the provider debug event?\n return null;\n }\n const result = await universal.requireResolver(dnsName);\n return new EnsResolver(provider, result.resolver, name, result.extended);\n }\n let currentName = name;\n while (true) {\n if (currentName === \"\" || currentName === \".\") {\n return null;\n }\n // Optimization since the eth node cannot change and does\n // not have a wildcard resolver\n if (name !== \"eth\" && currentName === \"eth\") {\n return null;\n }\n // Check the current node for a resolver\n const addr = await EnsResolver.#getResolver(provider, currentName);\n // Found a resolver!\n if (addr != null) {\n const resolver = new EnsResolver(provider, addr, name);\n // Legacy resolver found, using EIP-2544 so it isn't safe to use\n if (currentName !== name && !(await resolver.supportsWildcard())) {\n return null;\n }\n return resolver;\n }\n // Get the parent node\n currentName = currentName.split(\".\").slice(1).join(\".\");\n }\n }\n}\nasync function createUniversal(provider) {\n const address = await EnsResolver.getUniversalResolverAddress(provider);\n if (!address) {\n return null;\n }\n return new Contract(address, [\n \"function requireResolver(bytes) view returns ((bytes name, uint256 offset, bytes32 node, address resolver, bool extended))\",\n \"function findResolver(bytes) view returns (address resolver, bytes32 node, uint offset)\",\n \"function resolve(bytes name, bytes data) view returns (bytes result, address resolver)\",\n \"function reverse(bytes name, uint coinType) view returns (string primary, address resolver, address reverseResolver)\",\n \"error ResolverNotFound(bytes name)\",\n \"error ResolverNotContract(bytes name, address resolver)\",\n \"error ReverseAddressMismatch(string primary, bytes primaryAddress)\",\n \"error HttpError(uint16 statusCode, string statusMessage)\"\n ], provider);\n}\n//# sourceMappingURL=ens-resolver.js.map","/**\n * @_ignore\n */\nimport { getAddress, getCreateAddress } from \"../address/index.js\";\nimport { Signature } from \"../crypto/index.js\";\nimport { accessListify } from \"../transaction/index.js\";\nimport { getBigInt, getNumber, hexlify, isHexString, zeroPadValue, assert, assertArgument } from \"../utils/index.js\";\nconst BN_0 = BigInt(0);\nexport function allowNull(format, nullValue) {\n return (function (value) {\n if (value == null) {\n return nullValue;\n }\n return format(value);\n });\n}\nexport function arrayOf(format, allowNull) {\n return ((array) => {\n if (allowNull && array == null) {\n return null;\n }\n if (!Array.isArray(array)) {\n throw new Error(\"not an array\");\n }\n return array.map((i) => format(i));\n });\n}\n// Requires an object which matches a fleet of other formatters\n// Any FormatFunc may return `undefined` to have the value omitted\n// from the result object. Calls preserve `this`.\nexport function object(format, altNames) {\n return ((value) => {\n const result = {};\n for (const key in format) {\n let srcKey = key;\n if (altNames && key in altNames && !(srcKey in value)) {\n for (const altKey of altNames[key]) {\n if (altKey in value) {\n srcKey = altKey;\n break;\n }\n }\n }\n try {\n const nv = format[key](value[srcKey]);\n if (nv !== undefined) {\n result[key] = nv;\n }\n }\n catch (error) {\n const message = (error instanceof Error) ? error.message : \"not-an-error\";\n assert(false, `invalid value for value.${key} (${message})`, \"BAD_DATA\", { value });\n }\n }\n return result;\n });\n}\nexport function formatBoolean(value) {\n switch (value) {\n case true:\n case \"true\":\n return true;\n case false:\n case \"false\":\n return false;\n }\n assertArgument(false, `invalid boolean; ${JSON.stringify(value)}`, \"value\", value);\n}\nexport function formatData(value) {\n assertArgument(isHexString(value, true), \"invalid data\", \"value\", value);\n return value;\n}\nexport function formatHash(value) {\n assertArgument(isHexString(value, 32), \"invalid hash\", \"value\", value);\n return value;\n}\nexport function formatUint256(value) {\n if (!isHexString(value)) {\n throw new Error(\"invalid uint256\");\n }\n return zeroPadValue(value, 32);\n}\nconst _formatLog = object({\n address: getAddress,\n blockHash: formatHash,\n blockNumber: getNumber,\n data: formatData,\n index: getNumber,\n removed: allowNull(formatBoolean, false),\n topics: arrayOf(formatHash),\n transactionHash: formatHash,\n transactionIndex: getNumber,\n}, {\n index: [\"logIndex\"]\n});\nexport function formatLog(value) {\n return _formatLog(value);\n}\nconst _formatBlock = object({\n hash: allowNull(formatHash),\n parentHash: formatHash,\n parentBeaconBlockRoot: allowNull(formatHash, null),\n number: getNumber,\n timestamp: getNumber,\n nonce: allowNull(formatData),\n difficulty: getBigInt,\n gasLimit: getBigInt,\n gasUsed: getBigInt,\n stateRoot: allowNull(formatHash, null),\n receiptsRoot: allowNull(formatHash, null),\n transactionsRoot: allowNull(formatHash, null),\n blobGasUsed: allowNull(getBigInt, null),\n excessBlobGas: allowNull(getBigInt, null),\n miner: allowNull(getAddress),\n prevRandao: allowNull(formatHash, null),\n extraData: formatData,\n baseFeePerGas: allowNull(getBigInt)\n}, {\n prevRandao: [\"mixHash\"]\n});\nexport function formatBlock(value) {\n const result = _formatBlock(value);\n result.transactions = value.transactions.map((tx) => {\n if (typeof (tx) === \"string\") {\n return tx;\n }\n return formatTransactionResponse(tx);\n });\n return result;\n}\nconst _formatReceiptLog = object({\n transactionIndex: getNumber,\n blockNumber: getNumber,\n transactionHash: formatHash,\n address: getAddress,\n topics: arrayOf(formatHash),\n data: formatData,\n index: getNumber,\n blockHash: formatHash,\n}, {\n index: [\"logIndex\"]\n});\nexport function formatReceiptLog(value) {\n return _formatReceiptLog(value);\n}\nconst _formatTransactionReceipt = object({\n to: allowNull(getAddress, null),\n from: allowNull(getAddress, null),\n contractAddress: allowNull(getAddress, null),\n // should be allowNull(hash), but broken-EIP-658 support is handled in receipt\n index: getNumber,\n root: allowNull(hexlify),\n gasUsed: getBigInt,\n blobGasUsed: allowNull(getBigInt, null),\n logsBloom: allowNull(formatData),\n blockHash: formatHash,\n hash: formatHash,\n logs: arrayOf(formatReceiptLog),\n blockNumber: getNumber,\n //confirmations: allowNull(getNumber, null),\n cumulativeGasUsed: getBigInt,\n effectiveGasPrice: allowNull(getBigInt),\n blobGasPrice: allowNull(getBigInt, null),\n status: allowNull(getNumber),\n type: allowNull(getNumber, 0)\n}, {\n effectiveGasPrice: [\"gasPrice\"],\n hash: [\"transactionHash\"],\n index: [\"transactionIndex\"],\n});\nexport function formatTransactionReceipt(value) {\n return _formatTransactionReceipt(value);\n}\nexport function formatTransactionResponse(value) {\n // Some clients (TestRPC) do strange things like return 0x0 for the\n // 0 address; correct this to be a real address\n if (value.to && getBigInt(value.to) === BN_0) {\n value.to = \"0x0000000000000000000000000000000000000000\";\n }\n const result = object({\n hash: formatHash,\n // Some nodes do not return this, usually test nodes (like Ganache)\n index: allowNull(getNumber, undefined),\n type: (value) => {\n if (value === \"0x\" || value == null) {\n return 0;\n }\n return getNumber(value);\n },\n accessList: allowNull(accessListify, null),\n blobVersionedHashes: allowNull(arrayOf(formatHash, true), null),\n authorizationList: allowNull(arrayOf((v) => {\n let sig;\n if (v.signature) {\n sig = v.signature;\n }\n else {\n let yParity = v.yParity;\n if (yParity === \"0x1b\") {\n yParity = 0;\n }\n else if (yParity === \"0x1c\") {\n yParity = 1;\n }\n sig = Object.assign({}, v, { yParity });\n }\n return {\n address: getAddress(v.address),\n chainId: getBigInt(v.chainId),\n nonce: getBigInt(v.nonce),\n signature: Signature.from(sig)\n };\n }, false), null),\n blockHash: allowNull(formatHash, null),\n blockNumber: allowNull(getNumber, null),\n transactionIndex: allowNull(getNumber, null),\n from: getAddress,\n // either (gasPrice) or (maxPriorityFeePerGas + maxFeePerGas) must be set\n gasPrice: allowNull(getBigInt),\n maxPriorityFeePerGas: allowNull(getBigInt),\n maxFeePerGas: allowNull(getBigInt),\n maxFeePerBlobGas: allowNull(getBigInt, null),\n gasLimit: getBigInt,\n to: allowNull(getAddress, null),\n value: getBigInt,\n nonce: getNumber,\n data: formatData,\n creates: allowNull(getAddress, null),\n chainId: allowNull(getBigInt, null)\n }, {\n data: [\"input\"],\n gasLimit: [\"gas\"],\n index: [\"transactionIndex\"]\n })(value);\n // If to and creates are empty, populate the creates from the value\n if (result.to == null && result.creates == null) {\n result.creates = getCreateAddress(result);\n }\n // @TODO: Check fee data\n // Add an access list to supported transaction types\n if ((value.type === 1 || value.type === 2) && value.accessList == null) {\n result.accessList = [];\n }\n // Compute the signature\n if (value.signature) {\n result.signature = Signature.from(value.signature);\n }\n else {\n result.signature = Signature.from(value);\n }\n // Some backends omit ChainId on legacy transactions, but we can compute it\n if (result.chainId == null) {\n const chainId = result.signature.legacyChainId;\n if (chainId != null) {\n result.chainId = chainId;\n }\n }\n // @TODO: check chainID\n /*\n if (value.chainId != null) {\n let chainId = value.chainId;\n\n if (isHexString(chainId)) {\n chainId = BigNumber.from(chainId).toNumber();\n }\n\n result.chainId = chainId;\n\n } else {\n let chainId = value.networkId;\n\n // geth-etc returns chainId\n if (chainId == null && result.v == null) {\n chainId = value.chainId;\n }\n\n if (isHexString(chainId)) {\n chainId = BigNumber.from(chainId).toNumber();\n }\n\n if (typeof(chainId) !== \"number\" && result.v != null) {\n chainId = (result.v - 35) / 2;\n if (chainId < 0) { chainId = 0; }\n chainId = parseInt(chainId);\n }\n\n if (typeof(chainId) !== \"number\") { chainId = 0; }\n\n result.chainId = chainId;\n }\n */\n // 0x0000... should actually be null\n if (result.blockHash && getBigInt(result.blockHash) === BN_0) {\n result.blockHash = null;\n }\n return result;\n}\n//# sourceMappingURL=format.js.map","import { assert, isHexString } from \"../utils/index.js\";\nfunction copy(obj) {\n return JSON.parse(JSON.stringify(obj));\n}\n/**\n * Return the polling subscriber for common events.\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport function getPollingSubscriber(provider, event) {\n if (event === \"block\") {\n return new PollingBlockSubscriber(provider);\n }\n if (isHexString(event, 32)) {\n return new PollingTransactionSubscriber(provider, event);\n }\n assert(false, \"unsupported polling event\", \"UNSUPPORTED_OPERATION\", {\n operation: \"getPollingSubscriber\", info: { event }\n });\n}\n// @TODO: refactor this\n/**\n * A **PollingBlockSubscriber** polls at a regular interval for a change\n * in the block number.\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class PollingBlockSubscriber {\n #provider;\n #poller;\n #interval;\n // The most recent block we have scanned for events. The value -2\n // indicates we still need to fetch an initial block number\n #blockNumber;\n /**\n * Create a new **PollingBlockSubscriber** attached to %%provider%%.\n */\n constructor(provider) {\n this.#provider = provider;\n this.#poller = null;\n this.#interval = 4000;\n this.#blockNumber = -2;\n }\n /**\n * The polling interval.\n */\n get pollingInterval() { return this.#interval; }\n set pollingInterval(value) { this.#interval = value; }\n async #poll() {\n try {\n const blockNumber = await this.#provider.getBlockNumber();\n // Bootstrap poll to setup our initial block number\n if (this.#blockNumber === -2) {\n this.#blockNumber = blockNumber;\n return;\n }\n // @TODO: Put a cap on the maximum number of events per loop?\n if (blockNumber !== this.#blockNumber) {\n for (let b = this.#blockNumber + 1; b <= blockNumber; b++) {\n // We have been stopped\n if (this.#poller == null) {\n return;\n }\n await this.#provider.emit(\"block\", b);\n }\n this.#blockNumber = blockNumber;\n }\n }\n catch (error) {\n // @TODO: Minor bump, add an \"error\" event to let subscribers\n // know things went awry.\n //console.log(error);\n }\n // We have been stopped\n if (this.#poller == null) {\n return;\n }\n this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval);\n }\n start() {\n if (this.#poller) {\n return;\n }\n this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval);\n this.#poll();\n }\n stop() {\n if (!this.#poller) {\n return;\n }\n this.#provider._clearTimeout(this.#poller);\n this.#poller = null;\n }\n pause(dropWhilePaused) {\n this.stop();\n if (dropWhilePaused) {\n this.#blockNumber = -2;\n }\n }\n resume() {\n this.start();\n }\n}\n/**\n * An **OnBlockSubscriber** can be sub-classed, with a [[_poll]]\n * implmentation which will be called on every new block.\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class OnBlockSubscriber {\n #provider;\n #poll;\n #running;\n /**\n * Create a new **OnBlockSubscriber** attached to %%provider%%.\n */\n constructor(provider) {\n this.#provider = provider;\n this.#running = false;\n this.#poll = (blockNumber) => {\n this._poll(blockNumber, this.#provider);\n };\n }\n /**\n * Called on every new block.\n */\n async _poll(blockNumber, provider) {\n throw new Error(\"sub-classes must override this\");\n }\n start() {\n if (this.#running) {\n return;\n }\n this.#running = true;\n this.#poll(-2);\n this.#provider.on(\"block\", this.#poll);\n }\n stop() {\n if (!this.#running) {\n return;\n }\n this.#running = false;\n this.#provider.off(\"block\", this.#poll);\n }\n pause(dropWhilePaused) { this.stop(); }\n resume() { this.start(); }\n}\nexport class PollingBlockTagSubscriber extends OnBlockSubscriber {\n #tag;\n #lastBlock;\n constructor(provider, tag) {\n super(provider);\n this.#tag = tag;\n this.#lastBlock = -2;\n }\n pause(dropWhilePaused) {\n if (dropWhilePaused) {\n this.#lastBlock = -2;\n }\n super.pause(dropWhilePaused);\n }\n async _poll(blockNumber, provider) {\n const block = await provider.getBlock(this.#tag);\n if (block == null) {\n return;\n }\n if (this.#lastBlock === -2) {\n this.#lastBlock = block.number;\n }\n else if (block.number > this.#lastBlock) {\n provider.emit(this.#tag, block.number);\n this.#lastBlock = block.number;\n }\n }\n}\n/**\n * @_ignore:\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class PollingOrphanSubscriber extends OnBlockSubscriber {\n #filter;\n constructor(provider, filter) {\n super(provider);\n this.#filter = copy(filter);\n }\n async _poll(blockNumber, provider) {\n throw new Error(\"@TODO\");\n console.log(this.#filter);\n }\n}\n/**\n * A **PollingTransactionSubscriber** will poll for a given transaction\n * hash for its receipt.\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class PollingTransactionSubscriber extends OnBlockSubscriber {\n #hash;\n /**\n * Create a new **PollingTransactionSubscriber** attached to\n * %%provider%%, listening for %%hash%%.\n */\n constructor(provider, hash) {\n super(provider);\n this.#hash = hash;\n }\n async _poll(blockNumber, provider) {\n const tx = await provider.getTransactionReceipt(this.#hash);\n if (tx) {\n provider.emit(this.#hash, tx);\n }\n }\n}\n/**\n * A **PollingEventSubscriber** will poll for a given filter for its logs.\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class PollingEventSubscriber {\n #provider;\n #filter;\n #poller;\n #running;\n // The most recent block we have scanned for events. The value -2\n // indicates we still need to fetch an initial block number\n #blockNumber;\n /**\n * Create a new **PollingTransactionSubscriber** attached to\n * %%provider%%, listening for %%filter%%.\n */\n constructor(provider, filter) {\n this.#provider = provider;\n this.#filter = copy(filter);\n this.#poller = this.#poll.bind(this);\n this.#running = false;\n this.#blockNumber = -2;\n }\n async #poll(blockNumber) {\n // The initial block hasn't been determined yet\n if (this.#blockNumber === -2) {\n return;\n }\n const filter = copy(this.#filter);\n filter.fromBlock = this.#blockNumber + 1;\n filter.toBlock = blockNumber;\n const logs = await this.#provider.getLogs(filter);\n // No logs could just mean the node has not indexed them yet,\n // so we keep a sliding window of 60 blocks to keep scanning\n if (logs.length === 0) {\n if (this.#blockNumber < blockNumber - 60) {\n this.#blockNumber = blockNumber - 60;\n }\n return;\n }\n for (const log of logs) {\n this.#provider.emit(this.#filter, log);\n // Only advance the block number when logs were found to\n // account for networks (like BNB and Polygon) which may\n // sacrifice event consistency for block event speed\n this.#blockNumber = log.blockNumber;\n }\n }\n start() {\n if (this.#running) {\n return;\n }\n this.#running = true;\n if (this.#blockNumber === -2) {\n this.#provider.getBlockNumber().then((blockNumber) => {\n this.#blockNumber = blockNumber;\n });\n }\n this.#provider.on(\"block\", this.#poller);\n }\n stop() {\n if (!this.#running) {\n return;\n }\n this.#running = false;\n this.#provider.off(\"block\", this.#poller);\n }\n pause(dropWhilePaused) {\n this.stop();\n if (dropWhilePaused) {\n this.#blockNumber = -2;\n }\n }\n resume() {\n this.start();\n }\n}\n//# sourceMappingURL=subscriber-polling.js.map","/**\n * The available providers should suffice for most developers purposes,\n * but the [[AbstractProvider]] class has many features which enable\n * sub-classing it for specific purposes.\n *\n * @_section: api/providers/abstract-provider: Subclassing Provider [abstract-provider]\n */\n// @TODO\n// Event coalescence\n// When we register an event with an async value (e.g. address is a Signer\n// or ENS name), we need to add it immeidately for the Event API, but also\n// need time to resolve the address. Upon resolving the address, we need to\n// migrate the listener to the static event. We also need to maintain a map\n// of Signer/ENS name to address so we can sync respond to listenerCount.\nimport { resolveAddress } from \"../address/index.js\";\nimport { Transaction } from \"../transaction/index.js\";\nimport { concat, dataLength, dataSlice, hexlify, isHexString, getBigInt, getBytes, getNumber, isCallException, makeError, assert, assertArgument, FetchRequest, toBeArray, toQuantity, defineProperties, EventPayload, resolveProperties, toUtf8String } from \"../utils/index.js\";\nimport { EnsResolver } from \"./ens-resolver.js\";\nimport { formatBlock, formatLog, formatTransactionReceipt, formatTransactionResponse } from \"./format.js\";\nimport { Network } from \"./network.js\";\nimport { copyRequest, Block, FeeData, Log, TransactionReceipt, TransactionResponse } from \"./provider.js\";\nimport { PollingBlockSubscriber, PollingBlockTagSubscriber, PollingEventSubscriber, PollingOrphanSubscriber, PollingTransactionSubscriber } from \"./subscriber-polling.js\";\n// Constants\nconst BN_2 = BigInt(2);\nconst MAX_CCIP_REDIRECTS = 10;\nfunction stall(duration) {\n return new Promise((resolve) => { setTimeout(resolve, duration); });\n}\nfunction isPromise(value) {\n return (value && typeof (value.then) === \"function\");\n}\nfunction getTag(prefix, value) {\n return prefix + \":\" + JSON.stringify(value, (k, v) => {\n if (v == null) {\n return \"null\";\n }\n if (typeof (v) === \"bigint\") {\n return `bigint:${v.toString()}`;\n }\n if (typeof (v) === \"string\") {\n return v.toLowerCase();\n }\n // Sort object keys\n if (typeof (v) === \"object\" && !Array.isArray(v)) {\n const keys = Object.keys(v);\n keys.sort();\n return keys.reduce((accum, key) => {\n accum[key] = v[key];\n return accum;\n }, {});\n }\n return v;\n });\n}\n/**\n * An **UnmanagedSubscriber** is useful for events which do not require\n * any additional management, such as ``\"debug\"`` which only requires\n * emit in synchronous event loop triggered calls.\n */\nexport class UnmanagedSubscriber {\n /**\n * The name fof the event.\n */\n name;\n /**\n * Create a new UnmanagedSubscriber with %%name%%.\n */\n constructor(name) { defineProperties(this, { name }); }\n start() { }\n stop() { }\n pause(dropWhilePaused) { }\n resume() { }\n}\nfunction copy(value) {\n return JSON.parse(JSON.stringify(value));\n}\nfunction concisify(items) {\n items = Array.from((new Set(items)).values());\n items.sort();\n return items;\n}\nasync function getSubscription(_event, provider) {\n if (_event == null) {\n throw new Error(\"invalid event\");\n }\n // Normalize topic array info an EventFilter\n if (Array.isArray(_event)) {\n _event = { topics: _event };\n }\n if (typeof (_event) === \"string\") {\n switch (_event) {\n case \"block\":\n case \"debug\":\n case \"error\":\n case \"finalized\":\n case \"network\":\n case \"pending\":\n case \"safe\": {\n return { type: _event, tag: _event };\n }\n }\n }\n if (isHexString(_event, 32)) {\n const hash = _event.toLowerCase();\n return { type: \"transaction\", tag: getTag(\"tx\", { hash }), hash };\n }\n if (_event.orphan) {\n const event = _event;\n // @TODO: Should lowercase and whatnot things here instead of copy...\n return { type: \"orphan\", tag: getTag(\"orphan\", event), filter: copy(event) };\n }\n if ((_event.address || _event.topics)) {\n const event = _event;\n const filter = {\n topics: ((event.topics || []).map((t) => {\n if (t == null) {\n return null;\n }\n if (Array.isArray(t)) {\n return concisify(t.map((t) => t.toLowerCase()));\n }\n return t.toLowerCase();\n }))\n };\n if (event.address) {\n const addresses = [];\n const promises = [];\n const addAddress = (addr) => {\n if (isHexString(addr)) {\n addresses.push(addr);\n }\n else {\n promises.push((async () => {\n addresses.push(await resolveAddress(addr, provider));\n })());\n }\n };\n if (Array.isArray(event.address)) {\n event.address.forEach(addAddress);\n }\n else {\n addAddress(event.address);\n }\n if (promises.length) {\n await Promise.all(promises);\n }\n filter.address = concisify(addresses.map((a) => a.toLowerCase()));\n }\n return { filter, tag: getTag(\"event\", filter), type: \"event\" };\n }\n assertArgument(false, \"unknown ProviderEvent\", \"event\", _event);\n}\nfunction getTime() { return (new Date()).getTime(); }\nconst defaultOptions = {\n cacheTimeout: 250,\n pollingInterval: 4000\n};\n/**\n * An **AbstractProvider** provides a base class for other sub-classes to\n * implement the [[Provider]] API by normalizing input arguments and\n * formatting output results as well as tracking events for consistent\n * behaviour on an eventually-consistent network.\n */\nexport class AbstractProvider {\n #subs;\n #plugins;\n // null=unpaused, true=paused+dropWhilePaused, false=paused\n #pausedState;\n #destroyed;\n #networkPromise;\n #anyNetwork;\n #performCache;\n // The most recent block number if running an event or -1 if no \"block\" event\n #lastBlockNumber;\n #nextTimer;\n #timers;\n #disableCcipRead;\n #requestRate;\n #requestTimes;\n #options;\n /**\n * Create a new **AbstractProvider** connected to %%network%%, or\n * use the various network detection capabilities to discover the\n * [[Network]] if necessary.\n */\n constructor(_network, options) {\n this.#options = Object.assign({}, defaultOptions, options || {});\n if (_network === \"any\") {\n this.#anyNetwork = true;\n this.#networkPromise = null;\n }\n else if (_network) {\n const network = Network.from(_network);\n this.#anyNetwork = false;\n this.#networkPromise = Promise.resolve(network);\n setTimeout(() => { this.emit(\"network\", network, null); }, 0);\n }\n else {\n this.#anyNetwork = false;\n this.#networkPromise = null;\n }\n this.#lastBlockNumber = -1;\n this.#performCache = new Map();\n this.#subs = new Map();\n this.#plugins = new Map();\n this.#pausedState = null;\n this.#destroyed = false;\n this.#nextTimer = 1;\n this.#timers = new Map();\n this.#disableCcipRead = false;\n this.#requestRate = 0;\n this.#requestTimes = [];\n }\n /**\n * Limit the number of requests per second. (default: no limit)\n */\n get _requestRate() {\n const value = this.#requestRate;\n if (value == 0) {\n return null;\n }\n return value;\n }\n set _requestRate(value) {\n if (value == null || value < 0) {\n value = 0;\n }\n this.#requestRate = getNumber(value);\n }\n get pollingInterval() { return this.#options.pollingInterval; }\n /**\n * Returns ``this``, to allow an **AbstractProvider** to implement\n * the [[ContractRunner]] interface.\n */\n get provider() { return this; }\n /**\n * Returns all the registered plug-ins.\n */\n get plugins() {\n return Array.from(this.#plugins.values());\n }\n /**\n * Attach a new plug-in.\n */\n attachPlugin(plugin) {\n if (this.#plugins.get(plugin.name)) {\n throw new Error(`cannot replace existing plugin: ${plugin.name} `);\n }\n this.#plugins.set(plugin.name, plugin.connect(this));\n return this;\n }\n /**\n * Get a plugin by name.\n */\n getPlugin(name) {\n return (this.#plugins.get(name)) || null;\n }\n /**\n * Prevent any CCIP-read operation, regardless of whether requested\n * in a [[call]] using ``enableCcipRead``.\n */\n get disableCcipRead() { return this.#disableCcipRead; }\n set disableCcipRead(value) { this.#disableCcipRead = !!value; }\n #getDelay() {\n let requestRate = this.#requestRate;\n if (requestRate === 0) {\n return 0;\n }\n // Remove all too-old request times\n const requests = this.#requestTimes;\n const now = getTime();\n requests.push(now);\n const scanTime = now - 1000;\n while (requests.length && requests[0] < scanTime) {\n requests.shift();\n }\n if (requests.length < requestRate) {\n return 0;\n }\n return (requests[0] + 1000) - now;\n }\n // Shares multiple identical requests made during the same 250ms\n async #perform(req) {\n const timeout = this.#options.cacheTimeout;\n // Caching disabled\n if (timeout < 0) {\n const delay = this.#getDelay();\n if (delay) {\n await stall(delay);\n }\n return await this._perform(req);\n }\n // Create a tag\n const tag = getTag(req.method, req);\n let perform = this.#performCache.get(tag);\n if (!perform) {\n const delay = this.#getDelay();\n if (delay) {\n await stall(delay);\n }\n perform = this._perform(req);\n this.#performCache.set(tag, perform);\n setTimeout(() => {\n if (this.#performCache.get(tag) === perform) {\n this.#performCache.delete(tag);\n }\n }, timeout);\n }\n return await perform;\n }\n /**\n * Resolves to the data for executing the CCIP-read operations.\n */\n async ccipReadFetch(tx, calldata, urls) {\n if (this.disableCcipRead || urls.length === 0 || tx.to == null) {\n return null;\n }\n const sender = tx.to.toLowerCase();\n const data = calldata.toLowerCase();\n const errorMessages = [];\n for (let i = 0; i < urls.length; i++) {\n const url = urls[i];\n // URL expansion\n const href = url.replace(\"{sender}\", sender).replace(\"{data}\", data);\n // If no {data} is present, use POST; otherwise GET\n //const json: string | null = (url.indexOf(\"{data}\") >= 0) ? null: JSON.stringify({ data, sender });\n //const result = await fetchJson({ url: href, errorPassThrough: true }, json, (value, response) => {\n // value.status = response.statusCode;\n // return value;\n //});\n const request = new FetchRequest(href);\n if (url.indexOf(\"{data}\") === -1) {\n request.body = { data, sender };\n }\n this.emit(\"debug\", { action: \"sendCcipReadFetchRequest\", request, index: i, urls });\n let errorMessage = \"unknown error\";\n // Fetch the resource...\n let resp;\n try {\n resp = await request.send();\n }\n catch (error) {\n // ...low-level fetch error (missing host, bad SSL, etc.),\n // so try next URL\n errorMessages.push(error.message);\n this.emit(\"debug\", { action: \"receiveCcipReadFetchError\", request, result: { error } });\n continue;\n }\n try {\n const result = resp.bodyJson;\n if (result.data) {\n this.emit(\"debug\", { action: \"receiveCcipReadFetchResult\", request, result });\n return result.data;\n }\n if (result.message) {\n errorMessage = result.message;\n }\n this.emit(\"debug\", { action: \"receiveCcipReadFetchError\", request, result });\n }\n catch (error) { }\n // 4xx indicates the result is not present; stop\n assert(resp.statusCode < 400 || resp.statusCode >= 500, `response not found during CCIP fetch: ${errorMessage}`, \"OFFCHAIN_FAULT\", { reason: \"404_MISSING_RESOURCE\", transaction: tx, info: { url, errorMessage } });\n // 5xx indicates server issue; try the next url\n errorMessages.push(errorMessage);\n }\n assert(false, `error encountered during CCIP fetch: ${errorMessages.map((m) => JSON.stringify(m)).join(\", \")}`, \"OFFCHAIN_FAULT\", {\n reason: \"500_SERVER_ERROR\",\n transaction: tx, info: { urls, errorMessages }\n });\n }\n /**\n * Provides the opportunity for a sub-class to wrap a block before\n * returning it, to add additional properties or an alternate\n * sub-class of [[Block]].\n */\n _wrapBlock(value, network) {\n return new Block(formatBlock(value), this);\n }\n /**\n * Provides the opportunity for a sub-class to wrap a log before\n * returning it, to add additional properties or an alternate\n * sub-class of [[Log]].\n */\n _wrapLog(value, network) {\n return new Log(formatLog(value), this);\n }\n /**\n * Provides the opportunity for a sub-class to wrap a transaction\n * receipt before returning it, to add additional properties or an\n * alternate sub-class of [[TransactionReceipt]].\n */\n _wrapTransactionReceipt(value, network) {\n return new TransactionReceipt(formatTransactionReceipt(value), this);\n }\n /**\n * Provides the opportunity for a sub-class to wrap a transaction\n * response before returning it, to add additional properties or an\n * alternate sub-class of [[TransactionResponse]].\n */\n _wrapTransactionResponse(tx, network) {\n return new TransactionResponse(formatTransactionResponse(tx), this);\n }\n /**\n * Resolves to the Network, forcing a network detection using whatever\n * technique the sub-class requires.\n *\n * Sub-classes **must** override this.\n */\n _detectNetwork() {\n assert(false, \"sub-classes must implement this\", \"UNSUPPORTED_OPERATION\", {\n operation: \"_detectNetwork\"\n });\n }\n /**\n * Sub-classes should use this to perform all built-in operations. All\n * methods sanitizes and normalizes the values passed into this.\n *\n * Sub-classes **must** override this.\n */\n async _perform(req) {\n assert(false, `unsupported method: ${req.method}`, \"UNSUPPORTED_OPERATION\", {\n operation: req.method,\n info: req\n });\n }\n // State\n async getBlockNumber() {\n const blockNumber = getNumber(await this.#perform({ method: \"getBlockNumber\" }), \"%response\");\n if (this.#lastBlockNumber >= 0) {\n this.#lastBlockNumber = blockNumber;\n }\n return blockNumber;\n }\n /**\n * Returns or resolves to the address for %%address%%, resolving ENS\n * names and [[Addressable]] objects and returning if already an\n * address.\n */\n _getAddress(address) {\n return resolveAddress(address, this);\n }\n /**\n * Returns or resolves to a valid block tag for %%blockTag%%, resolving\n * negative values and returning if already a valid block tag.\n */\n _getBlockTag(blockTag) {\n if (blockTag == null) {\n return \"latest\";\n }\n switch (blockTag) {\n case \"earliest\":\n return \"0x0\";\n case \"finalized\":\n case \"latest\":\n case \"pending\":\n case \"safe\":\n return blockTag;\n }\n if (isHexString(blockTag)) {\n if (isHexString(blockTag, 32)) {\n return blockTag;\n }\n return toQuantity(blockTag);\n }\n if (typeof (blockTag) === \"bigint\") {\n blockTag = getNumber(blockTag, \"blockTag\");\n }\n if (typeof (blockTag) === \"number\") {\n if (blockTag >= 0) {\n return toQuantity(blockTag);\n }\n if (this.#lastBlockNumber >= 0) {\n return toQuantity(this.#lastBlockNumber + blockTag);\n }\n return this.getBlockNumber().then((b) => toQuantity(b + blockTag));\n }\n assertArgument(false, \"invalid blockTag\", \"blockTag\", blockTag);\n }\n /**\n * Returns or resolves to a filter for %%filter%%, resolving any ENS\n * names or [[Addressable]] object and returning if already a valid\n * filter.\n */\n _getFilter(filter) {\n // Create a canonical representation of the topics\n const topics = (filter.topics || []).map((t) => {\n if (t == null) {\n return null;\n }\n if (Array.isArray(t)) {\n return concisify(t.map((t) => t.toLowerCase()));\n }\n return t.toLowerCase();\n });\n const blockHash = (\"blockHash\" in filter) ? filter.blockHash : undefined;\n const resolve = (_address, fromBlock, toBlock) => {\n let address = undefined;\n switch (_address.length) {\n case 0: break;\n case 1:\n address = _address[0];\n break;\n default:\n _address.sort();\n address = _address;\n }\n if (blockHash) {\n if (fromBlock != null || toBlock != null) {\n throw new Error(\"invalid filter\");\n }\n }\n const filter = {};\n if (address) {\n filter.address = address;\n }\n if (topics.length) {\n filter.topics = topics;\n }\n if (fromBlock) {\n filter.fromBlock = fromBlock;\n }\n if (toBlock) {\n filter.toBlock = toBlock;\n }\n if (blockHash) {\n filter.blockHash = blockHash;\n }\n return filter;\n };\n // Addresses could be async (ENS names or Addressables)\n let address = [];\n if (filter.address) {\n if (Array.isArray(filter.address)) {\n for (const addr of filter.address) {\n address.push(this._getAddress(addr));\n }\n }\n else {\n address.push(this._getAddress(filter.address));\n }\n }\n let fromBlock = undefined;\n if (\"fromBlock\" in filter) {\n fromBlock = this._getBlockTag(filter.fromBlock);\n }\n let toBlock = undefined;\n if (\"toBlock\" in filter) {\n toBlock = this._getBlockTag(filter.toBlock);\n }\n if (address.filter((a) => (typeof (a) !== \"string\")).length ||\n (fromBlock != null && typeof (fromBlock) !== \"string\") ||\n (toBlock != null && typeof (toBlock) !== \"string\")) {\n return Promise.all([Promise.all(address), fromBlock, toBlock]).then((result) => {\n return resolve(result[0], result[1], result[2]);\n });\n }\n return resolve(address, fromBlock, toBlock);\n }\n /**\n * Returns or resolves to a transaction for %%request%%, resolving\n * any ENS names or [[Addressable]] and returning if already a valid\n * transaction.\n */\n _getTransactionRequest(_request) {\n const request = copyRequest(_request);\n const promises = [];\n [\"to\", \"from\"].forEach((key) => {\n if (request[key] == null) {\n return;\n }\n const addr = resolveAddress(request[key], this);\n if (isPromise(addr)) {\n promises.push((async function () { request[key] = await addr; })());\n }\n else {\n request[key] = addr;\n }\n });\n if (request.blockTag != null) {\n const blockTag = this._getBlockTag(request.blockTag);\n if (isPromise(blockTag)) {\n promises.push((async function () { request.blockTag = await blockTag; })());\n }\n else {\n request.blockTag = blockTag;\n }\n }\n if (promises.length) {\n return (async function () {\n await Promise.all(promises);\n return request;\n })();\n }\n return request;\n }\n async getNetwork() {\n // No explicit network was set and this is our first time\n if (this.#networkPromise == null) {\n // Detect the current network (shared with all calls)\n const detectNetwork = (async () => {\n try {\n const network = await this._detectNetwork();\n this.emit(\"network\", network, null);\n return network;\n }\n catch (error) {\n if (this.#networkPromise === detectNetwork) {\n this.#networkPromise = null;\n }\n throw error;\n }\n })();\n this.#networkPromise = detectNetwork;\n return (await detectNetwork).clone();\n }\n const networkPromise = this.#networkPromise;\n const [expected, actual] = await Promise.all([\n networkPromise,\n this._detectNetwork() // The actual connected network\n ]);\n if (expected.chainId !== actual.chainId) {\n if (this.#anyNetwork) {\n // The \"any\" network can change, so notify listeners\n this.emit(\"network\", actual, expected);\n // Update the network if something else hasn't already changed it\n if (this.#networkPromise === networkPromise) {\n this.#networkPromise = Promise.resolve(actual);\n }\n }\n else {\n // Otherwise, we do not allow changes to the underlying network\n assert(false, `network changed: ${expected.chainId} => ${actual.chainId} `, \"NETWORK_ERROR\", {\n event: \"changed\"\n });\n }\n }\n return expected.clone();\n }\n async getFeeData() {\n const network = await this.getNetwork();\n const getFeeDataFunc = async () => {\n const { _block, gasPrice, priorityFee } = await resolveProperties({\n _block: this.#getBlock(\"latest\", false),\n gasPrice: ((async () => {\n try {\n const value = await this.#perform({ method: \"getGasPrice\" });\n return getBigInt(value, \"%response\");\n }\n catch (error) { }\n return null;\n })()),\n priorityFee: ((async () => {\n try {\n const value = await this.#perform({ method: \"getPriorityFee\" });\n return getBigInt(value, \"%response\");\n }\n catch (error) { }\n return null;\n })())\n });\n let maxFeePerGas = null;\n let maxPriorityFeePerGas = null;\n // These are the recommended EIP-1559 heuristics for fee data\n const block = this._wrapBlock(_block, network);\n if (block && block.baseFeePerGas) {\n maxPriorityFeePerGas = (priorityFee != null) ? priorityFee : BigInt(\"1000000000\");\n maxFeePerGas = (block.baseFeePerGas * BN_2) + maxPriorityFeePerGas;\n }\n return new FeeData(gasPrice, maxFeePerGas, maxPriorityFeePerGas);\n };\n // Check for a FeeDataNetWorkPlugin\n const plugin = network.getPlugin(\"org.ethers.plugins.network.FetchUrlFeeDataPlugin\");\n if (plugin) {\n const req = new FetchRequest(plugin.url);\n const feeData = await plugin.processFunc(getFeeDataFunc, this, req);\n return new FeeData(feeData.gasPrice, feeData.maxFeePerGas, feeData.maxPriorityFeePerGas);\n }\n return await getFeeDataFunc();\n }\n async estimateGas(_tx) {\n let tx = this._getTransactionRequest(_tx);\n if (isPromise(tx)) {\n tx = await tx;\n }\n return getBigInt(await this.#perform({\n method: \"estimateGas\", transaction: tx\n }), \"%response\");\n }\n async #call(tx, blockTag, attempt) {\n assert(attempt < MAX_CCIP_REDIRECTS, \"CCIP read exceeded maximum redirections\", \"OFFCHAIN_FAULT\", {\n reason: \"TOO_MANY_REDIRECTS\",\n transaction: Object.assign({}, tx, { blockTag, enableCcipRead: true })\n });\n // This came in as a PerformActionTransaction, so to/from are safe; we can cast\n const transaction = copyRequest(tx);\n try {\n const delay = this.#getDelay();\n if (delay) {\n await stall(delay);\n }\n return hexlify(await this._perform({ method: \"call\", transaction, blockTag }));\n }\n catch (error) {\n // CCIP Read OffchainLookup\n if (!this.disableCcipRead && isCallException(error) && error.data && attempt >= 0 && blockTag === \"latest\" && transaction.to != null && dataSlice(error.data, 0, 4) === \"0x556f1830\") {\n const data = error.data;\n const txSender = await resolveAddress(transaction.to, this);\n // Parse the CCIP Read Arguments\n let ccipArgs;\n try {\n ccipArgs = parseOffchainLookup(dataSlice(error.data, 4));\n }\n catch (error) {\n assert(false, error.message, \"OFFCHAIN_FAULT\", {\n reason: \"BAD_DATA\", transaction, info: { data }\n });\n }\n // Check the sender of the OffchainLookup matches the transaction\n assert(ccipArgs.sender.toLowerCase() === txSender.toLowerCase(), \"CCIP Read sender mismatch\", \"CALL_EXCEPTION\", {\n action: \"call\",\n data,\n reason: \"OffchainLookup\",\n transaction: transaction,\n invocation: null,\n revert: {\n signature: \"OffchainLookup(address,string[],bytes,bytes4,bytes)\",\n name: \"OffchainLookup\",\n args: ccipArgs.errorArgs\n }\n });\n const ccipResult = await this.ccipReadFetch(transaction, ccipArgs.calldata, ccipArgs.urls);\n assert(ccipResult != null, \"CCIP Read failed to fetch data\", \"OFFCHAIN_FAULT\", {\n reason: \"FETCH_FAILED\", transaction, info: { data: error.data, errorArgs: ccipArgs.errorArgs }\n });\n const tx = {\n to: txSender,\n data: concat([ccipArgs.selector, encodeBytes([ccipResult, ccipArgs.extraData])])\n };\n this.emit(\"debug\", { action: \"sendCcipReadCall\", transaction: tx });\n try {\n const result = await this.#call(tx, blockTag, attempt + 1);\n this.emit(\"debug\", { action: \"receiveCcipReadCallResult\", transaction: Object.assign({}, tx), result });\n return result;\n }\n catch (error) {\n this.emit(\"debug\", { action: \"receiveCcipReadCallError\", transaction: Object.assign({}, tx), error });\n throw error;\n }\n }\n throw error;\n }\n }\n async #checkNetwork(promise) {\n const { value } = await resolveProperties({\n network: this.getNetwork(),\n value: promise\n });\n return value;\n }\n async call(_tx) {\n const { tx, blockTag } = await resolveProperties({\n tx: this._getTransactionRequest(_tx),\n blockTag: this._getBlockTag(_tx.blockTag)\n });\n return await this.#checkNetwork(this.#call(tx, blockTag, _tx.enableCcipRead ? 0 : -1));\n }\n // Account\n async #getAccountValue(request, _address, _blockTag) {\n let address = this._getAddress(_address);\n let blockTag = this._getBlockTag(_blockTag);\n if (typeof (address) !== \"string\" || typeof (blockTag) !== \"string\") {\n [address, blockTag] = await Promise.all([address, blockTag]);\n }\n return await this.#checkNetwork(this.#perform(Object.assign(request, { address, blockTag })));\n }\n async getBalance(address, blockTag) {\n return getBigInt(await this.#getAccountValue({ method: \"getBalance\" }, address, blockTag), \"%response\");\n }\n async getTransactionCount(address, blockTag) {\n return getNumber(await this.#getAccountValue({ method: \"getTransactionCount\" }, address, blockTag), \"%response\");\n }\n async getCode(address, blockTag) {\n return hexlify(await this.#getAccountValue({ method: \"getCode\" }, address, blockTag));\n }\n async getStorage(address, _position, blockTag) {\n const position = getBigInt(_position, \"position\");\n return hexlify(await this.#getAccountValue({ method: \"getStorage\", position }, address, blockTag));\n }\n // Write\n async broadcastTransaction(signedTx) {\n const { blockNumber, hash, network } = await resolveProperties({\n blockNumber: this.getBlockNumber(),\n hash: this._perform({\n method: \"broadcastTransaction\",\n signedTransaction: signedTx\n }),\n network: this.getNetwork()\n });\n const tx = Transaction.from(signedTx);\n if (tx.hash !== hash) {\n throw new Error(\"@TODO: the returned hash did not match\");\n }\n return this._wrapTransactionResponse(tx, network).replaceableTransaction(blockNumber);\n }\n async #getBlock(block, includeTransactions) {\n // @TODO: Add CustomBlockPlugin check\n if (isHexString(block, 32)) {\n return await this.#perform({\n method: \"getBlock\", blockHash: block, includeTransactions\n });\n }\n let blockTag = this._getBlockTag(block);\n if (typeof (blockTag) !== \"string\") {\n blockTag = await blockTag;\n }\n return await this.#perform({\n method: \"getBlock\", blockTag, includeTransactions\n });\n }\n // Queries\n async getBlock(block, prefetchTxs) {\n const { network, params } = await resolveProperties({\n network: this.getNetwork(),\n params: this.#getBlock(block, !!prefetchTxs)\n });\n if (params == null) {\n return null;\n }\n return this._wrapBlock(params, network);\n }\n async getTransaction(hash) {\n const { network, params } = await resolveProperties({\n network: this.getNetwork(),\n params: this.#perform({ method: \"getTransaction\", hash })\n });\n if (params == null) {\n return null;\n }\n return this._wrapTransactionResponse(params, network);\n }\n async getTransactionReceipt(hash) {\n const { network, params } = await resolveProperties({\n network: this.getNetwork(),\n params: this.#perform({ method: \"getTransactionReceipt\", hash })\n });\n if (params == null) {\n return null;\n }\n // Some backends did not backfill the effectiveGasPrice into old transactions\n // in the receipt, so we look it up manually and inject it.\n if (params.gasPrice == null && params.effectiveGasPrice == null) {\n const tx = await this.#perform({ method: \"getTransaction\", hash });\n if (tx == null) {\n throw new Error(\"report this; could not find tx or effectiveGasPrice\");\n }\n params.effectiveGasPrice = tx.gasPrice;\n }\n return this._wrapTransactionReceipt(params, network);\n }\n async getTransactionResult(hash) {\n const { result } = await resolveProperties({\n network: this.getNetwork(),\n result: this.#perform({ method: \"getTransactionResult\", hash })\n });\n if (result == null) {\n return null;\n }\n return hexlify(result);\n }\n // Bloom-filter Queries\n async getLogs(_filter) {\n let filter = this._getFilter(_filter);\n if (isPromise(filter)) {\n filter = await filter;\n }\n const { network, params } = await resolveProperties({\n network: this.getNetwork(),\n params: this.#perform({ method: \"getLogs\", filter })\n });\n return params.map((p) => this._wrapLog(p, network));\n }\n // ENS\n _getProvider(chainId) {\n assert(false, \"provider cannot connect to target network\", \"UNSUPPORTED_OPERATION\", {\n operation: \"_getProvider()\"\n });\n }\n async getResolver(name) {\n return await EnsResolver.fromName(this, name);\n }\n async getAvatar(name) {\n const resolver = await this.getResolver(name);\n if (resolver) {\n return await resolver.getAvatar();\n }\n return null;\n }\n async resolveName(name, coinType) {\n const resolver = await this.getResolver(name);\n if (resolver) {\n return await resolver.getAddress(coinType);\n }\n return null;\n }\n async lookupAddress(address, coinType) {\n return await EnsResolver.lookupAddress(this, address, coinType);\n }\n async waitForTransaction(hash, _confirms, timeout) {\n const confirms = (_confirms != null) ? _confirms : 1;\n if (confirms === 0) {\n return this.getTransactionReceipt(hash);\n }\n return new Promise(async (resolve, reject) => {\n let timer = null;\n const listener = (async (blockNumber) => {\n try {\n const receipt = await this.getTransactionReceipt(hash);\n if (receipt != null) {\n if (blockNumber - receipt.blockNumber + 1 >= confirms) {\n resolve(receipt);\n //this.off(\"block\", listener);\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n return;\n }\n }\n }\n catch (error) {\n console.log(\"EEE\", error);\n }\n this.once(\"block\", listener);\n });\n if (timeout != null) {\n timer = setTimeout(() => {\n if (timer == null) {\n return;\n }\n timer = null;\n this.off(\"block\", listener);\n reject(makeError(\"timeout\", \"TIMEOUT\", { reason: \"timeout\" }));\n }, timeout);\n }\n listener(await this.getBlockNumber());\n });\n }\n async waitForBlock(blockTag) {\n assert(false, \"not implemented yet\", \"NOT_IMPLEMENTED\", {\n operation: \"waitForBlock\"\n });\n }\n /**\n * Clear a timer created using the [[_setTimeout]] method.\n */\n _clearTimeout(timerId) {\n const timer = this.#timers.get(timerId);\n if (!timer) {\n return;\n }\n if (timer.timer) {\n clearTimeout(timer.timer);\n }\n this.#timers.delete(timerId);\n }\n /**\n * Create a timer that will execute %%func%% after at least %%timeout%%\n * (in ms). If %%timeout%% is unspecified, then %%func%% will execute\n * in the next event loop.\n *\n * [Pausing](AbstractProvider-paused) the provider will pause any\n * associated timers.\n */\n _setTimeout(_func, timeout) {\n if (timeout == null) {\n timeout = 0;\n }\n const timerId = this.#nextTimer++;\n const func = () => {\n this.#timers.delete(timerId);\n _func();\n };\n if (this.paused) {\n this.#timers.set(timerId, { timer: null, func, time: timeout });\n }\n else {\n const timer = setTimeout(func, timeout);\n this.#timers.set(timerId, { timer, func, time: getTime() });\n }\n return timerId;\n }\n /**\n * Perform %%func%% on each subscriber.\n */\n _forEachSubscriber(func) {\n for (const sub of this.#subs.values()) {\n func(sub.subscriber);\n }\n }\n /**\n * Sub-classes may override this to customize subscription\n * implementations.\n */\n _getSubscriber(sub) {\n switch (sub.type) {\n case \"debug\":\n case \"error\":\n case \"network\":\n return new UnmanagedSubscriber(sub.type);\n case \"block\": {\n const subscriber = new PollingBlockSubscriber(this);\n subscriber.pollingInterval = this.pollingInterval;\n return subscriber;\n }\n case \"safe\":\n case \"finalized\":\n return new PollingBlockTagSubscriber(this, sub.type);\n case \"event\":\n return new PollingEventSubscriber(this, sub.filter);\n case \"transaction\":\n return new PollingTransactionSubscriber(this, sub.hash);\n case \"orphan\":\n return new PollingOrphanSubscriber(this, sub.filter);\n }\n throw new Error(`unsupported event: ${sub.type}`);\n }\n /**\n * If a [[Subscriber]] fails and needs to replace itself, this\n * method may be used.\n *\n * For example, this is used for providers when using the\n * ``eth_getFilterChanges`` method, which can return null if state\n * filters are not supported by the backend, allowing the Subscriber\n * to swap in a [[PollingEventSubscriber]].\n */\n _recoverSubscriber(oldSub, newSub) {\n for (const sub of this.#subs.values()) {\n if (sub.subscriber === oldSub) {\n if (sub.started) {\n sub.subscriber.stop();\n }\n sub.subscriber = newSub;\n if (sub.started) {\n newSub.start();\n }\n if (this.#pausedState != null) {\n newSub.pause(this.#pausedState);\n }\n break;\n }\n }\n }\n async #hasSub(event, emitArgs) {\n let sub = await getSubscription(event, this);\n // This is a log that is removing an existing log; we actually want\n // to emit an orphan event for the removed log\n if (sub.type === \"event\" && emitArgs && emitArgs.length > 0 && emitArgs[0].removed === true) {\n sub = await getSubscription({ orphan: \"drop-log\", log: emitArgs[0] }, this);\n }\n return this.#subs.get(sub.tag) || null;\n }\n async #getSub(event) {\n const subscription = await getSubscription(event, this);\n // Prevent tampering with our tag in any subclass' _getSubscriber\n const tag = subscription.tag;\n let sub = this.#subs.get(tag);\n if (!sub) {\n const subscriber = this._getSubscriber(subscription);\n const addressableMap = new WeakMap();\n const nameMap = new Map();\n sub = { subscriber, tag, addressableMap, nameMap, started: false, listeners: [] };\n this.#subs.set(tag, sub);\n }\n return sub;\n }\n async on(event, listener) {\n const sub = await this.#getSub(event);\n sub.listeners.push({ listener, once: false });\n if (!sub.started) {\n sub.subscriber.start();\n sub.started = true;\n if (this.#pausedState != null) {\n sub.subscriber.pause(this.#pausedState);\n }\n }\n return this;\n }\n async once(event, listener) {\n const sub = await this.#getSub(event);\n sub.listeners.push({ listener, once: true });\n if (!sub.started) {\n sub.subscriber.start();\n sub.started = true;\n if (this.#pausedState != null) {\n sub.subscriber.pause(this.#pausedState);\n }\n }\n return this;\n }\n async emit(event, ...args) {\n const sub = await this.#hasSub(event, args);\n // If there is not subscription or if a recent emit removed\n // the last of them (which also deleted the sub) do nothing\n if (!sub || sub.listeners.length === 0) {\n return false;\n }\n ;\n const count = sub.listeners.length;\n sub.listeners = sub.listeners.filter(({ listener, once }) => {\n const payload = new EventPayload(this, (once ? null : listener), event);\n try {\n listener.call(this, ...args, payload);\n }\n catch (error) { }\n return !once;\n });\n if (sub.listeners.length === 0) {\n if (sub.started) {\n sub.subscriber.stop();\n }\n this.#subs.delete(sub.tag);\n }\n return (count > 0);\n }\n async listenerCount(event) {\n if (event) {\n const sub = await this.#hasSub(event);\n if (!sub) {\n return 0;\n }\n return sub.listeners.length;\n }\n let total = 0;\n for (const { listeners } of this.#subs.values()) {\n total += listeners.length;\n }\n return total;\n }\n async listeners(event) {\n if (event) {\n const sub = await this.#hasSub(event);\n if (!sub) {\n return [];\n }\n return sub.listeners.map(({ listener }) => listener);\n }\n let result = [];\n for (const { listeners } of this.#subs.values()) {\n result = result.concat(listeners.map(({ listener }) => listener));\n }\n return result;\n }\n async off(event, listener) {\n const sub = await this.#hasSub(event);\n if (!sub) {\n return this;\n }\n if (listener) {\n const index = sub.listeners.map(({ listener }) => listener).indexOf(listener);\n if (index >= 0) {\n sub.listeners.splice(index, 1);\n }\n }\n if (!listener || sub.listeners.length === 0) {\n if (sub.started) {\n sub.subscriber.stop();\n }\n this.#subs.delete(sub.tag);\n }\n return this;\n }\n async removeAllListeners(event) {\n if (event) {\n const { tag, started, subscriber } = await this.#getSub(event);\n if (started) {\n subscriber.stop();\n }\n this.#subs.delete(tag);\n }\n else {\n for (const [tag, { started, subscriber }] of this.#subs) {\n if (started) {\n subscriber.stop();\n }\n this.#subs.delete(tag);\n }\n }\n return this;\n }\n // Alias for \"on\"\n async addListener(event, listener) {\n return await this.on(event, listener);\n }\n // Alias for \"off\"\n async removeListener(event, listener) {\n return this.off(event, listener);\n }\n /**\n * If this provider has been destroyed using the [[destroy]] method.\n *\n * Once destroyed, all resources are reclaimed, internal event loops\n * and timers are cleaned up and no further requests may be sent to\n * the provider.\n */\n get destroyed() {\n return this.#destroyed;\n }\n /**\n * Sub-classes may use this to shutdown any sockets or release their\n * resources and reject any pending requests.\n *\n * Sub-classes **must** call ``super.destroy()``.\n */\n destroy() {\n // Stop all listeners\n this.removeAllListeners();\n // Shut down all tiemrs\n for (const timerId of this.#timers.keys()) {\n this._clearTimeout(timerId);\n }\n this.#destroyed = true;\n }\n /**\n * Whether the provider is currently paused.\n *\n * A paused provider will not emit any events, and generally should\n * not make any requests to the network, but that is up to sub-classes\n * to manage.\n *\n * Setting ``paused = true`` is identical to calling ``.pause(false)``,\n * which will buffer any events that occur while paused until the\n * provider is unpaused.\n */\n get paused() { return (this.#pausedState != null); }\n set paused(pause) {\n if (!!pause === this.paused) {\n return;\n }\n if (this.paused) {\n this.resume();\n }\n else {\n this.pause(false);\n }\n }\n /**\n * Pause the provider. If %%dropWhilePaused%%, any events that occur\n * while paused are dropped, otherwise all events will be emitted once\n * the provider is unpaused.\n */\n pause(dropWhilePaused) {\n this.#lastBlockNumber = -1;\n if (this.#pausedState != null) {\n if (this.#pausedState == !!dropWhilePaused) {\n return;\n }\n assert(false, \"cannot change pause type; resume first\", \"UNSUPPORTED_OPERATION\", {\n operation: \"pause\"\n });\n }\n this._forEachSubscriber((s) => s.pause(dropWhilePaused));\n this.#pausedState = !!dropWhilePaused;\n for (const timer of this.#timers.values()) {\n // Clear the timer\n if (timer.timer) {\n clearTimeout(timer.timer);\n }\n // Remaining time needed for when we become unpaused\n timer.time = getTime() - timer.time;\n }\n }\n /**\n * Resume the provider.\n */\n resume() {\n if (this.#pausedState == null) {\n return;\n }\n this._forEachSubscriber((s) => s.resume());\n this.#pausedState = null;\n for (const timer of this.#timers.values()) {\n // Remaining time when we were paused\n let timeout = timer.time;\n if (timeout < 0) {\n timeout = 0;\n }\n // Start time (in cause paused, so we con compute remaininf time)\n timer.time = getTime();\n // Start the timer\n setTimeout(timer.func, timeout);\n }\n }\n}\nfunction _parseString(result, start) {\n try {\n const bytes = _parseBytes(result, start);\n if (bytes) {\n return toUtf8String(bytes);\n }\n }\n catch (error) { }\n return null;\n}\nfunction _parseBytes(result, start) {\n if (result === \"0x\") {\n return null;\n }\n try {\n const offset = getNumber(dataSlice(result, start, start + 32));\n const length = getNumber(dataSlice(result, offset, offset + 32));\n return dataSlice(result, offset + 32, offset + 32 + length);\n }\n catch (error) { }\n return null;\n}\nfunction numPad(value) {\n const result = toBeArray(value);\n if (result.length > 32) {\n throw new Error(\"internal; should not happen\");\n }\n const padded = new Uint8Array(32);\n padded.set(result, 32 - result.length);\n return padded;\n}\nfunction bytesPad(value) {\n if ((value.length % 32) === 0) {\n return value;\n }\n const result = new Uint8Array(Math.ceil(value.length / 32) * 32);\n result.set(value);\n return result;\n}\nconst empty = new Uint8Array([]);\n// ABI Encodes a series of (bytes, bytes, ...)\nfunction encodeBytes(datas) {\n const result = [];\n let byteCount = 0;\n // Add place-holders for pointers as we add items\n for (let i = 0; i < datas.length; i++) {\n result.push(empty);\n byteCount += 32;\n }\n for (let i = 0; i < datas.length; i++) {\n const data = getBytes(datas[i]);\n // Update the bytes offset\n result[i] = numPad(byteCount);\n // The length and padded value of data\n result.push(numPad(data.length));\n result.push(bytesPad(data));\n byteCount += 32 + Math.ceil(data.length / 32) * 32;\n }\n return concat(result);\n}\nconst zeros = \"0x0000000000000000000000000000000000000000000000000000000000000000\";\nfunction parseOffchainLookup(data) {\n const result = {\n sender: \"\", urls: [], calldata: \"\", selector: \"\", extraData: \"\", errorArgs: []\n };\n assert(dataLength(data) >= 5 * 32, \"insufficient OffchainLookup data\", \"OFFCHAIN_FAULT\", {\n reason: \"insufficient OffchainLookup data\"\n });\n const sender = dataSlice(data, 0, 32);\n assert(dataSlice(sender, 0, 12) === dataSlice(zeros, 0, 12), \"corrupt OffchainLookup sender\", \"OFFCHAIN_FAULT\", {\n reason: \"corrupt OffchainLookup sender\"\n });\n result.sender = dataSlice(sender, 12);\n // Read the URLs from the response\n try {\n const urls = [];\n const urlsOffset = getNumber(dataSlice(data, 32, 64));\n const urlsLength = getNumber(dataSlice(data, urlsOffset, urlsOffset + 32));\n const urlsData = dataSlice(data, urlsOffset + 32);\n for (let u = 0; u < urlsLength; u++) {\n const url = _parseString(urlsData, u * 32);\n if (url == null) {\n throw new Error(\"abort\");\n }\n urls.push(url);\n }\n result.urls = urls;\n }\n catch (error) {\n assert(false, \"corrupt OffchainLookup urls\", \"OFFCHAIN_FAULT\", {\n reason: \"corrupt OffchainLookup urls\"\n });\n }\n // Get the CCIP calldata to forward\n try {\n const calldata = _parseBytes(data, 64);\n if (calldata == null) {\n throw new Error(\"abort\");\n }\n result.calldata = calldata;\n }\n catch (error) {\n assert(false, \"corrupt OffchainLookup calldata\", \"OFFCHAIN_FAULT\", {\n reason: \"corrupt OffchainLookup calldata\"\n });\n }\n // Get the callbackSelector (bytes4)\n assert(dataSlice(data, 100, 128) === dataSlice(zeros, 0, 28), \"corrupt OffchainLookup callbaackSelector\", \"OFFCHAIN_FAULT\", {\n reason: \"corrupt OffchainLookup callbaackSelector\"\n });\n result.selector = dataSlice(data, 96, 100);\n // Get the extra data to send back to the contract as context\n try {\n const extraData = _parseBytes(data, 128);\n if (extraData == null) {\n throw new Error(\"abort\");\n }\n result.extraData = extraData;\n }\n catch (error) {\n assert(false, \"corrupt OffchainLookup extraData\", \"OFFCHAIN_FAULT\", {\n reason: \"corrupt OffchainLookup extraData\"\n });\n }\n result.errorArgs = \"sender,urls,calldata,selector,extraData\".split(/,/).map((k) => result[k]);\n return result;\n}\n//# sourceMappingURL=abstract-provider.js.map","/**\n * Generally the [[Wallet]] and [[JsonRpcSigner]] and their sub-classes\n * are sufficient for most developers, but this is provided to\n * fascilitate more complex Signers.\n *\n * @_section: api/providers/abstract-signer: Subclassing Signer [abstract-signer]\n */\nimport { resolveAddress } from \"../address/index.js\";\nimport { Transaction } from \"../transaction/index.js\";\nimport { defineProperties, getBigInt, resolveProperties, assert, assertArgument } from \"../utils/index.js\";\nimport { copyRequest } from \"./provider.js\";\nfunction checkProvider(signer, operation) {\n if (signer.provider) {\n return signer.provider;\n }\n assert(false, \"missing provider\", \"UNSUPPORTED_OPERATION\", { operation });\n}\nasync function populate(signer, tx) {\n let pop = copyRequest(tx);\n if (pop.to != null) {\n pop.to = resolveAddress(pop.to, signer);\n }\n if (pop.from != null) {\n const from = pop.from;\n pop.from = Promise.all([\n signer.getAddress(),\n resolveAddress(from, signer)\n ]).then(([address, from]) => {\n assertArgument(address.toLowerCase() === from.toLowerCase(), \"transaction from mismatch\", \"tx.from\", from);\n return address;\n });\n }\n else {\n pop.from = signer.getAddress();\n }\n return await resolveProperties(pop);\n}\n/**\n * An **AbstractSigner** includes most of teh functionality required\n * to get a [[Signer]] working as expected, but requires a few\n * Signer-specific methods be overridden.\n *\n */\nexport class AbstractSigner {\n /**\n * The provider this signer is connected to.\n */\n provider;\n /**\n * Creates a new Signer connected to %%provider%%.\n */\n constructor(provider) {\n defineProperties(this, { provider: (provider || null) });\n }\n async getNonce(blockTag) {\n return checkProvider(this, \"getTransactionCount\").getTransactionCount(await this.getAddress(), blockTag);\n }\n async populateCall(tx) {\n const pop = await populate(this, tx);\n return pop;\n }\n async populateTransaction(tx) {\n const provider = checkProvider(this, \"populateTransaction\");\n const pop = await populate(this, tx);\n if (pop.nonce == null) {\n pop.nonce = await this.getNonce(\"pending\");\n }\n if (pop.gasLimit == null) {\n pop.gasLimit = await this.estimateGas(pop);\n }\n // Populate the chain ID\n const network = await (this.provider).getNetwork();\n if (pop.chainId != null) {\n const chainId = getBigInt(pop.chainId);\n assertArgument(chainId === network.chainId, \"transaction chainId mismatch\", \"tx.chainId\", tx.chainId);\n }\n else {\n pop.chainId = network.chainId;\n }\n // Do not allow mixing pre-eip-1559 and eip-1559 properties\n const hasEip1559 = (pop.maxFeePerGas != null || pop.maxPriorityFeePerGas != null);\n if (pop.gasPrice != null && (pop.type === 2 || hasEip1559)) {\n assertArgument(false, \"eip-1559 transaction do not support gasPrice\", \"tx\", tx);\n }\n else if ((pop.type === 0 || pop.type === 1) && hasEip1559) {\n assertArgument(false, \"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas\", \"tx\", tx);\n }\n if ((pop.type === 2 || pop.type == null) && (pop.maxFeePerGas != null && pop.maxPriorityFeePerGas != null)) {\n // Fully-formed EIP-1559 transaction (skip getFeeData)\n pop.type = 2;\n }\n else if (pop.type === 0 || pop.type === 1) {\n // Explicit Legacy or EIP-2930 transaction\n // We need to get fee data to determine things\n const feeData = await provider.getFeeData();\n assert(feeData.gasPrice != null, \"network does not support gasPrice\", \"UNSUPPORTED_OPERATION\", {\n operation: \"getGasPrice\"\n });\n // Populate missing gasPrice\n if (pop.gasPrice == null) {\n pop.gasPrice = feeData.gasPrice;\n }\n }\n else {\n // We need to get fee data to determine things\n const feeData = await provider.getFeeData();\n if (pop.type == null) {\n // We need to auto-detect the intended type of this transaction...\n if (feeData.maxFeePerGas != null && feeData.maxPriorityFeePerGas != null) {\n // The network supports EIP-1559!\n // Upgrade transaction from null to eip-1559\n if (pop.authorizationList && pop.authorizationList.length) {\n pop.type = 4;\n }\n else {\n pop.type = 2;\n }\n if (pop.gasPrice != null) {\n // Using legacy gasPrice property on an eip-1559 network,\n // so use gasPrice as both fee properties\n const gasPrice = pop.gasPrice;\n delete pop.gasPrice;\n pop.maxFeePerGas = gasPrice;\n pop.maxPriorityFeePerGas = gasPrice;\n }\n else {\n // Populate missing fee data\n if (pop.maxFeePerGas == null) {\n pop.maxFeePerGas = feeData.maxFeePerGas;\n }\n if (pop.maxPriorityFeePerGas == null) {\n pop.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas;\n }\n }\n }\n else if (feeData.gasPrice != null) {\n // Network doesn't support EIP-1559...\n // ...but they are trying to use EIP-1559 properties\n assert(!hasEip1559, \"network does not support EIP-1559\", \"UNSUPPORTED_OPERATION\", {\n operation: \"populateTransaction\"\n });\n // Populate missing fee data\n if (pop.gasPrice == null) {\n pop.gasPrice = feeData.gasPrice;\n }\n // Explicitly set untyped transaction to legacy\n // @TODO: Maybe this shold allow type 1?\n pop.type = 0;\n }\n else {\n // getFeeData has failed us.\n assert(false, \"failed to get consistent fee data\", \"UNSUPPORTED_OPERATION\", {\n operation: \"signer.getFeeData\"\n });\n }\n }\n else if (pop.type === 2 || pop.type === 3 || pop.type === 4) {\n // Explicitly using EIP-1559 or EIP-4844\n // Populate missing fee data\n if (pop.maxFeePerGas == null) {\n pop.maxFeePerGas = feeData.maxFeePerGas;\n }\n if (pop.maxPriorityFeePerGas == null) {\n pop.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas;\n }\n }\n }\n //@TOOD: Don't await all over the place; save them up for\n // the end for better batching\n return await resolveProperties(pop);\n }\n async populateAuthorization(_auth) {\n const auth = Object.assign({}, _auth);\n // Add a chain ID if not explicitly set to 0\n if (auth.chainId == null) {\n auth.chainId = (await checkProvider(this, \"getNetwork\").getNetwork()).chainId;\n }\n // @TODO: Take chain ID into account when populating noce?\n if (auth.nonce == null) {\n auth.nonce = await this.getNonce();\n }\n return auth;\n }\n async estimateGas(tx) {\n return checkProvider(this, \"estimateGas\").estimateGas(await this.populateCall(tx));\n }\n async call(tx) {\n return checkProvider(this, \"call\").call(await this.populateCall(tx));\n }\n async resolveName(name) {\n const provider = checkProvider(this, \"resolveName\");\n return await provider.resolveName(name);\n }\n async sendTransaction(tx) {\n const provider = checkProvider(this, \"sendTransaction\");\n const pop = await this.populateTransaction(tx);\n delete pop.from;\n const txObj = Transaction.from(pop);\n return await provider.broadcastTransaction(await this.signTransaction(txObj));\n }\n // @TODO: in v7 move this to be abstract\n authorize(authorization) {\n assert(false, \"authorization not implemented for this signer\", \"UNSUPPORTED_OPERATION\", { operation: \"authorize\" });\n }\n}\n/**\n * A **VoidSigner** is a class designed to allow an address to be used\n * in any API which accepts a Signer, but for which there are no\n * credentials available to perform any actual signing.\n *\n * This for example allow impersonating an account for the purpose of\n * static calls or estimating gas, but does not allow sending transactions.\n */\nexport class VoidSigner extends AbstractSigner {\n /**\n * The signer address.\n */\n address;\n /**\n * Creates a new **VoidSigner** with %%address%% attached to\n * %%provider%%.\n */\n constructor(address, provider) {\n super(provider);\n defineProperties(this, { address });\n }\n async getAddress() { return this.address; }\n connect(provider) {\n return new VoidSigner(this.address, provider);\n }\n #throwUnsupported(suffix, operation) {\n assert(false, `VoidSigner cannot sign ${suffix}`, \"UNSUPPORTED_OPERATION\", { operation });\n }\n async signTransaction(tx) {\n this.#throwUnsupported(\"transactions\", \"signTransaction\");\n }\n async signMessage(message) {\n this.#throwUnsupported(\"messages\", \"signMessage\");\n }\n async signTypedData(domain, types, value) {\n this.#throwUnsupported(\"typed-data\", \"signTypedData\");\n }\n}\n//# sourceMappingURL=abstract-signer.js.map","import { isError } from \"../utils/index.js\";\nimport { PollingEventSubscriber } from \"./subscriber-polling.js\";\nfunction copy(obj) {\n return JSON.parse(JSON.stringify(obj));\n}\n/**\n * Some backends support subscribing to events using a Filter ID.\n *\n * When subscribing with this technique, the node issues a unique\n * //Filter ID//. At this point the node dedicates resources to\n * the filter, so that periodic calls to follow up on the //Filter ID//\n * will receive any events since the last call.\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class FilterIdSubscriber {\n #provider;\n #filterIdPromise;\n #poller;\n #running;\n #network;\n #hault;\n /**\n * Creates a new **FilterIdSubscriber** which will used [[_subscribe]]\n * and [[_emitResults]] to setup the subscription and provide the event\n * to the %%provider%%.\n */\n constructor(provider) {\n this.#provider = provider;\n this.#filterIdPromise = null;\n this.#poller = this.#poll.bind(this);\n this.#running = false;\n this.#network = null;\n this.#hault = false;\n }\n /**\n * Sub-classes **must** override this to begin the subscription.\n */\n _subscribe(provider) {\n throw new Error(\"subclasses must override this\");\n }\n /**\n * Sub-classes **must** override this handle the events.\n */\n _emitResults(provider, result) {\n throw new Error(\"subclasses must override this\");\n }\n /**\n * Sub-classes **must** override this handle recovery on errors.\n */\n _recover(provider) {\n throw new Error(\"subclasses must override this\");\n }\n async #poll(blockNumber) {\n try {\n // Subscribe if necessary\n if (this.#filterIdPromise == null) {\n this.#filterIdPromise = this._subscribe(this.#provider);\n }\n // Get the Filter ID\n let filterId = null;\n try {\n filterId = await this.#filterIdPromise;\n }\n catch (error) {\n if (!isError(error, \"UNSUPPORTED_OPERATION\") || error.operation !== \"eth_newFilter\") {\n throw error;\n }\n }\n // The backend does not support Filter ID; downgrade to\n // polling\n if (filterId == null) {\n this.#filterIdPromise = null;\n this.#provider._recoverSubscriber(this, this._recover(this.#provider));\n return;\n }\n const network = await this.#provider.getNetwork();\n if (!this.#network) {\n this.#network = network;\n }\n if (this.#network.chainId !== network.chainId) {\n throw new Error(\"chaid changed\");\n }\n if (this.#hault) {\n return;\n }\n const result = await this.#provider.send(\"eth_getFilterChanges\", [filterId]);\n await this._emitResults(this.#provider, result);\n }\n catch (error) {\n console.log(\"@TODO\", error);\n }\n this.#provider.once(\"block\", this.#poller);\n }\n #teardown() {\n const filterIdPromise = this.#filterIdPromise;\n if (filterIdPromise) {\n this.#filterIdPromise = null;\n filterIdPromise.then((filterId) => {\n if (this.#provider.destroyed) {\n return;\n }\n this.#provider.send(\"eth_uninstallFilter\", [filterId]);\n });\n }\n }\n start() {\n if (this.#running) {\n return;\n }\n this.#running = true;\n this.#poll(-2);\n }\n stop() {\n if (!this.#running) {\n return;\n }\n this.#running = false;\n this.#hault = true;\n this.#teardown();\n this.#provider.off(\"block\", this.#poller);\n }\n pause(dropWhilePaused) {\n if (dropWhilePaused) {\n this.#teardown();\n }\n this.#provider.off(\"block\", this.#poller);\n }\n resume() { this.start(); }\n}\n/**\n * A **FilterIdSubscriber** for receiving contract events.\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class FilterIdEventSubscriber extends FilterIdSubscriber {\n #event;\n /**\n * Creates a new **FilterIdEventSubscriber** attached to %%provider%%\n * listening for %%filter%%.\n */\n constructor(provider, filter) {\n super(provider);\n this.#event = copy(filter);\n }\n _recover(provider) {\n return new PollingEventSubscriber(provider, this.#event);\n }\n async _subscribe(provider) {\n const filterId = await provider.send(\"eth_newFilter\", [this.#event]);\n return filterId;\n }\n async _emitResults(provider, results) {\n for (const result of results) {\n provider.emit(this.#event, provider._wrapLog(result, provider._network));\n }\n }\n}\n/**\n * A **FilterIdSubscriber** for receiving pending transactions events.\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class FilterIdPendingSubscriber extends FilterIdSubscriber {\n async _subscribe(provider) {\n return await provider.send(\"eth_newPendingTransactionFilter\", []);\n }\n async _emitResults(provider, results) {\n for (const result of results) {\n provider.emit(\"pending\", result);\n }\n }\n}\n//# sourceMappingURL=subscriber-filterid.js.map","/**\n * One of the most common ways to interact with the blockchain is\n * by a node running a JSON-RPC interface which can be connected to,\n * based on the transport, using:\n *\n * - HTTP or HTTPS - [[JsonRpcProvider]]\n * - WebSocket - [[WebSocketProvider]]\n * - IPC - [[IpcSocketProvider]]\n *\n * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider]\n */\n// @TODO:\n// - Add the batching API\n// https://playground.open-rpc.org/?schemaUrl=https://raw.githubusercontent.com/ethereum/eth1.0-apis/assembled-spec/openrpc.json&uiSchema%5BappBar%5D%5Bui:splitView%5D=true&uiSchema%5BappBar%5D%5Bui:input%5D=false&uiSchema%5BappBar%5D%5Bui:examplesDropdown%5D=false\nimport { AbiCoder } from \"../abi/index.js\";\nimport { getAddress, resolveAddress } from \"../address/index.js\";\nimport { TypedDataEncoder } from \"../hash/index.js\";\nimport { accessListify, authorizationify } from \"../transaction/index.js\";\nimport { defineProperties, getBigInt, hexlify, isHexString, toQuantity, toUtf8Bytes, isError, makeError, assert, assertArgument, FetchRequest, resolveProperties } from \"../utils/index.js\";\nimport { AbstractProvider, UnmanagedSubscriber } from \"./abstract-provider.js\";\nimport { AbstractSigner } from \"./abstract-signer.js\";\nimport { Network } from \"./network.js\";\nimport { FilterIdEventSubscriber, FilterIdPendingSubscriber } from \"./subscriber-filterid.js\";\nimport { PollingEventSubscriber } from \"./subscriber-polling.js\";\nconst Primitive = \"bigint,boolean,function,number,string,symbol\".split(/,/g);\n//const Methods = \"getAddress,then\".split(/,/g);\nfunction deepCopy(value) {\n if (value == null || Primitive.indexOf(typeof (value)) >= 0) {\n return value;\n }\n // Keep any Addressable\n if (typeof (value.getAddress) === \"function\") {\n return value;\n }\n if (Array.isArray(value)) {\n return (value.map(deepCopy));\n }\n if (typeof (value) === \"object\") {\n return Object.keys(value).reduce((accum, key) => {\n accum[key] = value[key];\n return accum;\n }, {});\n }\n throw new Error(`should not happen: ${value} (${typeof (value)})`);\n}\nfunction stall(duration) {\n return new Promise((resolve) => { setTimeout(resolve, duration); });\n}\nfunction getLowerCase(value) {\n if (value) {\n return value.toLowerCase();\n }\n return value;\n}\nfunction isPollable(value) {\n return (value && typeof (value.pollingInterval) === \"number\");\n}\nconst defaultOptions = {\n polling: false,\n staticNetwork: null,\n batchStallTime: 10,\n batchMaxSize: (1 << 20),\n batchMaxCount: 100,\n cacheTimeout: 250,\n pollingInterval: 4000\n};\n// @TODO: Unchecked Signers\nexport class JsonRpcSigner extends AbstractSigner {\n address;\n constructor(provider, address) {\n super(provider);\n address = getAddress(address);\n defineProperties(this, { address });\n }\n connect(provider) {\n assert(false, \"cannot reconnect JsonRpcSigner\", \"UNSUPPORTED_OPERATION\", {\n operation: \"signer.connect\"\n });\n }\n async getAddress() {\n return this.address;\n }\n // JSON-RPC will automatially fill in nonce, etc. so we just check from\n async populateTransaction(tx) {\n return await this.populateCall(tx);\n }\n // Returns just the hash of the transaction after sent, which is what\n // the bare JSON-RPC API does;\n async sendUncheckedTransaction(_tx) {\n const tx = deepCopy(_tx);\n const promises = [];\n // Make sure the from matches the sender\n if (tx.from) {\n const _from = tx.from;\n promises.push((async () => {\n const from = await resolveAddress(_from, this.provider);\n assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), \"from address mismatch\", \"transaction\", _tx);\n tx.from = from;\n })());\n }\n else {\n tx.from = this.address;\n }\n // The JSON-RPC for eth_sendTransaction uses 90000 gas; if the user\n // wishes to use this, it is easy to specify explicitly, otherwise\n // we look it up for them.\n if (tx.gasLimit == null) {\n promises.push((async () => {\n tx.gasLimit = await this.provider.estimateGas({ ...tx, from: this.address });\n })());\n }\n // The address may be an ENS name or Addressable\n if (tx.to != null) {\n const _to = tx.to;\n promises.push((async () => {\n tx.to = await resolveAddress(_to, this.provider);\n })());\n }\n // Wait until all of our properties are filled in\n if (promises.length) {\n await Promise.all(promises);\n }\n const hexTx = this.provider.getRpcTransaction(tx);\n return this.provider.send(\"eth_sendTransaction\", [hexTx]);\n }\n async sendTransaction(tx) {\n // This cannot be mined any earlier than any recent block\n const blockNumber = await this.provider.getBlockNumber();\n // Send the transaction\n const hash = await this.sendUncheckedTransaction(tx);\n // Unfortunately, JSON-RPC only provides and opaque transaction hash\n // for a response, and we need the actual transaction, so we poll\n // for it; it should show up very quickly\n return await (new Promise((resolve, reject) => {\n const timeouts = [1000, 100];\n let invalids = 0;\n const checkTx = async () => {\n try {\n // Try getting the transaction\n const tx = await this.provider.getTransaction(hash);\n if (tx != null) {\n resolve(tx.replaceableTransaction(blockNumber));\n return;\n }\n }\n catch (error) {\n // If we were cancelled: stop polling.\n // If the data is bad: the node returns bad transactions\n // If the network changed: calling again will also fail\n // If unsupported: likely destroyed\n if (isError(error, \"CANCELLED\") || isError(error, \"BAD_DATA\") ||\n isError(error, \"NETWORK_ERROR\") || isError(error, \"UNSUPPORTED_OPERATION\")) {\n if (error.info == null) {\n error.info = {};\n }\n error.info.sendTransactionHash = hash;\n reject(error);\n return;\n }\n // Stop-gap for misbehaving backends; see #4513\n if (isError(error, \"INVALID_ARGUMENT\")) {\n invalids++;\n if (error.info == null) {\n error.info = {};\n }\n error.info.sendTransactionHash = hash;\n if (invalids > 10) {\n reject(error);\n return;\n }\n }\n // Notify anyone that cares; but we will try again, since\n // it is likely an intermittent service error\n this.provider.emit(\"error\", makeError(\"failed to fetch transation after sending (will try again)\", \"UNKNOWN_ERROR\", { error }));\n }\n // Wait another 4 seconds\n this.provider._setTimeout(() => { checkTx(); }, timeouts.pop() || 4000);\n };\n checkTx();\n }));\n }\n async signTransaction(_tx) {\n const tx = deepCopy(_tx);\n // Make sure the from matches the sender\n if (tx.from) {\n const from = await resolveAddress(tx.from, this.provider);\n assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), \"from address mismatch\", \"transaction\", _tx);\n tx.from = from;\n }\n else {\n tx.from = this.address;\n }\n const hexTx = this.provider.getRpcTransaction(tx);\n return await this.provider.send(\"eth_signTransaction\", [hexTx]);\n }\n async signMessage(_message) {\n const message = ((typeof (_message) === \"string\") ? toUtf8Bytes(_message) : _message);\n return await this.provider.send(\"personal_sign\", [\n hexlify(message), this.address.toLowerCase()\n ]);\n }\n async signTypedData(domain, types, _value) {\n const value = deepCopy(_value);\n // Populate any ENS names (in-place)\n const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (value) => {\n const address = await resolveAddress(value);\n assertArgument(address != null, \"TypedData does not support null address\", \"value\", value);\n return address;\n });\n return await this.provider.send(\"eth_signTypedData_v4\", [\n this.address.toLowerCase(),\n JSON.stringify(TypedDataEncoder.getPayload(populated.domain, types, populated.value))\n ]);\n }\n async unlock(password) {\n return this.provider.send(\"personal_unlockAccount\", [\n this.address.toLowerCase(), password, null\n ]);\n }\n // https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign\n async _legacySignMessage(_message) {\n const message = ((typeof (_message) === \"string\") ? toUtf8Bytes(_message) : _message);\n return await this.provider.send(\"eth_sign\", [\n this.address.toLowerCase(), hexlify(message)\n ]);\n }\n}\n/**\n * The JsonRpcApiProvider is an abstract class and **MUST** be\n * sub-classed.\n *\n * It provides the base for all JSON-RPC-based Provider interaction.\n *\n * Sub-classing Notes:\n * - a sub-class MUST override _send\n * - a sub-class MUST call the `_start()` method once connected\n */\nexport class JsonRpcApiProvider extends AbstractProvider {\n #options;\n // The next ID to use for the JSON-RPC ID field\n #nextId;\n // Payloads are queued and triggered in batches using the drainTimer\n #payloads;\n #drainTimer;\n #notReady;\n #network;\n #pendingDetectNetwork;\n #scheduleDrain() {\n if (this.#drainTimer) {\n return;\n }\n // If we aren't using batching, no harm in sending it immediately\n const stallTime = (this._getOption(\"batchMaxCount\") === 1) ? 0 : this._getOption(\"batchStallTime\");\n this.#drainTimer = setTimeout(() => {\n this.#drainTimer = null;\n const payloads = this.#payloads;\n this.#payloads = [];\n while (payloads.length) {\n // Create payload batches that satisfy our batch constraints\n const batch = [(payloads.shift())];\n while (payloads.length) {\n if (batch.length === this.#options.batchMaxCount) {\n break;\n }\n batch.push((payloads.shift()));\n const bytes = JSON.stringify(batch.map((p) => p.payload));\n if (bytes.length > this.#options.batchMaxSize) {\n payloads.unshift((batch.pop()));\n break;\n }\n }\n // Process the result to each payload\n (async () => {\n const payload = ((batch.length === 1) ? batch[0].payload : batch.map((p) => p.payload));\n this.emit(\"debug\", { action: \"sendRpcPayload\", payload });\n try {\n const result = await this._send(payload);\n this.emit(\"debug\", { action: \"receiveRpcResult\", result });\n // Process results in batch order\n for (const { resolve, reject, payload } of batch) {\n if (this.destroyed) {\n reject(makeError(\"provider destroyed; cancelled request\", \"UNSUPPORTED_OPERATION\", { operation: payload.method }));\n continue;\n }\n // Find the matching result\n const resp = result.filter((r) => (r.id === payload.id))[0];\n // No result; the node failed us in unexpected ways\n if (resp == null) {\n const error = makeError(\"missing response for request\", \"BAD_DATA\", {\n value: result, info: { payload }\n });\n this.emit(\"error\", error);\n reject(error);\n continue;\n }\n // The response is an error\n if (\"error\" in resp) {\n reject(this.getRpcError(payload, resp));\n continue;\n }\n // All good; send the result\n resolve(resp.result);\n }\n }\n catch (error) {\n this.emit(\"debug\", { action: \"receiveRpcError\", error });\n for (const { reject } of batch) {\n // @TODO: augment the error with the payload\n reject(error);\n }\n }\n })();\n }\n }, stallTime);\n }\n constructor(network, options) {\n super(network, options);\n this.#nextId = 1;\n this.#options = Object.assign({}, defaultOptions, options || {});\n this.#payloads = [];\n this.#drainTimer = null;\n this.#network = null;\n this.#pendingDetectNetwork = null;\n {\n let resolve = null;\n const promise = new Promise((_resolve) => {\n resolve = _resolve;\n });\n this.#notReady = { promise, resolve };\n }\n const staticNetwork = this._getOption(\"staticNetwork\");\n if (typeof (staticNetwork) === \"boolean\") {\n assertArgument(!staticNetwork || network !== \"any\", \"staticNetwork cannot be used on special network 'any'\", \"options\", options);\n if (staticNetwork && network != null) {\n this.#network = Network.from(network);\n }\n }\n else if (staticNetwork) {\n // Make sure any static network is compatbile with the provided netwrok\n assertArgument(network == null || staticNetwork.matches(network), \"staticNetwork MUST match network object\", \"options\", options);\n this.#network = staticNetwork;\n }\n }\n /**\n * Returns the value associated with the option %%key%%.\n *\n * Sub-classes can use this to inquire about configuration options.\n */\n _getOption(key) {\n return this.#options[key];\n }\n /**\n * Gets the [[Network]] this provider has committed to. On each call, the network\n * is detected, and if it has changed, the call will reject.\n */\n get _network() {\n assert(this.#network, \"network is not available yet\", \"NETWORK_ERROR\");\n return this.#network;\n }\n /**\n * Resolves to the non-normalized value by performing %%req%%.\n *\n * Sub-classes may override this to modify behavior of actions,\n * and should generally call ``super._perform`` as a fallback.\n */\n async _perform(req) {\n // Legacy networks do not like the type field being passed along (which\n // is fair), so we delete type if it is 0 and a non-EIP-1559 network\n if (req.method === \"call\" || req.method === \"estimateGas\") {\n let tx = req.transaction;\n if (tx && tx.type != null && getBigInt(tx.type)) {\n // If there are no EIP-1559 or newer properties, it might be pre-EIP-1559\n if (tx.maxFeePerGas == null && tx.maxPriorityFeePerGas == null) {\n const feeData = await this.getFeeData();\n if (feeData.maxFeePerGas == null && feeData.maxPriorityFeePerGas == null) {\n // Network doesn't know about EIP-1559 (and hence type)\n req = Object.assign({}, req, {\n transaction: Object.assign({}, tx, { type: undefined })\n });\n }\n }\n }\n }\n const request = this.getRpcRequest(req);\n if (request != null) {\n return await this.send(request.method, request.args);\n }\n return super._perform(req);\n }\n /**\n * Sub-classes may override this; it detects the *actual* network that\n * we are **currently** connected to.\n *\n * Keep in mind that [[send]] may only be used once [[ready]], otherwise the\n * _send primitive must be used instead.\n */\n async _detectNetwork() {\n const network = this._getOption(\"staticNetwork\");\n if (network) {\n if (network === true) {\n if (this.#network) {\n return this.#network;\n }\n }\n else {\n return network;\n }\n }\n if (this.#pendingDetectNetwork) {\n return await this.#pendingDetectNetwork;\n }\n // If we are ready, use ``send``, which enabled requests to be batched\n if (this.ready) {\n this.#pendingDetectNetwork = (async () => {\n try {\n const result = Network.from(getBigInt(await this.send(\"eth_chainId\", [])));\n this.#pendingDetectNetwork = null;\n return result;\n }\n catch (error) {\n this.#pendingDetectNetwork = null;\n throw error;\n }\n })();\n return await this.#pendingDetectNetwork;\n }\n // We are not ready yet; use the primitive _send\n this.#pendingDetectNetwork = (async () => {\n const payload = {\n id: this.#nextId++, method: \"eth_chainId\", params: [], jsonrpc: \"2.0\"\n };\n this.emit(\"debug\", { action: \"sendRpcPayload\", payload });\n let result;\n try {\n result = (await this._send(payload))[0];\n this.#pendingDetectNetwork = null;\n }\n catch (error) {\n this.#pendingDetectNetwork = null;\n this.emit(\"debug\", { action: \"receiveRpcError\", error });\n throw error;\n }\n this.emit(\"debug\", { action: \"receiveRpcResult\", result });\n if (\"result\" in result) {\n return Network.from(getBigInt(result.result));\n }\n throw this.getRpcError(payload, result);\n })();\n return await this.#pendingDetectNetwork;\n }\n /**\n * Sub-classes **MUST** call this. Until [[_start]] has been called, no calls\n * will be passed to [[_send]] from [[send]]. If it is overridden, then\n * ``super._start()`` **MUST** be called.\n *\n * Calling it multiple times is safe and has no effect.\n */\n _start() {\n if (this.#notReady == null || this.#notReady.resolve == null) {\n return;\n }\n this.#notReady.resolve();\n this.#notReady = null;\n (async () => {\n // Bootstrap the network\n while (this.#network == null && !this.destroyed) {\n try {\n this.#network = await this._detectNetwork();\n }\n catch (error) {\n if (this.destroyed) {\n break;\n }\n console.log(\"JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)\");\n this.emit(\"error\", makeError(\"failed to bootstrap network detection\", \"NETWORK_ERROR\", { event: \"initial-network-discovery\", info: { error } }));\n await stall(1000);\n }\n }\n // Start dispatching requests\n this.#scheduleDrain();\n })();\n }\n /**\n * Resolves once the [[_start]] has been called. This can be used in\n * sub-classes to defer sending data until the connection has been\n * established.\n */\n async _waitUntilReady() {\n if (this.#notReady == null) {\n return;\n }\n return await this.#notReady.promise;\n }\n /**\n * Return a Subscriber that will manage the %%sub%%.\n *\n * Sub-classes may override this to modify the behavior of\n * subscription management.\n */\n _getSubscriber(sub) {\n // Pending Filters aren't availble via polling\n if (sub.type === \"pending\") {\n return new FilterIdPendingSubscriber(this);\n }\n if (sub.type === \"event\") {\n if (this._getOption(\"polling\")) {\n return new PollingEventSubscriber(this, sub.filter);\n }\n return new FilterIdEventSubscriber(this, sub.filter);\n }\n // Orphaned Logs are handled automatically, by the filter, since\n // logs with removed are emitted by it\n if (sub.type === \"orphan\" && sub.filter.orphan === \"drop-log\") {\n return new UnmanagedSubscriber(\"orphan\");\n }\n return super._getSubscriber(sub);\n }\n /**\n * Returns true only if the [[_start]] has been called.\n */\n get ready() { return this.#notReady == null; }\n /**\n * Returns %%tx%% as a normalized JSON-RPC transaction request,\n * which has all values hexlified and any numeric values converted\n * to Quantity values.\n */\n getRpcTransaction(tx) {\n const result = {};\n // JSON-RPC now requires numeric values to be \"quantity\" values\n [\"chainId\", \"gasLimit\", \"gasPrice\", \"type\", \"maxFeePerGas\", \"maxPriorityFeePerGas\", \"nonce\", \"value\"].forEach((key) => {\n if (tx[key] == null) {\n return;\n }\n let dstKey = key;\n if (key === \"gasLimit\") {\n dstKey = \"gas\";\n }\n result[dstKey] = toQuantity(getBigInt(tx[key], `tx.${key}`));\n });\n // Make sure addresses and data are lowercase\n [\"from\", \"to\", \"data\"].forEach((key) => {\n if (tx[key] == null) {\n return;\n }\n result[key] = hexlify(tx[key]);\n });\n // Normalize the access list object\n if (tx.accessList) {\n result[\"accessList\"] = accessListify(tx.accessList);\n }\n if (tx.blobVersionedHashes) {\n // @TODO: Remove this <any> case once EIP-4844 added to prepared tx\n result[\"blobVersionedHashes\"] = tx.blobVersionedHashes.map(h => h.toLowerCase());\n }\n if (tx.authorizationList) {\n result[\"authorizationList\"] = tx.authorizationList.map((_a) => {\n const a = authorizationify(_a);\n return {\n address: a.address,\n nonce: toQuantity(a.nonce),\n chainId: toQuantity(a.chainId),\n yParity: toQuantity(a.signature.yParity),\n r: toQuantity(a.signature.r),\n s: toQuantity(a.signature.s),\n };\n });\n }\n // @TODO: blobs should probably also be copied over, optionally\n // accounting for the kzg property to backfill blobVersionedHashes\n // using the commitment. Or should that be left as an exercise to\n // the caller?\n return result;\n }\n /**\n * Returns the request method and arguments required to perform\n * %%req%%.\n */\n getRpcRequest(req) {\n switch (req.method) {\n case \"chainId\":\n return { method: \"eth_chainId\", args: [] };\n case \"getBlockNumber\":\n return { method: \"eth_blockNumber\", args: [] };\n case \"getGasPrice\":\n return { method: \"eth_gasPrice\", args: [] };\n case \"getPriorityFee\":\n return { method: \"eth_maxPriorityFeePerGas\", args: [] };\n case \"getBalance\":\n return {\n method: \"eth_getBalance\",\n args: [getLowerCase(req.address), req.blockTag]\n };\n case \"getTransactionCount\":\n return {\n method: \"eth_getTransactionCount\",\n args: [getLowerCase(req.address), req.blockTag]\n };\n case \"getCode\":\n return {\n method: \"eth_getCode\",\n args: [getLowerCase(req.address), req.blockTag]\n };\n case \"getStorage\":\n return {\n method: \"eth_getStorageAt\",\n args: [\n getLowerCase(req.address),\n (\"0x\" + req.position.toString(16)),\n req.blockTag\n ]\n };\n case \"broadcastTransaction\":\n return {\n method: \"eth_sendRawTransaction\",\n args: [req.signedTransaction]\n };\n case \"getBlock\":\n if (\"blockTag\" in req) {\n return {\n method: \"eth_getBlockByNumber\",\n args: [req.blockTag, !!req.includeTransactions]\n };\n }\n else if (\"blockHash\" in req) {\n return {\n method: \"eth_getBlockByHash\",\n args: [req.blockHash, !!req.includeTransactions]\n };\n }\n break;\n case \"getTransaction\":\n return {\n method: \"eth_getTransactionByHash\",\n args: [req.hash]\n };\n case \"getTransactionReceipt\":\n return {\n method: \"eth_getTransactionReceipt\",\n args: [req.hash]\n };\n case \"call\":\n return {\n method: \"eth_call\",\n args: [this.getRpcTransaction(req.transaction), req.blockTag]\n };\n case \"estimateGas\": {\n return {\n method: \"eth_estimateGas\",\n args: [this.getRpcTransaction(req.transaction)]\n };\n }\n case \"getLogs\":\n if (req.filter && req.filter.address != null) {\n if (Array.isArray(req.filter.address)) {\n req.filter.address = req.filter.address.map(getLowerCase);\n }\n else {\n req.filter.address = getLowerCase(req.filter.address);\n }\n }\n return { method: \"eth_getLogs\", args: [req.filter] };\n }\n return null;\n }\n /**\n * Returns an ethers-style Error for the given JSON-RPC error\n * %%payload%%, coalescing the various strings and error shapes\n * that different nodes return, coercing them into a machine-readable\n * standardized error.\n */\n getRpcError(payload, _error) {\n const { method } = payload;\n const { error } = _error;\n if (method === \"eth_estimateGas\" && error.message) {\n const msg = error.message;\n if (!msg.match(/revert/i) && msg.match(/insufficient funds/i)) {\n return makeError(\"insufficient funds\", \"INSUFFICIENT_FUNDS\", {\n transaction: (payload.params[0]),\n info: { payload, error }\n });\n }\n else if (msg.match(/nonce/i) && msg.match(/too low/i)) {\n return makeError(\"nonce has already been used\", \"NONCE_EXPIRED\", {\n transaction: (payload.params[0]),\n info: { payload, error }\n });\n }\n }\n if (method === \"eth_call\" || method === \"eth_estimateGas\") {\n const result = spelunkData(error);\n const e = AbiCoder.getBuiltinCallException((method === \"eth_call\") ? \"call\" : \"estimateGas\", (payload.params[0]), (result ? result.data : null));\n e.info = { error, payload };\n return e;\n }\n // Only estimateGas and call can return arbitrary contract-defined text, so now we\n // we can process text safely.\n const message = JSON.stringify(spelunkMessage(error));\n if (typeof (error.message) === \"string\" && error.message.match(/user denied|ethers-user-denied/i)) {\n const actionMap = {\n eth_sign: \"signMessage\",\n personal_sign: \"signMessage\",\n eth_signTypedData_v4: \"signTypedData\",\n eth_signTransaction: \"signTransaction\",\n eth_sendTransaction: \"sendTransaction\",\n eth_requestAccounts: \"requestAccess\",\n wallet_requestAccounts: \"requestAccess\",\n };\n return makeError(`user rejected action`, \"ACTION_REJECTED\", {\n action: (actionMap[method] || \"unknown\"),\n reason: \"rejected\",\n info: { payload, error }\n });\n }\n if (method === \"eth_sendRawTransaction\" || method === \"eth_sendTransaction\") {\n const transaction = (payload.params[0]);\n if (message.match(/insufficient funds|base fee exceeds gas limit/i)) {\n return makeError(\"insufficient funds for intrinsic transaction cost\", \"INSUFFICIENT_FUNDS\", {\n transaction, info: { error }\n });\n }\n if (message.match(/nonce/i) && message.match(/too low/i)) {\n return makeError(\"nonce has already been used\", \"NONCE_EXPIRED\", { transaction, info: { error } });\n }\n // \"replacement transaction underpriced\"\n if (message.match(/replacement transaction/i) && message.match(/underpriced/i)) {\n return makeError(\"replacement fee too low\", \"REPLACEMENT_UNDERPRICED\", { transaction, info: { error } });\n }\n if (message.match(/only replay-protected/i)) {\n return makeError(\"legacy pre-eip-155 transactions not supported\", \"UNSUPPORTED_OPERATION\", {\n operation: method, info: { transaction, info: { error } }\n });\n }\n }\n let unsupported = !!message.match(/the method .* does not exist/i);\n if (!unsupported) {\n if (error && error.details && error.details.startsWith(\"Unauthorized method:\")) {\n unsupported = true;\n }\n }\n if (unsupported) {\n return makeError(\"unsupported operation\", \"UNSUPPORTED_OPERATION\", {\n operation: payload.method, info: { error, payload }\n });\n }\n return makeError(\"could not coalesce error\", \"UNKNOWN_ERROR\", { error, payload });\n }\n /**\n * Requests the %%method%% with %%params%% via the JSON-RPC protocol\n * over the underlying channel. This can be used to call methods\n * on the backend that do not have a high-level API within the Provider\n * API.\n *\n * This method queues requests according to the batch constraints\n * in the options, assigns the request a unique ID.\n *\n * **Do NOT override** this method in sub-classes; instead\n * override [[_send]] or force the options values in the\n * call to the constructor to modify this method's behavior.\n */\n send(method, params) {\n // @TODO: cache chainId?? purge on switch_networks\n // We have been destroyed; no operations are supported anymore\n if (this.destroyed) {\n return Promise.reject(makeError(\"provider destroyed; cancelled request\", \"UNSUPPORTED_OPERATION\", { operation: method }));\n }\n const id = this.#nextId++;\n const promise = new Promise((resolve, reject) => {\n this.#payloads.push({\n resolve, reject,\n payload: { method, params, id, jsonrpc: \"2.0\" }\n });\n });\n // If there is not a pending drainTimer, set one\n this.#scheduleDrain();\n return promise;\n }\n /**\n * Resolves to the [[Signer]] account for %%address%% managed by\n * the client.\n *\n * If the %%address%% is a number, it is used as an index in the\n * the accounts from [[listAccounts]].\n *\n * This can only be used on clients which manage accounts (such as\n * Geth with imported account or MetaMask).\n *\n * Throws if the account doesn't exist.\n */\n async getSigner(address) {\n if (address == null) {\n address = 0;\n }\n const accountsPromise = this.send(\"eth_accounts\", []);\n // Account index\n if (typeof (address) === \"number\") {\n const accounts = (await accountsPromise);\n if (address >= accounts.length) {\n throw new Error(\"no such account\");\n }\n return new JsonRpcSigner(this, accounts[address]);\n }\n const { accounts } = await resolveProperties({\n network: this.getNetwork(),\n accounts: accountsPromise\n });\n // Account address\n address = getAddress(address);\n for (const account of accounts) {\n if (getAddress(account) === address) {\n return new JsonRpcSigner(this, address);\n }\n }\n throw new Error(\"invalid account\");\n }\n async listAccounts() {\n const accounts = await this.send(\"eth_accounts\", []);\n return accounts.map((a) => new JsonRpcSigner(this, a));\n }\n destroy() {\n // Stop processing requests\n if (this.#drainTimer) {\n clearTimeout(this.#drainTimer);\n this.#drainTimer = null;\n }\n // Cancel all pending requests\n for (const { payload, reject } of this.#payloads) {\n reject(makeError(\"provider destroyed; cancelled request\", \"UNSUPPORTED_OPERATION\", { operation: payload.method }));\n }\n this.#payloads = [];\n // Parent clean-up\n super.destroy();\n }\n}\n// @TODO: remove this in v7, it is not exported because this functionality\n// is exposed in the JsonRpcApiProvider by setting polling to true. It should\n// be safe to remove regardless, because it isn't reachable, but just in case.\n/**\n * @_ignore:\n */\nexport class JsonRpcApiPollingProvider extends JsonRpcApiProvider {\n #pollingInterval;\n constructor(network, options) {\n super(network, options);\n let pollingInterval = this._getOption(\"pollingInterval\");\n if (pollingInterval == null) {\n pollingInterval = defaultOptions.pollingInterval;\n }\n this.#pollingInterval = pollingInterval;\n }\n _getSubscriber(sub) {\n const subscriber = super._getSubscriber(sub);\n if (isPollable(subscriber)) {\n subscriber.pollingInterval = this.#pollingInterval;\n }\n return subscriber;\n }\n /**\n * The polling interval (default: 4000 ms)\n */\n get pollingInterval() { return this.#pollingInterval; }\n set pollingInterval(value) {\n if (!Number.isInteger(value) || value < 0) {\n throw new Error(\"invalid interval\");\n }\n this.#pollingInterval = value;\n this._forEachSubscriber((sub) => {\n if (isPollable(sub)) {\n sub.pollingInterval = this.#pollingInterval;\n }\n });\n }\n}\n/**\n * The JsonRpcProvider is one of the most common Providers,\n * which performs all operations over HTTP (or HTTPS) requests.\n *\n * Events are processed by polling the backend for the current block\n * number; when it advances, all block-base events are then checked\n * for updates.\n */\nexport class JsonRpcProvider extends JsonRpcApiPollingProvider {\n #connect;\n constructor(url, network, options) {\n if (url == null) {\n url = \"http:/\\/localhost:8545\";\n }\n super(network, options);\n if (typeof (url) === \"string\") {\n this.#connect = new FetchRequest(url);\n }\n else {\n this.#connect = url.clone();\n }\n }\n _getConnection() {\n return this.#connect.clone();\n }\n async send(method, params) {\n // All requests are over HTTP, so we can just start handling requests\n // We do this here rather than the constructor so that we don't send any\n // requests to the network (i.e. eth_chainId) until we absolutely have to.\n await this._start();\n return await super.send(method, params);\n }\n async _send(payload) {\n // Configure a POST connection for the requested method\n const request = this._getConnection();\n request.body = JSON.stringify(payload);\n request.setHeader(\"content-type\", \"application/json\");\n const response = await request.send();\n response.assertOk();\n let resp = response.bodyJson;\n if (!Array.isArray(resp)) {\n resp = [resp];\n }\n return resp;\n }\n}\nfunction spelunkData(value) {\n if (value == null) {\n return null;\n }\n // These *are* the droids we're looking for.\n if (typeof (value.message) === \"string\" && value.message.match(/revert/i) && isHexString(value.data)) {\n return { message: value.message, data: value.data };\n }\n // Spelunk further...\n if (typeof (value) === \"object\") {\n for (const key in value) {\n const result = spelunkData(value[key]);\n if (result) {\n return result;\n }\n }\n return null;\n }\n // Might be a JSON string we can further descend...\n if (typeof (value) === \"string\") {\n try {\n return spelunkData(JSON.parse(value));\n }\n catch (error) { }\n }\n return null;\n}\nfunction _spelunkMessage(value, result) {\n if (value == null) {\n return;\n }\n // These *are* the droids we're looking for.\n if (typeof (value.message) === \"string\") {\n result.push(value.message);\n }\n // Spelunk further...\n if (typeof (value) === \"object\") {\n for (const key in value) {\n _spelunkMessage(value[key], result);\n }\n }\n // Might be a JSON string we can further descend...\n if (typeof (value) === \"string\") {\n try {\n return _spelunkMessage(JSON.parse(value), result);\n }\n catch (error) { }\n }\n}\nfunction spelunkMessage(value) {\n const result = [];\n _spelunkMessage(value, result);\n return result;\n}\n//# sourceMappingURL=provider-jsonrpc.js.map","/**\n * [js-sha3]{@link https://github.com/emn178/js-sha3}\n *\n * @version 0.9.3\n * @author Chen, Yi-Cyuan [emn178@gmail.com]\n * @copyright Chen, Yi-Cyuan 2015-2023\n * @license MIT\n */\n/*jslint bitwise: true */\n(function () {\n 'use strict';\n\n var INPUT_ERROR = 'input is invalid type';\n var FINALIZE_ERROR = 'finalize already called';\n var WINDOW = typeof window === 'object';\n var root = WINDOW ? window : {};\n if (root.JS_SHA3_NO_WINDOW) {\n WINDOW = false;\n }\n var WEB_WORKER = !WINDOW && typeof self === 'object';\n var NODE_JS = !root.JS_SHA3_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;\n if (NODE_JS) {\n root = global;\n } else if (WEB_WORKER) {\n root = self;\n }\n var COMMON_JS = !root.JS_SHA3_NO_COMMON_JS && typeof module === 'object' && module.exports;\n var AMD = typeof define === 'function' && define.amd;\n var ARRAY_BUFFER = !root.JS_SHA3_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined';\n var HEX_CHARS = '0123456789abcdef'.split('');\n var SHAKE_PADDING = [31, 7936, 2031616, 520093696];\n var CSHAKE_PADDING = [4, 1024, 262144, 67108864];\n var KECCAK_PADDING = [1, 256, 65536, 16777216];\n var PADDING = [6, 1536, 393216, 100663296];\n var SHIFT = [0, 8, 16, 24];\n var RC = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649,\n 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0,\n 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771,\n 2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648,\n 2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648];\n var BITS = [224, 256, 384, 512];\n var SHAKE_BITS = [128, 256];\n var OUTPUT_TYPES = ['hex', 'buffer', 'arrayBuffer', 'array', 'digest'];\n var CSHAKE_BYTEPAD = {\n '128': 168,\n '256': 136\n };\n\n\n var isArray = root.JS_SHA3_NO_NODE_JS || !Array.isArray\n ? function (obj) {\n return Object.prototype.toString.call(obj) === '[object Array]';\n }\n : Array.isArray;\n\n var isView = (ARRAY_BUFFER && (root.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView))\n ? function (obj) {\n return typeof obj === 'object' && obj.buffer && obj.buffer.constructor === ArrayBuffer;\n }\n : ArrayBuffer.isView;\n\n // [message: string, isString: bool]\n var formatMessage = function (message) {\n var type = typeof message;\n if (type === 'string') {\n return [message, true];\n }\n if (type !== 'object' || message === null) {\n throw new Error(INPUT_ERROR);\n }\n if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {\n return [new Uint8Array(message), false];\n }\n if (!isArray(message) && !isView(message)) {\n throw new Error(INPUT_ERROR);\n }\n return [message, false];\n }\n\n var empty = function (message) {\n return formatMessage(message)[0].length === 0;\n };\n\n var cloneArray = function (array) {\n var newArray = [];\n for (var i = 0; i < array.length; ++i) {\n newArray[i] = array[i];\n }\n return newArray;\n }\n\n var createOutputMethod = function (bits, padding, outputType) {\n return function (message) {\n return new Keccak(bits, padding, bits).update(message)[outputType]();\n };\n };\n\n var createShakeOutputMethod = function (bits, padding, outputType) {\n return function (message, outputBits) {\n return new Keccak(bits, padding, outputBits).update(message)[outputType]();\n };\n };\n\n var createCshakeOutputMethod = function (bits, padding, outputType) {\n return function (message, outputBits, n, s) {\n return methods['cshake' + bits].update(message, outputBits, n, s)[outputType]();\n };\n };\n\n var createKmacOutputMethod = function (bits, padding, outputType) {\n return function (key, message, outputBits, s) {\n return methods['kmac' + bits].update(key, message, outputBits, s)[outputType]();\n };\n };\n\n var createOutputMethods = function (method, createMethod, bits, padding) {\n for (var i = 0; i < OUTPUT_TYPES.length; ++i) {\n var type = OUTPUT_TYPES[i];\n method[type] = createMethod(bits, padding, type);\n }\n return method;\n };\n\n var createMethod = function (bits, padding) {\n var method = createOutputMethod(bits, padding, 'hex');\n method.create = function () {\n return new Keccak(bits, padding, bits);\n };\n method.update = function (message) {\n return method.create().update(message);\n };\n return createOutputMethods(method, createOutputMethod, bits, padding);\n };\n\n var createShakeMethod = function (bits, padding) {\n var method = createShakeOutputMethod(bits, padding, 'hex');\n method.create = function (outputBits) {\n return new Keccak(bits, padding, outputBits);\n };\n method.update = function (message, outputBits) {\n return method.create(outputBits).update(message);\n };\n return createOutputMethods(method, createShakeOutputMethod, bits, padding);\n };\n\n var createCshakeMethod = function (bits, padding) {\n var w = CSHAKE_BYTEPAD[bits];\n var method = createCshakeOutputMethod(bits, padding, 'hex');\n method.create = function (outputBits, n, s) {\n if (empty(n) && empty(s)) {\n return methods['shake' + bits].create(outputBits);\n } else {\n return new Keccak(bits, padding, outputBits).bytepad([n, s], w);\n }\n };\n method.update = function (message, outputBits, n, s) {\n return method.create(outputBits, n, s).update(message);\n };\n return createOutputMethods(method, createCshakeOutputMethod, bits, padding);\n };\n\n var createKmacMethod = function (bits, padding) {\n var w = CSHAKE_BYTEPAD[bits];\n var method = createKmacOutputMethod(bits, padding, 'hex');\n method.create = function (key, outputBits, s) {\n return new Kmac(bits, padding, outputBits).bytepad(['KMAC', s], w).bytepad([key], w);\n };\n method.update = function (key, message, outputBits, s) {\n return method.create(key, outputBits, s).update(message);\n };\n return createOutputMethods(method, createKmacOutputMethod, bits, padding);\n };\n\n var algorithms = [\n { name: 'keccak', padding: KECCAK_PADDING, bits: BITS, createMethod: createMethod },\n { name: 'sha3', padding: PADDING, bits: BITS, createMethod: createMethod },\n { name: 'shake', padding: SHAKE_PADDING, bits: SHAKE_BITS, createMethod: createShakeMethod },\n { name: 'cshake', padding: CSHAKE_PADDING, bits: SHAKE_BITS, createMethod: createCshakeMethod },\n { name: 'kmac', padding: CSHAKE_PADDING, bits: SHAKE_BITS, createMethod: createKmacMethod }\n ];\n\n var methods = {}, methodNames = [];\n\n for (var i = 0; i < algorithms.length; ++i) {\n var algorithm = algorithms[i];\n var bits = algorithm.bits;\n for (var j = 0; j < bits.length; ++j) {\n var methodName = algorithm.name + '_' + bits[j];\n methodNames.push(methodName);\n methods[methodName] = algorithm.createMethod(bits[j], algorithm.padding);\n if (algorithm.name !== 'sha3') {\n var newMethodName = algorithm.name + bits[j];\n methodNames.push(newMethodName);\n methods[newMethodName] = methods[methodName];\n }\n }\n }\n\n function Keccak(bits, padding, outputBits) {\n this.blocks = [];\n this.s = [];\n this.padding = padding;\n this.outputBits = outputBits;\n this.reset = true;\n this.finalized = false;\n this.block = 0;\n this.start = 0;\n this.blockCount = (1600 - (bits << 1)) >> 5;\n this.byteCount = this.blockCount << 2;\n this.outputBlocks = outputBits >> 5;\n this.extraBytes = (outputBits & 31) >> 3;\n\n for (var i = 0; i < 50; ++i) {\n this.s[i] = 0;\n }\n }\n\n Keccak.prototype.update = function (message) {\n if (this.finalized) {\n throw new Error(FINALIZE_ERROR);\n }\n var result = formatMessage(message);\n message = result[0];\n var isString = result[1];\n var blocks = this.blocks, byteCount = this.byteCount, length = message.length,\n blockCount = this.blockCount, index = 0, s = this.s, i, code;\n\n while (index < length) {\n if (this.reset) {\n this.reset = false;\n blocks[0] = this.block;\n for (i = 1; i < blockCount + 1; ++i) {\n blocks[i] = 0;\n }\n }\n if (isString) {\n for (i = this.start; index < length && i < byteCount; ++index) {\n code = message.charCodeAt(index);\n if (code < 0x80) {\n blocks[i >> 2] |= code << SHIFT[i++ & 3];\n } else if (code < 0x800) {\n blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else if (code < 0xd800 || code >= 0xe000) {\n blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else {\n code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));\n blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n }\n }\n } else {\n for (i = this.start; index < length && i < byteCount; ++index) {\n blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];\n }\n }\n this.lastByteIndex = i;\n if (i >= byteCount) {\n this.start = i - byteCount;\n this.block = blocks[blockCount];\n for (i = 0; i < blockCount; ++i) {\n s[i] ^= blocks[i];\n }\n f(s);\n this.reset = true;\n } else {\n this.start = i;\n }\n }\n return this;\n };\n\n Keccak.prototype.encode = function (x, right) {\n var o = x & 255, n = 1;\n var bytes = [o];\n x = x >> 8;\n o = x & 255;\n while (o > 0) {\n bytes.unshift(o);\n x = x >> 8;\n o = x & 255;\n ++n;\n }\n if (right) {\n bytes.push(n);\n } else {\n bytes.unshift(n);\n }\n this.update(bytes);\n return bytes.length;\n };\n\n Keccak.prototype.encodeString = function (str) {\n var result = formatMessage(str);\n str = result[0];\n var isString = result[1];\n var bytes = 0, length = str.length;\n if (isString) {\n for (var i = 0; i < str.length; ++i) {\n var code = str.charCodeAt(i);\n if (code < 0x80) {\n bytes += 1;\n } else if (code < 0x800) {\n bytes += 2;\n } else if (code < 0xd800 || code >= 0xe000) {\n bytes += 3;\n } else {\n code = 0x10000 + (((code & 0x3ff) << 10) | (str.charCodeAt(++i) & 0x3ff));\n bytes += 4;\n }\n }\n } else {\n bytes = length;\n }\n bytes += this.encode(bytes * 8);\n this.update(str);\n return bytes;\n };\n\n Keccak.prototype.bytepad = function (strs, w) {\n var bytes = this.encode(w);\n for (var i = 0; i < strs.length; ++i) {\n bytes += this.encodeString(strs[i]);\n }\n var paddingBytes = (w - bytes % w) % w;\n var zeros = [];\n zeros.length = paddingBytes;\n this.update(zeros);\n return this;\n };\n\n Keccak.prototype.finalize = function () {\n if (this.finalized) {\n return;\n }\n this.finalized = true;\n var blocks = this.blocks, i = this.lastByteIndex, blockCount = this.blockCount, s = this.s;\n blocks[i >> 2] |= this.padding[i & 3];\n if (this.lastByteIndex === this.byteCount) {\n blocks[0] = blocks[blockCount];\n for (i = 1; i < blockCount + 1; ++i) {\n blocks[i] = 0;\n }\n }\n blocks[blockCount - 1] |= 0x80000000;\n for (i = 0; i < blockCount; ++i) {\n s[i] ^= blocks[i];\n }\n f(s);\n };\n\n Keccak.prototype.toString = Keccak.prototype.hex = function () {\n this.finalize();\n\n var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,\n extraBytes = this.extraBytes, i = 0, j = 0;\n var hex = '', block;\n while (j < outputBlocks) {\n for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\n block = s[i];\n hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F] +\n HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F] +\n HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F] +\n HEX_CHARS[(block >> 28) & 0x0F] + HEX_CHARS[(block >> 24) & 0x0F];\n }\n if (j % blockCount === 0) {\n s = cloneArray(s);\n f(s);\n i = 0;\n }\n }\n if (extraBytes) {\n block = s[i];\n hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F];\n if (extraBytes > 1) {\n hex += HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F];\n }\n if (extraBytes > 2) {\n hex += HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F];\n }\n }\n return hex;\n };\n\n Keccak.prototype.arrayBuffer = function () {\n this.finalize();\n\n var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,\n extraBytes = this.extraBytes, i = 0, j = 0;\n var bytes = this.outputBits >> 3;\n var buffer;\n if (extraBytes) {\n buffer = new ArrayBuffer((outputBlocks + 1) << 2);\n } else {\n buffer = new ArrayBuffer(bytes);\n }\n var array = new Uint32Array(buffer);\n while (j < outputBlocks) {\n for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\n array[j] = s[i];\n }\n if (j % blockCount === 0) {\n s = cloneArray(s);\n f(s);\n }\n }\n if (extraBytes) {\n array[j] = s[i];\n buffer = buffer.slice(0, bytes);\n }\n return buffer;\n };\n\n Keccak.prototype.buffer = Keccak.prototype.arrayBuffer;\n\n Keccak.prototype.digest = Keccak.prototype.array = function () {\n this.finalize();\n\n var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,\n extraBytes = this.extraBytes, i = 0, j = 0;\n var array = [], offset, block;\n while (j < outputBlocks) {\n for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\n offset = j << 2;\n block = s[i];\n array[offset] = block & 0xFF;\n array[offset + 1] = (block >> 8) & 0xFF;\n array[offset + 2] = (block >> 16) & 0xFF;\n array[offset + 3] = (block >> 24) & 0xFF;\n }\n if (j % blockCount === 0) {\n s = cloneArray(s);\n f(s);\n }\n }\n if (extraBytes) {\n offset = j << 2;\n block = s[i];\n array[offset] = block & 0xFF;\n if (extraBytes > 1) {\n array[offset + 1] = (block >> 8) & 0xFF;\n }\n if (extraBytes > 2) {\n array[offset + 2] = (block >> 16) & 0xFF;\n }\n }\n return array;\n };\n\n function Kmac(bits, padding, outputBits) {\n Keccak.call(this, bits, padding, outputBits);\n }\n\n Kmac.prototype = new Keccak();\n\n Kmac.prototype.finalize = function () {\n this.encode(this.outputBits, true);\n return Keccak.prototype.finalize.call(this);\n };\n\n var f = function (s) {\n var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9,\n b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17,\n b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33,\n b34, b35, b36, b37, b38, b39, b40, b41, b42, b43, b44, b45, b46, b47, b48, b49;\n for (n = 0; n < 48; n += 2) {\n c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40];\n c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41];\n c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42];\n c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43];\n c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44];\n c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45];\n c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46];\n c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47];\n c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48];\n c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49];\n\n h = c8 ^ ((c2 << 1) | (c3 >>> 31));\n l = c9 ^ ((c3 << 1) | (c2 >>> 31));\n s[0] ^= h;\n s[1] ^= l;\n s[10] ^= h;\n s[11] ^= l;\n s[20] ^= h;\n s[21] ^= l;\n s[30] ^= h;\n s[31] ^= l;\n s[40] ^= h;\n s[41] ^= l;\n h = c0 ^ ((c4 << 1) | (c5 >>> 31));\n l = c1 ^ ((c5 << 1) | (c4 >>> 31));\n s[2] ^= h;\n s[3] ^= l;\n s[12] ^= h;\n s[13] ^= l;\n s[22] ^= h;\n s[23] ^= l;\n s[32] ^= h;\n s[33] ^= l;\n s[42] ^= h;\n s[43] ^= l;\n h = c2 ^ ((c6 << 1) | (c7 >>> 31));\n l = c3 ^ ((c7 << 1) | (c6 >>> 31));\n s[4] ^= h;\n s[5] ^= l;\n s[14] ^= h;\n s[15] ^= l;\n s[24] ^= h;\n s[25] ^= l;\n s[34] ^= h;\n s[35] ^= l;\n s[44] ^= h;\n s[45] ^= l;\n h = c4 ^ ((c8 << 1) | (c9 >>> 31));\n l = c5 ^ ((c9 << 1) | (c8 >>> 31));\n s[6] ^= h;\n s[7] ^= l;\n s[16] ^= h;\n s[17] ^= l;\n s[26] ^= h;\n s[27] ^= l;\n s[36] ^= h;\n s[37] ^= l;\n s[46] ^= h;\n s[47] ^= l;\n h = c6 ^ ((c0 << 1) | (c1 >>> 31));\n l = c7 ^ ((c1 << 1) | (c0 >>> 31));\n s[8] ^= h;\n s[9] ^= l;\n s[18] ^= h;\n s[19] ^= l;\n s[28] ^= h;\n s[29] ^= l;\n s[38] ^= h;\n s[39] ^= l;\n s[48] ^= h;\n s[49] ^= l;\n\n b0 = s[0];\n b1 = s[1];\n b32 = (s[11] << 4) | (s[10] >>> 28);\n b33 = (s[10] << 4) | (s[11] >>> 28);\n b14 = (s[20] << 3) | (s[21] >>> 29);\n b15 = (s[21] << 3) | (s[20] >>> 29);\n b46 = (s[31] << 9) | (s[30] >>> 23);\n b47 = (s[30] << 9) | (s[31] >>> 23);\n b28 = (s[40] << 18) | (s[41] >>> 14);\n b29 = (s[41] << 18) | (s[40] >>> 14);\n b20 = (s[2] << 1) | (s[3] >>> 31);\n b21 = (s[3] << 1) | (s[2] >>> 31);\n b2 = (s[13] << 12) | (s[12] >>> 20);\n b3 = (s[12] << 12) | (s[13] >>> 20);\n b34 = (s[22] << 10) | (s[23] >>> 22);\n b35 = (s[23] << 10) | (s[22] >>> 22);\n b16 = (s[33] << 13) | (s[32] >>> 19);\n b17 = (s[32] << 13) | (s[33] >>> 19);\n b48 = (s[42] << 2) | (s[43] >>> 30);\n b49 = (s[43] << 2) | (s[42] >>> 30);\n b40 = (s[5] << 30) | (s[4] >>> 2);\n b41 = (s[4] << 30) | (s[5] >>> 2);\n b22 = (s[14] << 6) | (s[15] >>> 26);\n b23 = (s[15] << 6) | (s[14] >>> 26);\n b4 = (s[25] << 11) | (s[24] >>> 21);\n b5 = (s[24] << 11) | (s[25] >>> 21);\n b36 = (s[34] << 15) | (s[35] >>> 17);\n b37 = (s[35] << 15) | (s[34] >>> 17);\n b18 = (s[45] << 29) | (s[44] >>> 3);\n b19 = (s[44] << 29) | (s[45] >>> 3);\n b10 = (s[6] << 28) | (s[7] >>> 4);\n b11 = (s[7] << 28) | (s[6] >>> 4);\n b42 = (s[17] << 23) | (s[16] >>> 9);\n b43 = (s[16] << 23) | (s[17] >>> 9);\n b24 = (s[26] << 25) | (s[27] >>> 7);\n b25 = (s[27] << 25) | (s[26] >>> 7);\n b6 = (s[36] << 21) | (s[37] >>> 11);\n b7 = (s[37] << 21) | (s[36] >>> 11);\n b38 = (s[47] << 24) | (s[46] >>> 8);\n b39 = (s[46] << 24) | (s[47] >>> 8);\n b30 = (s[8] << 27) | (s[9] >>> 5);\n b31 = (s[9] << 27) | (s[8] >>> 5);\n b12 = (s[18] << 20) | (s[19] >>> 12);\n b13 = (s[19] << 20) | (s[18] >>> 12);\n b44 = (s[29] << 7) | (s[28] >>> 25);\n b45 = (s[28] << 7) | (s[29] >>> 25);\n b26 = (s[38] << 8) | (s[39] >>> 24);\n b27 = (s[39] << 8) | (s[38] >>> 24);\n b8 = (s[48] << 14) | (s[49] >>> 18);\n b9 = (s[49] << 14) | (s[48] >>> 18);\n\n s[0] = b0 ^ (~b2 & b4);\n s[1] = b1 ^ (~b3 & b5);\n s[10] = b10 ^ (~b12 & b14);\n s[11] = b11 ^ (~b13 & b15);\n s[20] = b20 ^ (~b22 & b24);\n s[21] = b21 ^ (~b23 & b25);\n s[30] = b30 ^ (~b32 & b34);\n s[31] = b31 ^ (~b33 & b35);\n s[40] = b40 ^ (~b42 & b44);\n s[41] = b41 ^ (~b43 & b45);\n s[2] = b2 ^ (~b4 & b6);\n s[3] = b3 ^ (~b5 & b7);\n s[12] = b12 ^ (~b14 & b16);\n s[13] = b13 ^ (~b15 & b17);\n s[22] = b22 ^ (~b24 & b26);\n s[23] = b23 ^ (~b25 & b27);\n s[32] = b32 ^ (~b34 & b36);\n s[33] = b33 ^ (~b35 & b37);\n s[42] = b42 ^ (~b44 & b46);\n s[43] = b43 ^ (~b45 & b47);\n s[4] = b4 ^ (~b6 & b8);\n s[5] = b5 ^ (~b7 & b9);\n s[14] = b14 ^ (~b16 & b18);\n s[15] = b15 ^ (~b17 & b19);\n s[24] = b24 ^ (~b26 & b28);\n s[25] = b25 ^ (~b27 & b29);\n s[34] = b34 ^ (~b36 & b38);\n s[35] = b35 ^ (~b37 & b39);\n s[44] = b44 ^ (~b46 & b48);\n s[45] = b45 ^ (~b47 & b49);\n s[6] = b6 ^ (~b8 & b0);\n s[7] = b7 ^ (~b9 & b1);\n s[16] = b16 ^ (~b18 & b10);\n s[17] = b17 ^ (~b19 & b11);\n s[26] = b26 ^ (~b28 & b20);\n s[27] = b27 ^ (~b29 & b21);\n s[36] = b36 ^ (~b38 & b30);\n s[37] = b37 ^ (~b39 & b31);\n s[46] = b46 ^ (~b48 & b40);\n s[47] = b47 ^ (~b49 & b41);\n s[8] = b8 ^ (~b0 & b2);\n s[9] = b9 ^ (~b1 & b3);\n s[18] = b18 ^ (~b10 & b12);\n s[19] = b19 ^ (~b11 & b13);\n s[28] = b28 ^ (~b20 & b22);\n s[29] = b29 ^ (~b21 & b23);\n s[38] = b38 ^ (~b30 & b32);\n s[39] = b39 ^ (~b31 & b33);\n s[48] = b48 ^ (~b40 & b42);\n s[49] = b49 ^ (~b41 & b43);\n\n s[0] ^= RC[n];\n s[1] ^= RC[n + 1];\n }\n };\n\n if (COMMON_JS) {\n module.exports = methods;\n } else {\n for (i = 0; i < methodNames.length; ++i) {\n root[methodNames[i]] = methods[methodNames[i]];\n }\n if (AMD) {\n define(function () {\n return methods;\n });\n }\n }\n})();\n","import { LogDescription, LogParams, Result, ParamType } from 'ethers'\nimport { GLOBAL_CONFIG, processMetrics } from '@sentio/runtime'\nimport { Piscina } from 'piscina'\n\nimport { decodeTraceInline, parseLogInline, IResult } from './decode-worker.js'\n\nfunction createOptions() {\n const options: any = {\n filename: findWorkFile()\n }\n if (GLOBAL_CONFIG.execution.ethAbiDecoderConfig?.workerCount) {\n try {\n const workerNum = GLOBAL_CONFIG.execution.ethAbiDecoderConfig?.workerCount\n options.maxThreads = workerNum\n options.minThreads = workerNum\n } catch (e) {}\n }\n return options\n}\n\nfunction findWorkFile() {\n let baseUrl = import.meta.url\n // find the base from @sentio/sdk\n const index = baseUrl.indexOf('/@sentio/sdk/')\n if (index > 0) {\n baseUrl = baseUrl.substring(0, index + 13)\n } else {\n // dev environment, path is .../packages/sdk/src/eth/abi-decoder/parse-log-worker.ts\n const index = baseUrl.indexOf('packages/sdk/')\n if (index > 0) {\n baseUrl = baseUrl.substring(0, index + 13)\n }\n }\n return new URL('./dist/eth/abi-decoder/decode-worker.js', baseUrl).href\n}\n\nexport async function parseLog(processor: any, log: LogParams) {\n if (GLOBAL_CONFIG.execution.ethAbiDecoderConfig?.enabled) {\n let workerPool = processor._logWorkerPool as Piscina\n const contractView = processor.CreateBoundContractView()\n const contractViewInterface = contractView.rawContract.interface\n if (!workerPool) {\n const fragments = contractViewInterface.fragments\n const options = createOptions()\n options.workerData = fragments\n\n workerPool = new Piscina(options)\n processor._logWorkerPool = workerPool\n }\n const start = Date.now()\n try {\n const result = (await workerPool.run({ log }, { name: 'parseLog' })) as any\n if (result) {\n const fragment = contractViewInterface.getEvent(result.topic)\n\n if (!fragment || fragment.anonymous) {\n return null\n }\n return new LogDescription(fragment, result.topic, Result.fromItems(result.args?.array ?? [], result.args?.keys))\n }\n } catch (e) {\n const skipWhenDecodeFailed = GLOBAL_CONFIG.execution.ethAbiDecoderConfig?.skipWhenDecodeFailed\n console.error(`parseLog worker failed, skip: ${!!skipWhenDecodeFailed}, the error is:`, e)\n if (!skipWhenDecodeFailed) {\n throw e\n }\n } finally {\n const labels = {\n chain_id: processor.config?.network,\n processor: processor.config?.name,\n workerPool: 'parseLog'\n }\n processMetrics.processor_worker_run_time.add(Date.now() - start, labels)\n processMetrics.processor_worker_completed.add(1, labels)\n processMetrics.processor_worker_queue_size.record(workerPool.queueSize, labels)\n }\n return null\n } else {\n const contractView = processor.CreateBoundContractView()\n const contractViewInterface = contractView.rawContract.interface\n return parseLogInline(contractViewInterface, log)\n }\n}\n\nexport async function decodeTrace(processor: any, inputs: readonly ParamType[], traceData: string) {\n if (GLOBAL_CONFIG.execution.ethAbiDecoderConfig?.enabled) {\n let workerPool = processor._traceWorkerPool\n if (!workerPool) {\n const contractView = processor.CreateBoundContractView()\n const contractViewInterface = contractView.rawContract.interface\n const fragments = contractViewInterface.fragments\n const options = createOptions()\n options.workerData = fragments\n\n workerPool = new Piscina(options)\n processor._traceWorkerPool = workerPool\n }\n const start = Date.now()\n try {\n const result = (await workerPool.run({ inputs, traceData }, { name: 'decodeTrace' })) as IResult\n if (result) {\n return Result.fromItems(result.array ?? [], result.keys)\n }\n } catch (e) {\n const skipWhenDecodeFailed = GLOBAL_CONFIG.execution.ethAbiDecoderConfig?.skipWhenDecodeFailed\n console.error(`decode trace worker failed, skip: ${!!skipWhenDecodeFailed}, the error is:`, e)\n if (!skipWhenDecodeFailed) {\n throw e\n }\n } finally {\n const labels = {\n chain_id: processor.config?.network,\n processor: processor.config?.name,\n workerPool: 'decodeTrace'\n }\n processMetrics.processor_worker_run_time.add(Date.now() - start, labels)\n processMetrics.processor_worker_completed.add(1, labels)\n processMetrics.processor_worker_queue_size.record(workerPool.queueSize, labels)\n }\n return null\n } else {\n const contractView = processor.CreateBoundContractView()\n const contractViewInterface = contractView.rawContract.interface\n return decodeTraceInline(contractViewInterface, inputs, traceData)\n }\n}\n","import { BaseContract, DeferredTopicFilter, LogDescription, LogParams, TransactionResponseParams } from 'ethers'\n\nimport { BoundContractView, ContractContext, ContractView, GlobalContext } from './context.js'\nimport {\n AddressType,\n type Data_EthBlock,\n type Data_EthLog,\n type Data_EthTrace,\n type Data_EthTransaction,\n type EthFetchConfig,\n EthFetchConfigSchema,\n type HandleInterval,\n HandleIntervalSchema,\n type PreparedData,\n type PreprocessResult,\n PreprocessResultSchema,\n type ProcessResult,\n ProcessResultSchema,\n timestampDate\n} from '@sentio/protos'\nimport { create } from '@bufbuild/protobuf'\nimport { ConnectError, Code } from '@connectrpc/connect'\nimport { BindOptions, TimeOrBlock } from './bind-options.js'\nimport { PromiseOrVoid } from '../core/promises.js'\nimport {\n fixEmptyKey,\n formatEthData,\n RawEvent,\n RichBlock,\n Trace,\n TypedCallTrace,\n TypedEvent,\n validateAndNormalizeAddress\n} from './eth.js'\nimport sha3 from 'js-sha3'\nimport { ListStateStorage } from '@sentio/runtime'\nimport { EthChainId } from '@sentio/chain'\nimport { getHandlerName, proxyHandlers, proxyProcessor } from '../utils/metrics.js'\nimport { ALL_ADDRESS, HandlerOptions } from '../core/index.js'\nimport { parseLog, decodeTrace } from './abi-decoder/index.js'\n\nexport interface AddressOrTypeEventFilter extends DeferredTopicFilter {\n addressType?: AddressType\n address?: string\n}\n\nexport const defaultPreprocessHandler = () => create(PreprocessResultSchema, { ethCallParams: [] }) as any\n\nexport class EventsHandler {\n filters: AddressOrTypeEventFilter[]\n handlerName: string\n handler: (event: Data_EthLog) => Promise<ProcessResult>\n preprocessHandler?: (event: Data_EthLog, preprocessStore: { [k: string]: any }) => Promise<PreprocessResult>\n fetchConfig: EthFetchConfig\n partitionHandler?: (event: Data_EthLog) => Promise<string | undefined>\n}\n\nexport class TraceHandler {\n signatures: string[]\n handlerName: string\n handler: (trace: Data_EthTrace) => Promise<ProcessResult>\n preprocessHandler?: (event: Data_EthTrace, preprocessStore: { [k: string]: any }) => Promise<PreprocessResult>\n fetchConfig: EthFetchConfig\n partitionHandler?: (trace: Data_EthTrace) => Promise<string | undefined>\n}\n\nexport class BlockHandler {\n blockInterval?: HandleInterval\n timeIntervalInMinutes?: HandleInterval\n handlerName: string\n handler: (block: Data_EthBlock) => Promise<ProcessResult>\n preprocessHandler?: (event: Data_EthBlock, preprocessStore: { [k: string]: any }) => Promise<PreprocessResult>\n fetchConfig: EthFetchConfig\n partitionHandler?: (block: Data_EthBlock) => Promise<string | undefined>\n}\n\nexport class TransactionHandler {\n handler: (tx: Data_EthTransaction) => Promise<ProcessResult>\n handlerName: string\n preprocessHandler?: (event: Data_EthTransaction, preprocessStore: { [k: string]: any }) => Promise<PreprocessResult>\n fetchConfig: EthFetchConfig\n partitionHandler?: (tx: Data_EthTransaction) => Promise<string | undefined>\n}\n\nclass BindInternalOptions {\n address: string\n network: EthChainId\n name: string\n start: TimeOrBlock\n end?: TimeOrBlock\n baseLabels?: { [key: string]: string }\n}\n\nexport class GlobalProcessorState extends ListStateStorage<GlobalProcessor> {\n static INSTANCE = new GlobalProcessorState()\n}\n\nexport class GlobalProcessor {\n config: BindInternalOptions\n blockHandlers: BlockHandler[] = proxyHandlers([])\n transactionHandler: TransactionHandler[] = proxyHandlers([])\n traceHandlers: TraceHandler[] = proxyHandlers([])\n eventHandlers: EventsHandler[] = []\n\n static bind(config: Omit<BindOptions, 'address'>): GlobalProcessor {\n const processor = new GlobalProcessor(config)\n GlobalProcessorState.INSTANCE.addValue(processor)\n return processor\n }\n\n constructor(config: Omit<BindOptions, 'address'>) {\n this.config = {\n address: ALL_ADDRESS,\n name: config.name || 'Global',\n network: config.network || EthChainId.ETHEREUM,\n start: config.start || {\n block: 0\n },\n end: config.end\n }\n if (config.startBlock) {\n this.config.start = {\n block: config.startBlock\n }\n }\n if (config.endBlock) {\n this.config.end = {\n block: config.endBlock\n }\n }\n\n return proxyProcessor(this)\n }\n\n public onBlockInterval(\n handler: (block: RichBlock, ctx: GlobalContext) => PromiseOrVoid,\n blockInterval = 250,\n backfillBlockInterval = 1000,\n handlerOptions?: HandlerOptions<EthFetchConfig, RichBlock>,\n preprocessHandler: (\n block: RichBlock,\n ctx: GlobalContext,\n preprocessStore: {\n [k: string]: any\n }\n ) => Promise<PreprocessResult> = defaultPreprocessHandler\n ): this {\n return this.onInterval(\n handler,\n undefined,\n create(HandleIntervalSchema, {\n recentInterval: blockInterval,\n backfillInterval: backfillBlockInterval\n }),\n handlerOptions,\n preprocessHandler\n )\n }\n\n public onTimeInterval(\n handler: (block: RichBlock, ctx: GlobalContext) => PromiseOrVoid,\n timeIntervalInMinutes = 60,\n backfillTimeIntervalInMinutes = 240,\n handlerOptions?: HandlerOptions<EthFetchConfig, RichBlock>,\n preprocessHandler: (\n block: RichBlock,\n ctx: GlobalContext,\n preprocessStore: {\n [k: string]: any\n }\n ) => Promise<PreprocessResult> = defaultPreprocessHandler\n ): this {\n return this.onInterval(\n handler,\n create(HandleIntervalSchema, {\n recentInterval: timeIntervalInMinutes,\n backfillInterval: backfillTimeIntervalInMinutes\n }),\n undefined,\n handlerOptions,\n preprocessHandler\n )\n }\n\n public getChainId(): EthChainId {\n return this.config.network\n }\n\n public onInterval(\n handler: (block: RichBlock, ctx: GlobalContext) => PromiseOrVoid,\n timeInterval: HandleInterval | undefined,\n blockInterval: HandleInterval | undefined,\n handlerOptions?: HandlerOptions<EthFetchConfig, RichBlock>,\n preprocessHandler: (\n block: RichBlock,\n ctx: GlobalContext,\n preprocessStore: {\n [k: string]: any\n }\n ) => Promise<PreprocessResult> = defaultPreprocessHandler\n ): this {\n const chainId = this.getChainId()\n if (timeInterval) {\n if (timeInterval.backfillInterval < timeInterval.recentInterval) {\n timeInterval.backfillInterval = timeInterval.recentInterval\n }\n }\n\n const processor = this\n this.blockHandlers.push({\n handlerName: getHandlerName(),\n handler: async function (data: Data_EthBlock) {\n const { block } = formatEthData(data)\n\n if (!block) {\n throw new ConnectError('Block is empty', Code.InvalidArgument)\n }\n\n const ctx = new GlobalContext(\n chainId,\n ALL_ADDRESS,\n new Date(block.timestamp * 1000),\n block,\n undefined,\n undefined,\n undefined,\n undefined,\n processor.config.baseLabels\n )\n await handler(block, ctx)\n return ctx.stopAndGetResult()\n },\n preprocessHandler: async function (data: Data_EthBlock, preprocessStore: { [k: string]: any }) {\n const { block } = formatEthData(data)\n\n if (!block) {\n throw new ConnectError('Block is empty', Code.InvalidArgument)\n }\n\n const ctx = new GlobalContext(\n chainId,\n ALL_ADDRESS,\n new Date(block.timestamp * 1000),\n block,\n undefined,\n undefined,\n undefined,\n undefined,\n processor.config.baseLabels\n )\n return preprocessHandler(block, ctx, preprocessStore)\n },\n timeIntervalInMinutes: timeInterval,\n blockInterval: blockInterval,\n fetchConfig: create(EthFetchConfigSchema, handlerOptions || {}),\n partitionHandler: async (data: Data_EthBlock): Promise<string | undefined> => {\n const p = handlerOptions?.partitionKey\n if (!p) return undefined\n if (typeof p === 'function') {\n const { block } = formatEthData(data)\n if (!block) return undefined\n return p(block)\n }\n return p\n }\n })\n return this\n }\n\n public onTransaction(\n handler: (transaction: TransactionResponseParams, ctx: GlobalContext) => PromiseOrVoid,\n handlerOptions?: HandlerOptions<EthFetchConfig, TransactionResponseParams>,\n preprocessHandler: (\n transaction: TransactionResponseParams,\n ctx: GlobalContext,\n preprocessStore: {\n [k: string]: any\n }\n ) => Promise<PreprocessResult> = defaultPreprocessHandler\n ): this {\n const chainId = this.getChainId()\n const processor = this\n\n this.transactionHandler.push({\n handlerName: getHandlerName(),\n handler: async function (data: Data_EthTransaction) {\n const { trace, block, transaction, transactionReceipt } = formatEthData(data)\n\n if (!transaction) {\n throw new ConnectError('transaction is empty', Code.InvalidArgument)\n }\n let to = transaction.to\n if (to === trace?.action.from) {\n to = '*'\n }\n const ctx = new GlobalContext(\n chainId,\n to || '*',\n data.timestamp ? timestampDate(data.timestamp) : undefined,\n block,\n undefined,\n trace,\n transaction,\n transactionReceipt,\n processor.config.baseLabels\n )\n await handler(transaction, ctx)\n return ctx.stopAndGetResult()\n },\n preprocessHandler: async function (data: Data_EthTransaction, preprocessStore: { [k: string]: any }) {\n const { trace, block, transaction, transactionReceipt } = formatEthData(data)\n\n if (!transaction) {\n throw new ConnectError('transaction is empty', Code.InvalidArgument)\n }\n let to = transaction.to\n if (to === trace?.action.from) {\n to = '*'\n }\n const ctx = new GlobalContext(\n chainId,\n to || '*',\n data.timestamp ? timestampDate(data.timestamp) : undefined,\n block,\n undefined,\n trace,\n transaction,\n transactionReceipt,\n processor.config.baseLabels\n )\n return preprocessHandler(transaction, ctx, preprocessStore)\n },\n fetchConfig: create(EthFetchConfigSchema, handlerOptions || {}),\n partitionHandler: async (data: Data_EthTransaction): Promise<string | undefined> => {\n const p = handlerOptions?.partitionKey\n if (!p) return undefined\n if (typeof p === 'function') {\n const { transaction } = formatEthData(data)\n return p(transaction)\n }\n return p\n }\n })\n return this\n }\n\n public onEvent(\n handler: (rawLog: LogParams, ctx: GlobalContext) => PromiseOrVoid,\n filter?: AddressOrTypeEventFilter | AddressOrTypeEventFilter[],\n handlerOptions?: HandlerOptions<EthFetchConfig, TypedEvent>\n ): this {\n let _filters: AddressOrTypeEventFilter[] = []\n\n if (Array.isArray(filter)) {\n _filters = filter\n } else if (filter) {\n _filters.push(filter)\n }\n const chainId = this.getChainId()\n\n this.eventHandlers.push({\n filters: _filters,\n fetchConfig: create(EthFetchConfigSchema, handlerOptions || {}),\n handlerName: getHandlerName(),\n handler: async function (data) {\n const { log, block, transaction, transactionReceipt } = formatEthData(data)\n if (!log) {\n throw new ConnectError('Log is empty', Code.InvalidArgument)\n }\n const ctx = new GlobalContext(\n chainId,\n transaction?.to || '*',\n data.timestamp ? timestampDate(data.timestamp) : undefined,\n block,\n log,\n undefined,\n transaction,\n transactionReceipt\n )\n\n await handler(log, ctx)\n return ctx.stopAndGetResult()\n }\n })\n return this\n }\n\n public onTrace(\n signatures: string | string[],\n handler: (trace: Trace, ctx: GlobalContext) => PromiseOrVoid,\n handlerOptions?: HandlerOptions<EthFetchConfig, Trace>,\n preprocessHandler: (\n trace: Trace,\n ctx: GlobalContext,\n preprocessStore: {\n [k: string]: any\n }\n ) => Promise<PreprocessResult> = defaultPreprocessHandler\n ): this {\n const chainId = this.getChainId()\n if (typeof signatures === 'string') {\n signatures = [signatures]\n }\n for (const signature of signatures) {\n if (signature.length <= 2) {\n throw new Error('Invalid signature length, must start with 0x')\n }\n }\n\n const processor = this\n\n this.traceHandlers.push({\n signatures,\n fetchConfig: create(EthFetchConfigSchema, handlerOptions || {}),\n handlerName: getHandlerName(),\n handler: async function (data: Data_EthTrace) {\n const { trace, block, transaction, transactionReceipt } = formatEthData(data)\n\n if (!trace) {\n throw new ConnectError('trace is null', Code.InvalidArgument)\n }\n const ctx = new GlobalContext(\n chainId,\n trace.action.to || '*',\n data.timestamp ? timestampDate(data.timestamp) : undefined,\n block,\n undefined,\n trace,\n transaction,\n transactionReceipt,\n processor.config.baseLabels\n )\n await handler(trace, ctx)\n return ctx.stopAndGetResult()\n },\n preprocessHandler: async function (data: Data_EthTrace, preprocessStore: { [k: string]: any }) {\n const { trace, block, transaction, transactionReceipt } = formatEthData(data)\n\n if (!trace) {\n throw new ConnectError('trace is null', Code.InvalidArgument)\n }\n const ctx = new GlobalContext(\n chainId,\n trace.action.to || '*',\n data.timestamp ? timestampDate(data.timestamp) : undefined,\n block,\n undefined,\n trace,\n transaction,\n transactionReceipt,\n processor.config.baseLabels\n )\n return preprocessHandler(trace, ctx, preprocessStore)\n },\n partitionHandler: async (data: Data_EthTrace): Promise<string | undefined> => {\n const p = handlerOptions?.partitionKey\n if (!p) return undefined\n if (typeof p === 'function') {\n const { trace } = formatEthData(data)\n if (!trace) return undefined\n return p(trace)\n }\n return p\n }\n })\n return this\n }\n}\n\nexport abstract class BaseProcessor<\n TContract extends BaseContract,\n TBoundContractView extends BoundContractView<TContract, ContractView<TContract>>\n> {\n blockHandlers: BlockHandler[] = proxyHandlers([])\n eventHandlers: EventsHandler[] = proxyHandlers([])\n traceHandlers: TraceHandler[] = proxyHandlers([])\n\n config: BindInternalOptions\n\n constructor(config: BindOptions) {\n this.config = {\n address: validateAndNormalizeAddress(config.address),\n name: config.name || '',\n network: config.network || EthChainId.ETHEREUM,\n start: config.start || {\n block: 0\n },\n end: config.end,\n baseLabels: config.baseLabels\n }\n if (config.startBlock) {\n this.config.start = {\n block: config.startBlock\n }\n }\n if (config.endBlock) {\n this.config.end = {\n block: config.endBlock\n }\n }\n\n return proxyProcessor(this)\n }\n\n protected abstract CreateBoundContractView(): TBoundContractView\n\n public getChainId(): EthChainId {\n return this.config.network\n }\n\n public onEvent<T extends TypedEvent = TypedEvent>(\n handler: (event: T, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,\n handlerOptions?: HandlerOptions<EthFetchConfig, T>,\n preprocessHandler: (\n event: T,\n ctx: ContractContext<TContract, TBoundContractView>,\n preprocessStore: { [k: string]: any }\n ) => Promise<PreprocessResult> = defaultPreprocessHandler\n ): this {\n const _filters: DeferredTopicFilter[] = []\n const tmpContract = this.CreateBoundContractView()\n\n for (const fragment of tmpContract.rawContract.interface.fragments) {\n if (fragment.type === 'event') {\n const filter = tmpContract.rawContract.filters[fragment.format()]\n _filters.push(filter())\n }\n }\n return this.onEthEvent(handler, _filters, handlerOptions, preprocessHandler)\n }\n\n protected onEthEvent<T extends TypedEvent | RawEvent = TypedEvent | RawEvent>(\n handler: (event: T, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,\n filter: DeferredTopicFilter | DeferredTopicFilter[],\n handlerOptions?: HandlerOptions<EthFetchConfig, T>,\n preprocessHandler: (\n event: T,\n ctx: ContractContext<TContract, TBoundContractView>,\n preprocessStore: { [k: string]: any }\n ) => Promise<PreprocessResult> = defaultPreprocessHandler,\n handlerName = getHandlerName()\n ): this {\n const chainId = this.getChainId()\n let _filters: DeferredTopicFilter[] = []\n\n if (Array.isArray(filter)) {\n _filters = filter\n } else {\n _filters.push(filter)\n }\n\n const contractName = this.config.name\n const processor = this\n this.eventHandlers.push({\n filters: _filters,\n fetchConfig: create(EthFetchConfigSchema, handlerOptions || {}),\n handlerName,\n handler: async function (data: Data_EthLog, preparedData?: PreparedData) {\n const { log, block, transaction, transactionReceipt } = formatEthData(data)\n if (!log) {\n throw new ConnectError('Log is empty', Code.InvalidArgument)\n }\n let contractView\n try {\n contractView = processor.CreateBoundContractView()\n } catch (e) {\n throw e\n // console.log(e)\n }\n if (processor.config.address === '*') {\n contractView.address = log.address\n }\n const ctx = new ContractContext<TContract, TBoundContractView>(\n contractName,\n contractView,\n chainId,\n data.timestamp ? timestampDate(data.timestamp) : undefined,\n block,\n log,\n undefined,\n transaction,\n transactionReceipt,\n processor.config.baseLabels,\n preparedData\n )\n if (handlerOptions?.skipDecoding) {\n await handler(log, ctx)\n return ctx.stopAndGetResult()\n }\n let parsed: LogDescription | null = null\n try {\n parsed = await getCachedParsedLog(data, processor, log)\n } catch (e) {\n // RangeError data out-of-bounds\n if (e instanceof Error) {\n if (e.message.includes('data out-of-bounds')) {\n console.error(\"Can't decode\", log, 'may because of incompatible ABIs, e.g. string vs indexed string', e)\n return create(ProcessResultSchema)\n }\n }\n throw e\n }\n if (parsed) {\n const event: TypedEvent = new TypedEvent(log, parsed.name, fixEmptyKey(parsed))\n await handler(event as T, ctx)\n return ctx.stopAndGetResult()\n }\n return create(ProcessResultSchema)\n },\n preprocessHandler: async function (\n data: Data_EthLog,\n preprocessStore: { [k: string]: any }\n ): Promise<PreprocessResult> {\n const { log, block, transaction, transactionReceipt } = formatEthData(data)\n if (!log) {\n throw new ConnectError('Log is empty', Code.InvalidArgument)\n }\n let contractView\n try {\n contractView = processor.CreateBoundContractView()\n } catch (e) {\n throw e\n // console.log(e)\n }\n if (processor.config.address === '*') {\n contractView.address = log.address\n }\n\n const ctx = new ContractContext<TContract, TBoundContractView>(\n contractName,\n contractView,\n chainId,\n data.timestamp ? timestampDate(data.timestamp) : undefined,\n block,\n log,\n undefined,\n transaction,\n transactionReceipt,\n processor.config.baseLabels\n )\n\n let parsed: LogDescription | null = null\n try {\n parsed = await getCachedParsedLog(data, processor, log)\n } catch (e) {\n // RangeError data out-of-bounds\n if (e instanceof Error) {\n if (e.message.includes('data out-of-bounds')) {\n console.error(\"Can't decode\", log, 'may because of incompatible ABIs, e.g. string vs indexed string', e)\n return create(PreprocessResultSchema)\n }\n }\n throw e\n }\n if (parsed) {\n const event: TypedEvent = new TypedEvent(log, parsed.name, fixEmptyKey(parsed))\n return preprocessHandler(event as T, ctx, preprocessStore)\n }\n return create(PreprocessResultSchema)\n },\n partitionHandler: async (data: Data_EthLog): Promise<string | undefined> => {\n const p = handlerOptions?.partitionKey\n if (!p) return undefined\n if (typeof p === 'function') {\n const { log } = formatEthData(data)\n if (!log) return undefined\n let parsed: LogDescription | null = null\n try {\n parsed = await getCachedParsedLog(data, processor, log)\n } catch (e) {\n return undefined\n }\n if (parsed) {\n const event: TypedEvent = new TypedEvent(log, parsed.name, fixEmptyKey(parsed))\n return p(event as T)\n }\n return undefined\n }\n return p\n }\n })\n return this\n }\n\n public onBlockInterval(\n handler: (block: RichBlock, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,\n blockInterval = 250,\n backfillBlockInterval = 1000,\n handlerOptions?: HandlerOptions<EthFetchConfig, RichBlock>,\n preprocessHandler: (\n block: RichBlock,\n ctx: ContractContext<TContract, TBoundContractView>,\n preprocessStore: { [k: string]: any }\n ) => Promise<PreprocessResult> = defaultPreprocessHandler\n ): this {\n return this.onInterval(\n handler,\n undefined,\n create(HandleIntervalSchema, {\n recentInterval: blockInterval,\n backfillInterval: backfillBlockInterval\n }),\n handlerOptions,\n preprocessHandler\n )\n }\n\n public onTimeInterval(\n handler: (block: RichBlock, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,\n timeIntervalInMinutes = 60,\n backfillTimeIntervalInMinutes = 240,\n handlerOptions?: HandlerOptions<EthFetchConfig, RichBlock>,\n preprocessHandler: (\n block: RichBlock,\n ctx: ContractContext<TContract, TBoundContractView>,\n preprocessStore: { [k: string]: any }\n ) => Promise<PreprocessResult> = defaultPreprocessHandler\n ): this {\n return this.onInterval(\n handler,\n create(HandleIntervalSchema, {\n recentInterval: timeIntervalInMinutes,\n backfillInterval: backfillTimeIntervalInMinutes\n }),\n undefined,\n handlerOptions,\n preprocessHandler\n )\n }\n\n public onInterval(\n handler: (block: RichBlock, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,\n timeInterval: HandleInterval | undefined,\n blockInterval: HandleInterval | undefined,\n handlerOptions?: HandlerOptions<EthFetchConfig, RichBlock>,\n preprocessHandler: (\n block: RichBlock,\n ctx: ContractContext<TContract, TBoundContractView>,\n preprocessStore: { [k: string]: any }\n ) => Promise<PreprocessResult> = defaultPreprocessHandler,\n handlerName = getHandlerName()\n ): this {\n const chainId = this.getChainId()\n const processor = this\n const contractName = this.config.name\n\n this.blockHandlers.push({\n handlerName,\n handler: async function (data: Data_EthBlock, preparedData?: PreparedData) {\n const { block } = formatEthData(data)\n\n if (!block) {\n throw new ConnectError('Block is empty', Code.InvalidArgument)\n }\n\n const contractView = processor.CreateBoundContractView()\n\n const ctx = new ContractContext<TContract, TBoundContractView>(\n contractName,\n contractView,\n chainId,\n new Date(block.timestamp * 1000),\n block,\n undefined,\n undefined,\n undefined,\n undefined,\n processor.config.baseLabels,\n preparedData\n )\n await handler(block, ctx)\n return ctx.stopAndGetResult()\n },\n preprocessHandler: async function (data: Data_EthBlock, preprocessStore: { [k: string]: any }) {\n const { block } = formatEthData(data)\n\n if (!block) {\n throw new ConnectError('Block is empty', Code.InvalidArgument)\n }\n\n const contractView = processor.CreateBoundContractView()\n\n const ctx = new ContractContext<TContract, TBoundContractView>(\n contractName,\n contractView,\n chainId,\n new Date(block.timestamp * 1000),\n block,\n undefined,\n undefined,\n undefined,\n undefined,\n processor.config.baseLabels\n )\n return preprocessHandler(block, ctx, preprocessStore)\n },\n timeIntervalInMinutes: timeInterval,\n blockInterval: blockInterval,\n fetchConfig: create(EthFetchConfigSchema, handlerOptions || {}),\n partitionHandler: async (data: Data_EthBlock): Promise<string | undefined> => {\n const p = handlerOptions?.partitionKey\n if (!p) return undefined\n if (typeof p === 'function') {\n const { block } = formatEthData(data)\n if (!block) return undefined\n return p(block)\n }\n return p\n }\n })\n return this\n }\n\n protected onEthTrace(\n signatures: string | string[],\n handler: (trace: TypedCallTrace, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,\n handlerOptions?: HandlerOptions<EthFetchConfig, TypedCallTrace>,\n preprocessHandler: (\n trace: TypedCallTrace,\n ctx: ContractContext<TContract, TBoundContractView>,\n preprocessStore: { [k: string]: any }\n ) => Promise<PreprocessResult> = defaultPreprocessHandler,\n handlerName = getHandlerName()\n ): this {\n const chainId = this.getChainId()\n const contractName = this.config.name\n const processor = this\n if (typeof signatures === 'string') {\n signatures = [signatures]\n }\n\n this.traceHandlers.push({\n signatures,\n fetchConfig: create(EthFetchConfigSchema, handlerOptions || {}),\n handlerName,\n handler: async function (data: Data_EthTrace, preparedData?: PreparedData) {\n const contractView = processor.CreateBoundContractView()\n const contractInterface = contractView.rawContract.interface\n const { trace, block, transaction, transactionReceipt } = formatEthData(data)\n const sighash = trace?.action.input?.slice(0, 10)\n if (!sighash) {\n throw new ConnectError('trace has no sighash', Code.InvalidArgument)\n }\n const fragment = contractInterface.getFunction(sighash)\n\n if (!trace || !fragment) {\n throw new ConnectError('trace is null', Code.InvalidArgument)\n }\n const typedTrace = trace as TypedCallTrace\n typedTrace.name = fragment.name\n typedTrace.functionSignature = fragment.format()\n // const trace = data.trace as Trace\n if (!trace?.action.input) {\n return create(ProcessResultSchema)\n }\n const traceData = '0x' + trace.action.input.slice(10)\n try {\n typedTrace.args = await decodeTrace(processor, fragment.inputs, traceData)\n // typedTrace.args = contractInterface.getAbiCoder().decode(fragment.inputs, traceData, true)\n } catch (e) {\n if (!trace.error) {\n throw e\n }\n console.error('Failed to decode successful trace', e)\n }\n const ctx = new ContractContext<TContract, TBoundContractView>(\n contractName,\n contractView,\n chainId,\n data.timestamp ? timestampDate(data.timestamp) : undefined,\n block,\n undefined,\n trace,\n transaction,\n transactionReceipt,\n processor.config.baseLabels,\n preparedData\n )\n await handler(typedTrace, ctx)\n return ctx.stopAndGetResult()\n },\n preprocessHandler: async function (data: Data_EthTrace, preprocessStore: { [k: string]: any }) {\n const contractView = processor.CreateBoundContractView()\n const contractInterface = contractView.rawContract.interface\n const { trace, block, transaction, transactionReceipt } = formatEthData(data)\n const sighash = trace?.action.input?.slice(0, 10)\n if (!sighash) {\n throw new ConnectError('trace has no sighash', Code.InvalidArgument)\n }\n const fragment = contractInterface.getFunction(sighash)\n\n if (!trace || !fragment) {\n throw new ConnectError('trace is null', Code.InvalidArgument)\n }\n const typedTrace = trace as TypedCallTrace\n typedTrace.name = fragment.name\n typedTrace.functionSignature = fragment.format()\n // const trace = data.trace as Trace\n if (!trace?.action.input) {\n return create(PreprocessResultSchema)\n }\n const traceData = '0x' + trace.action.input.slice(10)\n try {\n typedTrace.args = await decodeTrace(processor, fragment.inputs, traceData)\n } catch (e) {\n if (!trace.error) {\n throw e\n }\n console.error('Failed to decode successful trace', e)\n }\n const ctx = new ContractContext<TContract, TBoundContractView>(\n contractName,\n contractView,\n chainId,\n data.timestamp ? timestampDate(data.timestamp) : undefined,\n block,\n undefined,\n trace,\n transaction,\n transactionReceipt,\n processor.config.baseLabels\n )\n return preprocessHandler(typedTrace, ctx, preprocessStore)\n },\n partitionHandler: async (data: Data_EthTrace): Promise<string | undefined> => {\n const p = handlerOptions?.partitionKey\n if (!p) return undefined\n if (typeof p === 'function') {\n const contractView = processor.CreateBoundContractView()\n const contractInterface = contractView.rawContract.interface\n const { trace } = formatEthData(data)\n if (!trace) return undefined\n const sighash = trace.action.input?.slice(0, 10)\n if (!sighash) return undefined\n const fragment = contractInterface.getFunction(sighash)\n if (!fragment) return undefined\n const typedTrace = trace as TypedCallTrace\n typedTrace.name = fragment.name\n typedTrace.functionSignature = fragment.format()\n if (trace.action.input) {\n const traceData = '0x' + trace.action.input.slice(10)\n try {\n typedTrace.args = await decodeTrace(processor, fragment.inputs, traceData)\n } catch (e) {\n if (!trace.error) {\n throw e\n }\n }\n }\n return p(typedTrace)\n }\n return p\n }\n })\n return this\n }\n\n public onTrace(\n handler: (event: TypedCallTrace, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,\n handlerOptions?: HandlerOptions<EthFetchConfig, TypedCallTrace>,\n preprocessHandler: (\n trace: TypedCallTrace,\n ctx: ContractContext<TContract, TBoundContractView>,\n preprocessStore: { [k: string]: any }\n ) => Promise<PreprocessResult> = defaultPreprocessHandler\n ): this {\n const tmpContract = this.CreateBoundContractView()\n const sighashes = []\n\n for (const fragment of tmpContract.rawContract.interface.fragments) {\n if (fragment.type === 'function') {\n const signature = fragment.format()\n const test = new TextEncoder().encode(signature)\n const sighash = '0x' + sha3.keccak_256(test).substring(0, 8)\n sighashes.push(sighash)\n }\n }\n return this.onEthTrace(sighashes, handler, handlerOptions, preprocessHandler)\n }\n}\n\n// Helper function to get cached or parse log data\nasync function getCachedParsedLog(data: any, processor: any, log: any): Promise<LogDescription | null> {\n // Check if parsed log is already cached on data object\n if ((data as any).__parsedLog !== undefined) {\n return (data as any).__parsedLog\n }\n\n try {\n const parsed = await parseLog(processor, log)\n // Cache the parsed result on the data object\n ;(data as any).__parsedLog = parsed\n return parsed\n } catch (e) {\n // Cache the null result to avoid retrying\n ;(data as any).__parsedLog = null\n throw e\n }\n}\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","import EventEmitter from './index.js'\n\nexport { EventEmitter }\nexport default EventEmitter\n","export class TimeoutError extends Error {\n\tname = 'TimeoutError';\n\n\tconstructor(message, options) {\n\t\tsuper(message, options);\n\t\tError.captureStackTrace?.(this, TimeoutError);\n\t}\n}\n\nconst getAbortedReason = signal => signal.reason ?? new DOMException('This operation was aborted.', 'AbortError');\n\nexport default function pTimeout(promise, options) {\n\tconst {\n\t\tmilliseconds,\n\t\tfallback,\n\t\tmessage,\n\t\tcustomTimers = {setTimeout, clearTimeout},\n\t\tsignal,\n\t} = options;\n\n\tlet timer;\n\tlet abortHandler;\n\n\tconst wrappedPromise = new Promise((resolve, reject) => {\n\t\tif (typeof milliseconds !== 'number' || Math.sign(milliseconds) !== 1) {\n\t\t\tthrow new TypeError(`Expected \\`milliseconds\\` to be a positive number, got \\`${milliseconds}\\``);\n\t\t}\n\n\t\tif (signal?.aborted) {\n\t\t\treject(getAbortedReason(signal));\n\t\t\treturn;\n\t\t}\n\n\t\tif (signal) {\n\t\t\tabortHandler = () => {\n\t\t\t\treject(getAbortedReason(signal));\n\t\t\t};\n\n\t\t\tsignal.addEventListener('abort', abortHandler, {once: true});\n\t\t}\n\n\t\t// Use .then() instead of async IIFE to preserve stack traces\n\t\t// eslint-disable-next-line promise/prefer-await-to-then, promise/prefer-catch\n\t\tpromise.then(resolve, reject);\n\n\t\tif (milliseconds === Number.POSITIVE_INFINITY) {\n\t\t\treturn;\n\t\t}\n\n\t\t// We create the error outside of `setTimeout` to preserve the stack trace.\n\t\tconst timeoutError = new TimeoutError();\n\n\t\ttimer = customTimers.setTimeout(() => {\n\t\t\tif (fallback) {\n\t\t\t\ttry {\n\t\t\t\t\tresolve(fallback());\n\t\t\t\t} catch (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (typeof promise.cancel === 'function') {\n\t\t\t\tpromise.cancel();\n\t\t\t}\n\n\t\t\tif (message === false) {\n\t\t\t\tresolve();\n\t\t\t} else if (message instanceof Error) {\n\t\t\t\treject(message);\n\t\t\t} else {\n\t\t\t\ttimeoutError.message = message ?? `Promise timed out after ${milliseconds} milliseconds`;\n\t\t\t\treject(timeoutError);\n\t\t\t}\n\t\t}, milliseconds);\n\t});\n\n\t// eslint-disable-next-line promise/prefer-await-to-then\n\tconst cancelablePromise = wrappedPromise.finally(() => {\n\t\tcancelablePromise.clear();\n\t\tif (abortHandler && signal) {\n\t\t\tsignal.removeEventListener('abort', abortHandler);\n\t\t}\n\t});\n\n\tcancelablePromise.clear = () => {\n\t\tcustomTimers.clearTimeout(timer);\n\t\ttimer = undefined;\n\t};\n\n\treturn cancelablePromise;\n}\n","// Port of lower_bound from https://en.cppreference.com/w/cpp/algorithm/lower_bound\n// Used to compute insertion index to keep queue sorted after insertion\nexport default function lowerBound(array, value, comparator) {\n let first = 0;\n let count = array.length;\n while (count > 0) {\n const step = Math.trunc(count / 2);\n let it = first + step;\n if (comparator(array[it], value) <= 0) {\n first = ++it;\n count -= step + 1;\n }\n else {\n count = step;\n }\n }\n return first;\n}\n","import lowerBound from './lower-bound.js';\nexport default class PriorityQueue {\n #queue = [];\n enqueue(run, options) {\n const { priority = 0, id, } = options ?? {};\n const element = {\n priority,\n id,\n run,\n };\n if (this.size === 0 || this.#queue[this.size - 1].priority >= priority) {\n this.#queue.push(element);\n return;\n }\n const index = lowerBound(this.#queue, element, (a, b) => b.priority - a.priority);\n this.#queue.splice(index, 0, element);\n }\n setPriority(id, priority) {\n const index = this.#queue.findIndex((element) => element.id === id);\n if (index === -1) {\n throw new ReferenceError(`No promise function with the id \"${id}\" exists in the queue.`);\n }\n const [item] = this.#queue.splice(index, 1);\n this.enqueue(item.run, { priority, id });\n }\n dequeue() {\n const item = this.#queue.shift();\n return item?.run;\n }\n filter(options) {\n return this.#queue.filter((element) => element.priority === options.priority).map((element) => element.run);\n }\n get size() {\n return this.#queue.length;\n }\n}\n","import { EventEmitter } from 'eventemitter3';\nimport pTimeout from 'p-timeout';\nimport PriorityQueue from './priority-queue.js';\n/**\nPromise queue with concurrency control.\n*/\nexport default class PQueue extends EventEmitter {\n #carryoverIntervalCount;\n #isIntervalIgnored;\n #intervalCount = 0;\n #intervalCap;\n #rateLimitedInInterval = false;\n #rateLimitFlushScheduled = false;\n #interval;\n #intervalEnd = 0;\n #lastExecutionTime = 0;\n #intervalId;\n #timeoutId;\n #queue;\n #queueClass;\n #pending = 0;\n // The `!` is needed because of https://github.com/microsoft/TypeScript/issues/32194\n #concurrency;\n #isPaused;\n // Use to assign a unique identifier to a promise function, if not explicitly specified\n #idAssigner = 1n;\n // Track currently running tasks for debugging\n #runningTasks = new Map();\n /**\n Get or set the default timeout for all tasks. Can be changed at runtime.\n\n Operations will throw a `TimeoutError` if they don't complete within the specified time.\n\n The timeout begins when the operation is dequeued and starts execution, not while it's waiting in the queue.\n\n @example\n ```\n const queue = new PQueue({timeout: 5000});\n\n // Change timeout for all future tasks\n queue.timeout = 10000;\n ```\n */\n timeout;\n constructor(options) {\n super();\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n options = {\n carryoverIntervalCount: false,\n intervalCap: Number.POSITIVE_INFINITY,\n interval: 0,\n concurrency: Number.POSITIVE_INFINITY,\n autoStart: true,\n queueClass: PriorityQueue,\n ...options,\n };\n if (!(typeof options.intervalCap === 'number' && options.intervalCap >= 1)) {\n throw new TypeError(`Expected \\`intervalCap\\` to be a number from 1 and up, got \\`${options.intervalCap?.toString() ?? ''}\\` (${typeof options.intervalCap})`);\n }\n if (options.interval === undefined || !(Number.isFinite(options.interval) && options.interval >= 0)) {\n throw new TypeError(`Expected \\`interval\\` to be a finite number >= 0, got \\`${options.interval?.toString() ?? ''}\\` (${typeof options.interval})`);\n }\n // TODO: Remove this fallback in the next major version\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n this.#carryoverIntervalCount = options.carryoverIntervalCount ?? options.carryoverConcurrencyCount ?? false;\n this.#isIntervalIgnored = options.intervalCap === Number.POSITIVE_INFINITY || options.interval === 0;\n this.#intervalCap = options.intervalCap;\n this.#interval = options.interval;\n this.#queue = new options.queueClass();\n this.#queueClass = options.queueClass;\n this.concurrency = options.concurrency;\n if (options.timeout !== undefined && !(Number.isFinite(options.timeout) && options.timeout > 0)) {\n throw new TypeError(`Expected \\`timeout\\` to be a positive finite number, got \\`${options.timeout}\\` (${typeof options.timeout})`);\n }\n this.timeout = options.timeout;\n this.#isPaused = options.autoStart === false;\n this.#setupRateLimitTracking();\n }\n get #doesIntervalAllowAnother() {\n return this.#isIntervalIgnored || this.#intervalCount < this.#intervalCap;\n }\n get #doesConcurrentAllowAnother() {\n return this.#pending < this.#concurrency;\n }\n #next() {\n this.#pending--;\n if (this.#pending === 0) {\n this.emit('pendingZero');\n }\n this.#tryToStartAnother();\n this.emit('next');\n }\n #onResumeInterval() {\n this.#onInterval(); // Already schedules update\n this.#initializeIntervalIfNeeded();\n this.#timeoutId = undefined;\n }\n get #isIntervalPaused() {\n const now = Date.now();\n if (this.#intervalId === undefined) {\n const delay = this.#intervalEnd - now;\n if (delay < 0) {\n // If the interval has expired while idle, check if we should enforce the interval\n // from the last task execution. This ensures proper spacing between tasks even\n // when the queue becomes empty and then new tasks are added.\n if (this.#lastExecutionTime > 0) {\n const timeSinceLastExecution = now - this.#lastExecutionTime;\n if (timeSinceLastExecution < this.#interval) {\n // Not enough time has passed since the last task execution\n this.#createIntervalTimeout(this.#interval - timeSinceLastExecution);\n return true;\n }\n }\n // Enough time has passed or no previous execution, allow execution\n this.#intervalCount = (this.#carryoverIntervalCount) ? this.#pending : 0;\n }\n else {\n // Act as the interval is pending\n this.#createIntervalTimeout(delay);\n return true;\n }\n }\n return false;\n }\n #createIntervalTimeout(delay) {\n if (this.#timeoutId !== undefined) {\n return;\n }\n this.#timeoutId = setTimeout(() => {\n this.#onResumeInterval();\n }, delay);\n }\n #clearIntervalTimer() {\n if (this.#intervalId) {\n clearInterval(this.#intervalId);\n this.#intervalId = undefined;\n }\n }\n #clearTimeoutTimer() {\n if (this.#timeoutId) {\n clearTimeout(this.#timeoutId);\n this.#timeoutId = undefined;\n }\n }\n #tryToStartAnother() {\n if (this.#queue.size === 0) {\n // We can clear the interval (\"pause\")\n // Because we can redo it later (\"resume\")\n this.#clearIntervalTimer();\n this.emit('empty');\n if (this.#pending === 0) {\n // Clear timeout as well when completely idle\n this.#clearTimeoutTimer();\n this.emit('idle');\n }\n return false;\n }\n let taskStarted = false;\n if (!this.#isPaused) {\n const canInitializeInterval = !this.#isIntervalPaused;\n if (this.#doesIntervalAllowAnother && this.#doesConcurrentAllowAnother) {\n const job = this.#queue.dequeue();\n // Increment interval count immediately to prevent race conditions\n if (!this.#isIntervalIgnored) {\n this.#intervalCount++;\n this.#scheduleRateLimitUpdate();\n }\n this.emit('active');\n this.#lastExecutionTime = Date.now();\n job();\n if (canInitializeInterval) {\n this.#initializeIntervalIfNeeded();\n }\n taskStarted = true;\n }\n }\n return taskStarted;\n }\n #initializeIntervalIfNeeded() {\n if (this.#isIntervalIgnored || this.#intervalId !== undefined) {\n return;\n }\n this.#intervalId = setInterval(() => {\n this.#onInterval();\n }, this.#interval);\n this.#intervalEnd = Date.now() + this.#interval;\n }\n #onInterval() {\n if (this.#intervalCount === 0 && this.#pending === 0 && this.#intervalId) {\n this.#clearIntervalTimer();\n }\n this.#intervalCount = this.#carryoverIntervalCount ? this.#pending : 0;\n this.#processQueue();\n this.#scheduleRateLimitUpdate();\n }\n /**\n Executes all queued functions until it reaches the limit.\n */\n #processQueue() {\n // eslint-disable-next-line no-empty\n while (this.#tryToStartAnother()) { }\n }\n get concurrency() {\n return this.#concurrency;\n }\n set concurrency(newConcurrency) {\n if (!(typeof newConcurrency === 'number' && newConcurrency >= 1)) {\n throw new TypeError(`Expected \\`concurrency\\` to be a number from 1 and up, got \\`${newConcurrency}\\` (${typeof newConcurrency})`);\n }\n this.#concurrency = newConcurrency;\n this.#processQueue();\n }\n async #throwOnAbort(signal) {\n return new Promise((_resolve, reject) => {\n signal.addEventListener('abort', () => {\n reject(signal.reason);\n }, { once: true });\n });\n }\n /**\n Updates the priority of a promise function by its id, affecting its execution order. Requires a defined concurrency limit to take effect.\n\n For example, this can be used to prioritize a promise function to run earlier.\n\n ```js\n import PQueue from 'p-queue';\n\n const queue = new PQueue({concurrency: 1});\n\n queue.add(async () => '🦄', {priority: 1});\n queue.add(async () => '🦀', {priority: 0, id: '🦀'});\n queue.add(async () => '🦄', {priority: 1});\n queue.add(async () => '🦄', {priority: 1});\n\n queue.setPriority('🦀', 2);\n ```\n\n In this case, the promise function with `id: '🦀'` runs second.\n\n You can also deprioritize a promise function to delay its execution:\n\n ```js\n import PQueue from 'p-queue';\n\n const queue = new PQueue({concurrency: 1});\n\n queue.add(async () => '🦄', {priority: 1});\n queue.add(async () => '🦀', {priority: 1, id: '🦀'});\n queue.add(async () => '🦄');\n queue.add(async () => '🦄', {priority: 0});\n\n queue.setPriority('🦀', -1);\n ```\n Here, the promise function with `id: '🦀'` executes last.\n */\n setPriority(id, priority) {\n if (typeof priority !== 'number' || !Number.isFinite(priority)) {\n throw new TypeError(`Expected \\`priority\\` to be a finite number, got \\`${priority}\\` (${typeof priority})`);\n }\n this.#queue.setPriority(id, priority);\n }\n async add(function_, options = {}) {\n // In case `id` is not defined.\n options.id ??= (this.#idAssigner++).toString();\n options = {\n timeout: this.timeout,\n ...options,\n };\n return new Promise((resolve, reject) => {\n // Create a unique symbol for tracking this task\n const taskSymbol = Symbol(`task-${options.id}`);\n this.#queue.enqueue(async () => {\n this.#pending++;\n // Track this running task\n this.#runningTasks.set(taskSymbol, {\n id: options.id,\n priority: options.priority ?? 0, // Match priority-queue default\n startTime: Date.now(),\n timeout: options.timeout,\n });\n try {\n // Check abort signal - if aborted, need to decrement the counter\n // that was incremented in tryToStartAnother\n try {\n options.signal?.throwIfAborted();\n }\n catch (error) {\n // Decrement the counter that was already incremented\n if (!this.#isIntervalIgnored) {\n this.#intervalCount--;\n }\n // Clean up tracking before throwing\n this.#runningTasks.delete(taskSymbol);\n throw error;\n }\n let operation = function_({ signal: options.signal });\n if (options.timeout) {\n operation = pTimeout(Promise.resolve(operation), {\n milliseconds: options.timeout,\n message: `Task timed out after ${options.timeout}ms (queue has ${this.#pending} running, ${this.#queue.size} waiting)`,\n });\n }\n if (options.signal) {\n operation = Promise.race([operation, this.#throwOnAbort(options.signal)]);\n }\n const result = await operation;\n resolve(result);\n this.emit('completed', result);\n }\n catch (error) {\n reject(error);\n this.emit('error', error);\n }\n finally {\n // Remove from running tasks\n this.#runningTasks.delete(taskSymbol);\n // Use queueMicrotask to prevent deep recursion while maintaining timing\n queueMicrotask(() => {\n this.#next();\n });\n }\n }, options);\n this.emit('add');\n this.#tryToStartAnother();\n });\n }\n async addAll(functions, options) {\n return Promise.all(functions.map(async (function_) => this.add(function_, options)));\n }\n /**\n Start (or resume) executing enqueued tasks within concurrency limit. No need to call this if queue is not paused (via `options.autoStart = false` or by `.pause()` method.)\n */\n start() {\n if (!this.#isPaused) {\n return this;\n }\n this.#isPaused = false;\n this.#processQueue();\n return this;\n }\n /**\n Put queue execution on hold.\n */\n pause() {\n this.#isPaused = true;\n }\n /**\n Clear the queue.\n */\n clear() {\n this.#queue = new this.#queueClass();\n // Note: We don't clear #runningTasks as those tasks are still running\n // They will be removed when they complete in the finally block\n // Force synchronous update since clear() should have immediate effect\n this.#updateRateLimitState();\n }\n /**\n Can be called multiple times. Useful if you for example add additional items at a later time.\n\n @returns A promise that settles when the queue becomes empty.\n */\n async onEmpty() {\n // Instantly resolve if the queue is empty\n if (this.#queue.size === 0) {\n return;\n }\n await this.#onEvent('empty');\n }\n /**\n @returns A promise that settles when the queue size is less than the given limit: `queue.size < limit`.\n\n If you want to avoid having the queue grow beyond a certain size you can `await queue.onSizeLessThan()` before adding a new item.\n\n Note that this only limits the number of items waiting to start. There could still be up to `concurrency` jobs already running that this call does not include in its calculation.\n */\n async onSizeLessThan(limit) {\n // Instantly resolve if the queue is empty.\n if (this.#queue.size < limit) {\n return;\n }\n await this.#onEvent('next', () => this.#queue.size < limit);\n }\n /**\n The difference with `.onEmpty` is that `.onIdle` guarantees that all work from the queue has finished. `.onEmpty` merely signals that the queue is empty, but it could mean that some promises haven't completed yet.\n\n @returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`.\n */\n async onIdle() {\n // Instantly resolve if none pending and if nothing else is queued\n if (this.#pending === 0 && this.#queue.size === 0) {\n return;\n }\n await this.#onEvent('idle');\n }\n /**\n The difference with `.onIdle` is that `.onPendingZero` only waits for currently running tasks to finish, ignoring queued tasks.\n\n @returns A promise that settles when all currently running tasks have completed; `queue.pending === 0`.\n */\n async onPendingZero() {\n if (this.#pending === 0) {\n return;\n }\n await this.#onEvent('pendingZero');\n }\n /**\n @returns A promise that settles when the queue becomes rate-limited due to intervalCap.\n */\n async onRateLimit() {\n if (this.isRateLimited) {\n return;\n }\n await this.#onEvent('rateLimit');\n }\n /**\n @returns A promise that settles when the queue is no longer rate-limited.\n */\n async onRateLimitCleared() {\n if (!this.isRateLimited) {\n return;\n }\n await this.#onEvent('rateLimitCleared');\n }\n /**\n @returns A promise that rejects when any task in the queue errors.\n\n Use with `Promise.race([queue.onError(), queue.onIdle()])` to fail fast on the first error while still resolving normally when the queue goes idle.\n\n Important: The promise returned by `add()` still rejects. You must handle each `add()` promise (for example, `.catch(() => {})`) to avoid unhandled rejections.\n\n @example\n ```\n import PQueue from 'p-queue';\n\n const queue = new PQueue({concurrency: 2});\n\n queue.add(() => fetchData(1)).catch(() => {});\n queue.add(() => fetchData(2)).catch(() => {});\n queue.add(() => fetchData(3)).catch(() => {});\n\n // Stop processing on first error\n try {\n await Promise.race([\n queue.onError(),\n queue.onIdle()\n ]);\n } catch (error) {\n queue.pause(); // Stop processing remaining tasks\n console.error('Queue failed:', error);\n }\n ```\n */\n // eslint-disable-next-line @typescript-eslint/promise-function-async\n async onError() {\n return new Promise((_resolve, reject) => {\n const handleError = (error) => {\n this.off('error', handleError);\n reject(error);\n };\n this.on('error', handleError);\n });\n }\n async #onEvent(event, filter) {\n return new Promise(resolve => {\n const listener = () => {\n if (filter && !filter()) {\n return;\n }\n this.off(event, listener);\n resolve();\n };\n this.on(event, listener);\n });\n }\n /**\n Size of the queue, the number of queued items waiting to run.\n */\n get size() {\n return this.#queue.size;\n }\n /**\n Size of the queue, filtered by the given options.\n\n For example, this can be used to find the number of items remaining in the queue with a specific priority level.\n */\n sizeBy(options) {\n // eslint-disable-next-line unicorn/no-array-callback-reference\n return this.#queue.filter(options).length;\n }\n /**\n Number of running items (no longer in the queue).\n */\n get pending() {\n return this.#pending;\n }\n /**\n Whether the queue is currently paused.\n */\n get isPaused() {\n return this.#isPaused;\n }\n #setupRateLimitTracking() {\n // Only schedule updates when rate limiting is enabled\n if (this.#isIntervalIgnored) {\n return;\n }\n // Wire up to lifecycle events that affect rate limit state\n // Only 'add' and 'next' can actually change rate limit state\n this.on('add', () => {\n if (this.#queue.size > 0) {\n this.#scheduleRateLimitUpdate();\n }\n });\n this.on('next', () => {\n this.#scheduleRateLimitUpdate();\n });\n }\n #scheduleRateLimitUpdate() {\n // Skip if rate limiting is not enabled or already scheduled\n if (this.#isIntervalIgnored || this.#rateLimitFlushScheduled) {\n return;\n }\n this.#rateLimitFlushScheduled = true;\n queueMicrotask(() => {\n this.#rateLimitFlushScheduled = false;\n this.#updateRateLimitState();\n });\n }\n #updateRateLimitState() {\n const previous = this.#rateLimitedInInterval;\n const shouldBeRateLimited = !this.#isIntervalIgnored\n && this.#intervalCount >= this.#intervalCap\n && this.#queue.size > 0;\n if (shouldBeRateLimited !== previous) {\n this.#rateLimitedInInterval = shouldBeRateLimited;\n this.emit(shouldBeRateLimited ? 'rateLimit' : 'rateLimitCleared');\n }\n }\n /**\n Whether the queue is currently rate-limited due to intervalCap.\n */\n get isRateLimited() {\n return this.#rateLimitedInInterval;\n }\n /**\n Whether the queue is saturated. Returns `true` when:\n - All concurrency slots are occupied and tasks are waiting, OR\n - The queue is rate-limited and tasks are waiting\n\n Useful for detecting backpressure and potential hanging tasks.\n\n ```js\n import PQueue from 'p-queue';\n\n const queue = new PQueue({concurrency: 2});\n\n // Backpressure handling\n if (queue.isSaturated) {\n console.log('Queue is saturated, waiting for capacity...');\n await queue.onSizeLessThan(queue.concurrency);\n }\n\n // Monitoring for stuck tasks\n setInterval(() => {\n if (queue.isSaturated) {\n console.warn(`Queue saturated: ${queue.pending} running, ${queue.size} waiting`);\n }\n }, 60000);\n ```\n */\n get isSaturated() {\n return (this.#pending === this.#concurrency && this.#queue.size > 0)\n || (this.isRateLimited && this.#queue.size > 0);\n }\n /**\n The tasks currently being executed. Each task includes its `id`, `priority`, `startTime`, and `timeout` (if set).\n\n Returns an array of task info objects.\n\n ```js\n import PQueue from 'p-queue';\n\n const queue = new PQueue({concurrency: 2});\n\n // Add tasks with IDs for better debugging\n queue.add(() => fetchUser(123), {id: 'user-123'});\n queue.add(() => fetchPosts(456), {id: 'posts-456', priority: 1});\n\n // Check what's running\n console.log(queue.runningTasks);\n // => [{\n // id: 'user-123',\n // priority: 0,\n // startTime: 1759253001716,\n // timeout: undefined\n // }, {\n // id: 'posts-456',\n // priority: 1,\n // startTime: 1759253001916,\n // timeout: undefined\n // }]\n ```\n */\n get runningTasks() {\n // Return fresh array with fresh objects to prevent mutations\n return [...this.#runningTasks.values()].map(task => ({ ...task }));\n }\n}\n/**\nError thrown when a task times out.\n\n@example\n```\nimport PQueue, {TimeoutError} from 'p-queue';\n\nconst queue = new PQueue({timeout: 1000});\n\ntry {\n await queue.add(() => someTask());\n} catch (error) {\n if (error instanceof TimeoutError) {\n console.log('Task timed out');\n }\n}\n```\n*/\nexport { TimeoutError } from 'p-timeout';\n","/**\n * @module LRUCache\n */\nconst defaultPerf = (typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function') ?\n performance\n : Date;\nconst warned = new Set();\n/* c8 ignore start */\nconst PROCESS = (typeof process === 'object' && !!process ?\n process\n : {});\n/* c8 ignore start */\nconst emitWarning = (msg, type, code, fn) => {\n typeof PROCESS.emitWarning === 'function' ?\n PROCESS.emitWarning(msg, type, code, fn)\n : console.error(`[${code}] ${type}: ${msg}`);\n};\nlet AC = globalThis.AbortController;\nlet AS = globalThis.AbortSignal;\n/* c8 ignore start */\nif (typeof AC === 'undefined') {\n //@ts-ignore\n AS = class AbortSignal {\n onabort;\n _onabort = [];\n reason;\n aborted = false;\n addEventListener(_, fn) {\n this._onabort.push(fn);\n }\n };\n //@ts-ignore\n AC = class AbortController {\n constructor() {\n warnACPolyfill();\n }\n signal = new AS();\n abort(reason) {\n if (this.signal.aborted)\n return;\n //@ts-ignore\n this.signal.reason = reason;\n //@ts-ignore\n this.signal.aborted = true;\n //@ts-ignore\n for (const fn of this.signal._onabort) {\n fn(reason);\n }\n this.signal.onabort?.(reason);\n }\n };\n let printACPolyfillWarning = PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== '1';\n const warnACPolyfill = () => {\n if (!printACPolyfillWarning)\n return;\n printACPolyfillWarning = false;\n emitWarning('AbortController is not defined. If using lru-cache in ' +\n 'node 14, load an AbortController polyfill from the ' +\n '`node-abort-controller` package. A minimal polyfill is ' +\n 'provided for use by LRUCache.fetch(), but it should not be ' +\n 'relied upon in other contexts (eg, passing it to other APIs that ' +\n 'use AbortController/AbortSignal might have undesirable effects). ' +\n 'You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.', 'NO_ABORT_CONTROLLER', 'ENOTSUP', warnACPolyfill);\n };\n}\n/* c8 ignore stop */\nconst shouldWarn = (code) => !warned.has(code);\nconst TYPE = Symbol('type');\nconst isPosInt = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n);\n/* c8 ignore start */\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\nconst getUintArray = (max) => !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null;\n/* c8 ignore stop */\nclass ZeroArray extends Array {\n constructor(size) {\n super(size);\n this.fill(0);\n }\n}\nclass Stack {\n heap;\n length;\n // private constructor\n static #constructing = false;\n static create(max) {\n const HeapCls = getUintArray(max);\n if (!HeapCls)\n return [];\n Stack.#constructing = true;\n const s = new Stack(max, HeapCls);\n Stack.#constructing = false;\n return s;\n }\n constructor(max, HeapCls) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)');\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max);\n this.length = 0;\n }\n push(n) {\n this.heap[this.length++] = n;\n }\n pop() {\n return this.heap[--this.length];\n }\n}\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n #max;\n #maxSize;\n #dispose;\n #onInsert;\n #disposeAfter;\n #fetchMethod;\n #memoMethod;\n #perf;\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf;\n }\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl;\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution;\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge;\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet;\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas;\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale;\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet;\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL;\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize;\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation;\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection;\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet;\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort;\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection;\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort;\n // computed properties\n #size;\n #calculatedSize;\n #keyMap;\n #keyList;\n #valList;\n #next;\n #prev;\n #head;\n #tail;\n #free;\n #disposed;\n #sizes;\n #starts;\n #ttls;\n #hasDispose;\n #hasFetchMethod;\n #hasDisposeAfter;\n #hasOnInsert;\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals(c) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n sizes: c.#sizes,\n keyMap: c.#keyMap,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head;\n },\n get tail() {\n return c.#tail;\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p) => c.#isBackgroundFetch(p),\n backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context),\n moveToTail: (index) => c.#moveToTail(index),\n indexes: (options) => c.#indexes(options),\n rindexes: (options) => c.#rindexes(options),\n isStale: (index) => c.#isStale(index),\n };\n }\n // Protected read-only members\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max() {\n return this.#max;\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize() {\n return this.#maxSize;\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize() {\n return this.#calculatedSize;\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size() {\n return this.#size;\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod() {\n return this.#fetchMethod;\n }\n get memoMethod() {\n return this.#memoMethod;\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose;\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert;\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter;\n }\n constructor(options) {\n const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, perf, } = options;\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError('perf option must have a now() method if specified');\n }\n }\n this.#perf = perf ?? defaultPerf;\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer');\n }\n const UintArray = max ? getUintArray(max) : Array;\n if (!UintArray) {\n throw new Error('invalid max value: ' + max);\n }\n this.#max = max;\n this.#maxSize = maxSize;\n this.maxEntrySize = maxEntrySize || this.#maxSize;\n this.sizeCalculation = sizeCalculation;\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize');\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function');\n }\n }\n if (memoMethod !== undefined &&\n typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined');\n }\n this.#memoMethod = memoMethod;\n if (fetchMethod !== undefined &&\n typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified');\n }\n this.#fetchMethod = fetchMethod;\n this.#hasFetchMethod = !!fetchMethod;\n this.#keyMap = new Map();\n this.#keyList = new Array(max).fill(undefined);\n this.#valList = new Array(max).fill(undefined);\n this.#next = new UintArray(max);\n this.#prev = new UintArray(max);\n this.#head = 0;\n this.#tail = 0;\n this.#free = Stack.create(max);\n this.#size = 0;\n this.#calculatedSize = 0;\n if (typeof dispose === 'function') {\n this.#dispose = dispose;\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert;\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter;\n this.#disposed = [];\n }\n else {\n this.#disposeAfter = undefined;\n this.#disposed = undefined;\n }\n this.#hasDispose = !!this.#dispose;\n this.#hasOnInsert = !!this.#onInsert;\n this.#hasDisposeAfter = !!this.#disposeAfter;\n this.noDisposeOnSet = !!noDisposeOnSet;\n this.noUpdateTTL = !!noUpdateTTL;\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection;\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection;\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort;\n this.ignoreFetchAbort = !!ignoreFetchAbort;\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError('maxSize must be a positive integer if specified');\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError('maxEntrySize must be a positive integer if specified');\n }\n this.#initializeSizeTracking();\n }\n this.allowStale = !!allowStale;\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet;\n this.updateAgeOnGet = !!updateAgeOnGet;\n this.updateAgeOnHas = !!updateAgeOnHas;\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ?\n ttlResolution\n : 1;\n this.ttlAutopurge = !!ttlAutopurge;\n this.ttl = ttl || 0;\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified');\n }\n this.#initializeTTLTracking();\n }\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError('At least one of max, maxSize, or ttl is required');\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED';\n if (shouldWarn(code)) {\n warned.add(code);\n const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.';\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache);\n }\n }\n }\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key) {\n return this.#keyMap.has(key) ? Infinity : 0;\n }\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max);\n const starts = new ZeroArray(this.#max);\n this.#ttls = ttls;\n this.#starts = starts;\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0;\n ttls[index] = ttl;\n if (ttl !== 0 && this.ttlAutopurge) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index], 'expire');\n }\n }, ttl + 1);\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref();\n }\n /* c8 ignore stop */\n }\n };\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0;\n };\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index];\n const start = starts[index];\n /* c8 ignore next */\n if (!ttl || !start)\n return;\n status.ttl = ttl;\n status.start = start;\n status.now = cachedNow || getNow();\n const age = status.now - start;\n status.remainingTTL = ttl - age;\n }\n };\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0;\n const getNow = () => {\n const n = this.#perf.now();\n if (this.ttlResolution > 0) {\n cachedNow = n;\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution);\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref();\n }\n /* c8 ignore stop */\n }\n return n;\n };\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key);\n if (index === undefined) {\n return 0;\n }\n const ttl = ttls[index];\n const start = starts[index];\n if (!ttl || !start) {\n return Infinity;\n }\n const age = (cachedNow || getNow()) - start;\n return ttl - age;\n };\n this.#isStale = index => {\n const s = starts[index];\n const t = ttls[index];\n return !!t && !!s && (cachedNow || getNow()) - s > t;\n };\n }\n // conditionally set private methods related to TTL\n #updateItemAge = () => { };\n #statusTTL = () => { };\n #setItemTTL = () => { };\n /* c8 ignore stop */\n #isStale = () => false;\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max);\n this.#calculatedSize = 0;\n this.#sizes = sizes;\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index];\n sizes[index] = 0;\n };\n this.#requireSize = (k, v, size, sizeCalculation) => {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n return 0;\n }\n if (!isPosInt(size)) {\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function');\n }\n size = sizeCalculation(v, k);\n if (!isPosInt(size)) {\n throw new TypeError('sizeCalculation return invalid (expect positive integer)');\n }\n }\n else {\n throw new TypeError('invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.');\n }\n }\n return size;\n };\n this.#addItemSize = (index, size, status) => {\n sizes[index] = size;\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index];\n while (this.#calculatedSize > maxSize) {\n this.#evict(true);\n }\n }\n this.#calculatedSize += sizes[index];\n if (status) {\n status.entrySize = size;\n status.totalCalculatedSize = this.#calculatedSize;\n }\n };\n }\n #removeItemSize = _i => { };\n #addItemSize = (_i, _s, _st) => { };\n #requireSize = (_k, _v, size, sizeCalculation) => {\n if (size || sizeCalculation) {\n throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache');\n }\n return 0;\n };\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; true;) {\n if (!this.#isValidIndex(i)) {\n break;\n }\n if (allowStale || !this.#isStale(i)) {\n yield i;\n }\n if (i === this.#head) {\n break;\n }\n else {\n i = this.#prev[i];\n }\n }\n }\n }\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; true;) {\n if (!this.#isValidIndex(i)) {\n break;\n }\n if (allowStale || !this.#isStale(i)) {\n yield i;\n }\n if (i === this.#tail) {\n break;\n }\n else {\n i = this.#next[i];\n }\n }\n }\n }\n #isValidIndex(index) {\n return (index !== undefined &&\n this.#keyMap.get(this.#keyList[index]) === index);\n }\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])) {\n yield [this.#keyList[i], this.#valList[i]];\n }\n }\n }\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])) {\n yield [this.#keyList[i], this.#valList[i]];\n }\n }\n }\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i];\n if (k !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])) {\n yield k;\n }\n }\n }\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i];\n if (k !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])) {\n yield k;\n }\n }\n }\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i];\n if (v !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i];\n }\n }\n }\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i];\n if (v !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i];\n }\n }\n }\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries();\n }\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache';\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(fn, getOptions = {}) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i];\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;\n if (value === undefined)\n continue;\n if (fn(value, this.#keyList[i], this)) {\n return this.get(this.#keyList[i], getOptions);\n }\n }\n }\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(fn, thisp = this) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i];\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;\n if (value === undefined)\n continue;\n fn.call(thisp, value, this.#keyList[i], this);\n }\n }\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(fn, thisp = this) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i];\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;\n if (value === undefined)\n continue;\n fn.call(thisp, value, this.#keyList[i], this);\n }\n }\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false;\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i], 'expire');\n deleted = true;\n }\n }\n return deleted;\n }\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key) {\n const i = this.#keyMap.get(key);\n if (i === undefined)\n return undefined;\n const v = this.#valList[i];\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;\n if (value === undefined)\n return undefined;\n /* c8 ignore end */\n const entry = { value };\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i];\n const start = this.#starts[i];\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start);\n entry.ttl = remain;\n entry.start = Date.now();\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i];\n }\n return entry;\n }\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr = [];\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i];\n const v = this.#valList[i];\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;\n if (value === undefined || key === undefined)\n continue;\n const entry = { value };\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i];\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - this.#starts[i];\n entry.start = Math.floor(Date.now() - age);\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i];\n }\n arr.unshift([key, entry]);\n }\n return arr;\n }\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr) {\n this.clear();\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start;\n entry.start = this.#perf.now() - age;\n }\n this.set(key, entry.value, entry);\n }\n }\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(k, v, setOptions = {}) {\n if (v === undefined) {\n this.delete(k);\n return this;\n }\n const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions;\n let { noUpdateTTL = this.noUpdateTTL } = setOptions;\n const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation);\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n if (status) {\n status.set = 'miss';\n status.maxEntrySizeExceeded = true;\n }\n // have to delete, in case something is there already.\n this.#delete(k, 'set');\n return this;\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k);\n if (index === undefined) {\n // addition\n index = (this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size);\n this.#keyList[index] = k;\n this.#valList[index] = v;\n this.#keyMap.set(k, index);\n this.#next[this.#tail] = index;\n this.#prev[index] = this.#tail;\n this.#tail = index;\n this.#size++;\n this.#addItemSize(index, size, status);\n if (status)\n status.set = 'add';\n noUpdateTTL = false;\n if (this.#hasOnInsert) {\n this.#onInsert?.(v, k, 'add');\n }\n }\n else {\n // update\n this.#moveToTail(index);\n const oldVal = this.#valList[index];\n if (v !== oldVal) {\n if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {\n oldVal.__abortController.abort(new Error('replaced'));\n const { __staleWhileFetching: s } = oldVal;\n if (s !== undefined && !noDisposeOnSet) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set');\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set']);\n }\n }\n }\n else if (!noDisposeOnSet) {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set');\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set']);\n }\n }\n this.#removeItemSize(index);\n this.#addItemSize(index, size, status);\n this.#valList[index] = v;\n if (status) {\n status.set = 'replace';\n const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal;\n if (oldValue !== undefined)\n status.oldValue = oldValue;\n }\n }\n else if (status) {\n status.set = 'update';\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, v === oldVal ? 'update' : 'replace');\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking();\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start);\n }\n if (status)\n this.#statusTTL(status, index);\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed;\n let task;\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task);\n }\n }\n return this;\n }\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop() {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head];\n this.#evict(true);\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching;\n }\n }\n else if (val !== undefined) {\n return val;\n }\n }\n }\n finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed;\n let task;\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task);\n }\n }\n }\n }\n #evict(free) {\n const head = this.#head;\n const k = this.#keyList[head];\n const v = this.#valList[head];\n if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('evicted'));\n }\n else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v, k, 'evict');\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v, k, 'evict']);\n }\n }\n this.#removeItemSize(head);\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined;\n this.#valList[head] = undefined;\n this.#free.push(head);\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0;\n this.#free.length = 0;\n }\n else {\n this.#head = this.#next[head];\n }\n this.#keyMap.delete(k);\n this.#size--;\n return head;\n }\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k, hasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions;\n const index = this.#keyMap.get(k);\n if (index !== undefined) {\n const v = this.#valList[index];\n if (this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined) {\n return false;\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index);\n }\n if (status) {\n status.has = 'hit';\n this.#statusTTL(status, index);\n }\n return true;\n }\n else if (status) {\n status.has = 'stale';\n this.#statusTTL(status, index);\n }\n }\n else if (status) {\n status.has = 'miss';\n }\n return false;\n }\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k, peekOptions = {}) {\n const { allowStale = this.allowStale } = peekOptions;\n const index = this.#keyMap.get(k);\n if (index === undefined ||\n (!allowStale && this.#isStale(index))) {\n return;\n }\n const v = this.#valList[index];\n // either stale and allowed, or forcing a refresh of non-stale value\n return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;\n }\n #backgroundFetch(k, index, options, context) {\n const v = index === undefined ? undefined : this.#valList[index];\n if (this.#isBackgroundFetch(v)) {\n return v;\n }\n const ac = new AC();\n const { signal } = options;\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n });\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n };\n const cb = (v, updateCache = false) => {\n const { aborted } = ac.signal;\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined;\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true;\n options.status.fetchError = ac.signal.reason;\n if (ignoreAbort)\n options.status.fetchAbortIgnored = true;\n }\n else {\n options.status.fetchResolved = true;\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason);\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p;\n if (this.#valList[index] === p) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index] = bf.__staleWhileFetching;\n }\n else {\n this.#delete(k, 'fetch');\n }\n }\n else {\n if (options.status)\n options.status.fetchUpdated = true;\n this.set(k, v, fetchOpts.options);\n }\n }\n return v;\n };\n const eb = (er) => {\n if (options.status) {\n options.status.fetchRejected = true;\n options.status.fetchError = er;\n }\n return fetchFail(er);\n };\n const fetchFail = (er) => {\n const { aborted } = ac.signal;\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort;\n const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection;\n const noDelete = allowStale || options.noDeleteOnFetchRejection;\n const bf = p;\n if (this.#valList[index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del = !noDelete || bf.__staleWhileFetching === undefined;\n if (del) {\n this.#delete(k, 'fetch');\n }\n else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index] = bf.__staleWhileFetching;\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true;\n }\n return bf.__staleWhileFetching;\n }\n else if (bf.__returned === bf) {\n throw er;\n }\n };\n const pcall = (res, rej) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts);\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej);\n }\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort ||\n options.allowStaleOnFetchAbort) {\n res(undefined);\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true);\n }\n }\n });\n };\n if (options.status)\n options.status.fetchDispatched = true;\n const p = new Promise(pcall).then(cb, eb);\n const bf = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n });\n if (index === undefined) {\n // internal, don't expose status.\n this.set(k, bf, { ...fetchOpts.options, status: undefined });\n index = this.#keyMap.get(k);\n }\n else {\n this.#valList[index] = bf;\n }\n return bf;\n }\n #isBackgroundFetch(p) {\n if (!this.#hasFetchMethod)\n return false;\n const b = p;\n return (!!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AC);\n }\n async fetch(k, fetchOptions = {}) {\n const { \n // get options\n allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, \n // set options\n ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, \n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions;\n if (!this.#hasFetchMethod) {\n if (status)\n status.fetch = 'get';\n return this.get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n });\n }\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n };\n let index = this.#keyMap.get(k);\n if (index === undefined) {\n if (status)\n status.fetch = 'miss';\n const p = this.#backgroundFetch(k, index, options, context);\n return (p.__returned = p);\n }\n else {\n // in cache, maybe already fetching\n const v = this.#valList[index];\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined;\n if (status) {\n status.fetch = 'inflight';\n if (stale)\n status.returnedStale = true;\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v);\n }\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index);\n if (!forceRefresh && !isStale) {\n if (status)\n status.fetch = 'hit';\n this.#moveToTail(index);\n if (updateAgeOnGet) {\n this.#updateItemAge(index);\n }\n if (status)\n this.#statusTTL(status, index);\n return v;\n }\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context);\n const hasStale = p.__staleWhileFetching !== undefined;\n const staleVal = hasStale && allowStale;\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh';\n if (staleVal && isStale)\n status.returnedStale = true;\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p);\n }\n }\n async forceFetch(k, fetchOptions = {}) {\n const v = await this.fetch(k, fetchOptions);\n if (v === undefined)\n throw new Error('fetch() returned undefined');\n return v;\n }\n memo(k, memoOptions = {}) {\n const memoMethod = this.#memoMethod;\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor');\n }\n const { context, forceRefresh, ...options } = memoOptions;\n const v = this.get(k, options);\n if (!forceRefresh && v !== undefined)\n return v;\n const vv = memoMethod(k, v, {\n options,\n context,\n });\n this.set(k, vv, options);\n return vv;\n }\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k, getOptions = {}) {\n const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions;\n const index = this.#keyMap.get(k);\n if (index !== undefined) {\n const value = this.#valList[index];\n const fetching = this.#isBackgroundFetch(value);\n if (status)\n this.#statusTTL(status, index);\n if (this.#isStale(index)) {\n if (status)\n status.get = 'stale';\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire');\n }\n if (status && allowStale)\n status.returnedStale = true;\n return allowStale ? value : undefined;\n }\n else {\n if (status &&\n allowStale &&\n value.__staleWhileFetching !== undefined) {\n status.returnedStale = true;\n }\n return allowStale ? value.__staleWhileFetching : undefined;\n }\n }\n else {\n if (status)\n status.get = 'hit';\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n if (fetching) {\n return value.__staleWhileFetching;\n }\n this.#moveToTail(index);\n if (updateAgeOnGet) {\n this.#updateItemAge(index);\n }\n return value;\n }\n }\n else if (status) {\n status.get = 'miss';\n }\n }\n #connect(p, n) {\n this.#prev[n] = p;\n this.#next[p] = n;\n }\n #moveToTail(index) {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index];\n }\n else {\n this.#connect(this.#prev[index], this.#next[index]);\n }\n this.#connect(this.#tail, index);\n this.#tail = index;\n }\n }\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k) {\n return this.#delete(k, 'delete');\n }\n #delete(k, reason) {\n let deleted = false;\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k);\n if (index !== undefined) {\n deleted = true;\n if (this.#size === 1) {\n this.#clear(reason);\n }\n else {\n this.#removeItemSize(index);\n const v = this.#valList[index];\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'));\n }\n else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v, k, reason);\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v, k, reason]);\n }\n }\n this.#keyMap.delete(k);\n this.#keyList[index] = undefined;\n this.#valList[index] = undefined;\n if (index === this.#tail) {\n this.#tail = this.#prev[index];\n }\n else if (index === this.#head) {\n this.#head = this.#next[index];\n }\n else {\n const pi = this.#prev[index];\n this.#next[pi] = this.#next[index];\n const ni = this.#next[index];\n this.#prev[ni] = this.#prev[index];\n }\n this.#size--;\n this.#free.push(index);\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed;\n let task;\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task);\n }\n }\n return deleted;\n }\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete');\n }\n #clear(reason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index];\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'));\n }\n else {\n const k = this.#keyList[index];\n if (this.#hasDispose) {\n this.#dispose?.(v, k, reason);\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v, k, reason]);\n }\n }\n }\n this.#keyMap.clear();\n this.#valList.fill(undefined);\n this.#keyList.fill(undefined);\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0);\n this.#starts.fill(0);\n }\n if (this.#sizes) {\n this.#sizes.fill(0);\n }\n this.#head = 0;\n this.#tail = 0;\n this.#free.length = 0;\n this.#calculatedSize = 0;\n this.#size = 0;\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed;\n let task;\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task);\n }\n }\n }\n}\n//# sourceMappingURL=index.js.map","import { JsonRpcProvider, Network, hexlify } from 'ethers'\nimport type { JsonRpcError, JsonRpcPayload, JsonRpcResult } from 'ethers'\n\nimport PQueue from 'p-queue'\nimport { EthChainId } from '@sentio/chain'\nimport { LRUCache } from 'lru-cache'\nimport { Endpoints, providerMetrics, processMetrics, metricsStorage, GLOBAL_CONFIG } from '@sentio/runtime'\nconst { miss_count, hit_count, queue_size } = providerMetrics\n\nexport const DummyProvider = new JsonRpcProvider('', Network.from(1))\n\nconst providers = new Map<string, JsonRpcProvider>()\n\n// export function getEthChainId(networkish?: EthContext | EthChainId): EthChainId {\n// if (!networkish) {\n// networkish = EthChainId.ETHEREUM\n// }\n// if (networkish instanceof BaseContext) {\n// networkish = networkish.getChainId()\n// }\n// return networkish\n// }\n\nexport function getProvider(chainId?: EthChainId): JsonRpcProvider {\n // const network = getNetworkFromCtxOrNetworkish(networkish)\n if (!chainId) {\n chainId = EthChainId.ETHEREUM\n }\n const network = Network.from(parseInt(chainId))\n // TODO check if other key needed\n\n const address = Endpoints.INSTANCE.getChainRpcUrl(chainId)\n const key = network.chainId.toString() + '-' + address\n\n // console.debug(`init provider for ${chainId}, address: ${address}`)\n let provider = providers.get(key)\n\n if (provider) {\n return provider\n }\n\n if (address === undefined) {\n throw Error(\n 'Provider not found for chain ' +\n network.chainId +\n ', configured chains: ' +\n [...Endpoints.INSTANCE.chainRpc.keys()].join(' ')\n )\n }\n // console.log(\n // `init provider for chain ${network.chainId}, concurrency: ${Endpoints.INSTANCE.concurrency}, batchCount: ${Endpoints.INSTANCE.batchCount}`\n // )\n provider = new QueuedStaticJsonRpcProvider(\n address,\n network,\n Endpoints.INSTANCE.concurrency,\n Endpoints.INSTANCE.batchCount\n )\n providers.set(key, provider)\n return provider\n}\n\nfunction getTag(prefix: string, value: any): string {\n return (\n prefix +\n ':' +\n JSON.stringify(value, (k, v) => {\n if (v == null) {\n return 'null'\n }\n if (typeof v === 'bigint') {\n return `bigint:${v.toString()}`\n }\n if (typeof v === 'string') {\n return v.toLowerCase()\n }\n\n // Sort object keys\n if (typeof v === 'object' && !Array.isArray(v)) {\n const keys = Object.keys(v)\n keys.sort()\n return keys.reduce(\n (accum, key) => {\n accum[key] = v[key]\n return accum\n },\n <any>{}\n )\n }\n\n return v\n })\n )\n}\n\nexport class QueuedStaticJsonRpcProvider extends JsonRpcProvider {\n executor: PQueue\n #performCache = new LRUCache<string, Promise<any>>({\n max: 300000, // 300k items\n maxSize: 500 * 1024 * 1024 // 500mb key size for cache\n // ttl: 1000 * 60 * 60, // 1 hour no ttl for better performance\n // sizeCalculation: (value: any) => {\n // assume each item is 1kb for simplicity\n // return 1024\n // }\n })\n #retryCache = new LRUCache<string, number>({\n max: 300000 // 300k items\n })\n\n constructor(url: string, network: Network, concurrency: number, batchCount = 1) {\n // TODO re-enable match when possible\n super(url, network, { staticNetwork: network, batchMaxCount: batchCount })\n this.executor = new PQueue({ concurrency: concurrency })\n }\n\n async send(method: string, params: Array<any>): Promise<any> {\n if (method !== 'eth_call' || params.length > 2) {\n return await this.executor.add(() => super.send(method, params))\n }\n const tag = getTag(method, params)\n const block = params[params.length - 1]\n let perform = this.#performCache.get(tag)\n if (!perform) {\n miss_count.add(1)\n const handler = metricsStorage.getStore()\n const queued: number = Date.now()\n perform = this.executor.add(() => {\n const started = Date.now()\n processMetrics.processor_rpc_queue_duration.record(started - queued, {\n chain_id: this._network.chainId.toString(),\n handler\n })\n\n let success = true\n return super\n .send(method, params)\n .catch((e) => {\n success = false\n throw e\n })\n .finally(() => {\n processMetrics.processor_rpc_duration.record(Date.now() - started, {\n chain_id: this._network.chainId.toString(),\n handler,\n success\n })\n })\n })\n\n queue_size.record(this.executor.size)\n\n this.#performCache.set(tag, perform, {\n size: tag.length\n })\n // For non latest block call, we cache permanently, otherwise we cache for one minute\n if (block === 'latest') {\n setTimeout(() => {\n if (this.#performCache.get(tag) === perform) {\n this.#performCache.delete(tag)\n }\n }, 60 * 1000)\n }\n } else {\n hit_count.add(1)\n }\n\n let result\n try {\n result = await perform\n } catch (e: any) {\n this.#performCache.delete(tag)\n if (e.code === 'TIMEOUT') {\n let retryCount = this.#retryCache.get(tag)\n if (GLOBAL_CONFIG.execution.rpcRetryTimes && retryCount === undefined) {\n retryCount = GLOBAL_CONFIG.execution.rpcRetryTimes\n }\n if (retryCount) {\n this.#retryCache.set(tag, retryCount - 1)\n return this.send(method, params)\n }\n }\n throw e\n }\n if (!result) {\n throw Error('Unexpected null response')\n }\n return result\n }\n\n // Overrides the low-level JSON-RPC transport to replicate behaviors that used to\n // live in the @sentio/ethers fork, so the SDK can run on upstream ethers:\n // 1. Treat an empty `0x` eth_call result as an RPC error — the Sentio rpc-node\n // answers 200/`0x` (instead of a JSON-RPC error) with `sentio-*` headers when\n // a call cannot be served, and we want that to throw rather than silently\n // return empty data.\n // 2. Forward `sentio-*` response headers onto error results so they surface in\n // getRpcError().info for diagnostics.\n // 3. Attach the request payload to TIMEOUT errors (previously the fork's\n // geturl.ts patch) for diagnostics.\n override async _send(payload: JsonRpcPayload | Array<JsonRpcPayload>): Promise<Array<JsonRpcResult>> {\n const request = this._getConnection()\n request.body = JSON.stringify(payload)\n request.setHeader('content-type', 'application/json')\n\n let response\n try {\n response = await request.send()\n } catch (e: any) {\n if (e?.code === 'TIMEOUT') {\n e.payload = payload\n }\n throw e\n }\n response.assertOk()\n\n let resp = response.bodyJson\n if (!Array.isArray(resp)) {\n resp = [resp]\n }\n\n const sentioHeaders: Record<string, string> = {}\n for (const [key, value] of Object.entries(response.headers)) {\n if (key.toLowerCase().includes('sentio')) {\n sentioHeaders[key] = value as string\n }\n }\n const hasSentioHeaders = Object.keys(sentioHeaders).length > 0\n\n const methodById = new Map<number, string>()\n for (const p of Array.isArray(payload) ? payload : [payload]) {\n methodById.set(p.id, p.method)\n }\n\n for (const res of resp as any[]) {\n let isError = 'error' in res\n if (!isError && methodById.get(res.id) === 'eth_call') {\n try {\n if (hexlify(res.result) === '0x') {\n res.error = { code: 3, message: 'empty response (0x) from eth_call' }\n isError = true\n }\n } catch {\n // result is not hex-like; leave it as a normal result\n }\n }\n if (isError && hasSentioHeaders) {\n res.headers = sentioHeaders\n }\n }\n\n return resp\n }\n\n override getRpcError(payload: JsonRpcPayload, error: JsonRpcError): Error {\n const e = super.getRpcError(payload, error)\n const headers = (error as any)?.headers\n if (headers) {\n ;(e as any).info = { ...((e as any).info ?? {}), headers }\n }\n // Annotate eth_call errors with the queried block tag (previously the fork's\n // contract.ts blockNumber patch).\n if (payload?.method === 'eth_call' && Array.isArray((payload as any).params)) {\n const blockTag = (payload as any).params[1]\n if (blockTag != null) {\n ;(e as any).blockNumber = blockTag\n }\n }\n return e\n }\n\n toString() {\n return 'QueuedStaticJsonRpcProvider'\n }\n}\n","import { EthChainId } from '@sentio/chain'\n\nexport class BindOptions {\n // Contract address\n address: string\n // Optional, if not set, then use eth mainnet\n network?: EthChainId = EthChainId.ETHEREUM\n // Optional, override default contract name\n name?: string\n start?: TimeOrBlock\n end?: TimeOrBlock\n startBlock?: bigint | number\n endBlock?: bigint | number\n baseLabels?: { [key: string]: string }\n}\n\nexport interface TimeOrBlock {\n block?: bigint | number\n time?: Date\n}\n\nexport function getOptionsSignature(opts: BindOptions): string {\n const sig = [opts.address]\n if (opts.network) {\n sig.push(opts.network)\n }\n if (opts.name) {\n sig.push(opts.name)\n }\n if (opts.startBlock) {\n sig.push(opts.startBlock.toString())\n }\n if (opts.endBlock) {\n sig.push(opts.endBlock.toString())\n }\n if (opts.baseLabels && Object.keys(opts.baseLabels).length > 0) {\n sig.push(JSON.stringify(Object.fromEntries(Object.entries(opts.baseLabels).sort())))\n }\n return sig.join('_')\n}\n\nexport class AccountBindOptions {\n address: string\n network: EthChainId\n startBlock?: bigint | number\n baseLabels?: { [key: string]: string }\n}\n","import { BindOptions, getOptionsSignature } from './bind-options.js'\nimport { ContractView } from './context.js'\nimport { BaseProcessor } from './base-processor.js'\n\nimport { BaseContract } from 'ethers'\nimport { MapStateStorage } from '@sentio/runtime'\nimport { EthChainId } from '@sentio/chain'\n\nexport class EthProcessorState extends MapStateStorage<BaseProcessor<any, any>> {\n static INSTANCE = new EthProcessorState()\n}\n\n// from abiName_address_chainId => contract wrapper\nconst contracts = new Map<string, ContractView<BaseContract>>()\n\nfunction getKey(abiName: string, address: string, network: EthChainId) {\n return [abiName, address.toLowerCase(), network].join('_')\n}\n\n// Dedup processor that bind multiple times\nexport function getProcessor(opts: BindOptions) {\n const sig = getOptionsSignature(opts)\n return EthProcessorState.INSTANCE.getValue(sig)\n}\n\nexport function addProcessor(opts: BindOptions, processor: BaseProcessor<any, any>) {\n const sig = getOptionsSignature(opts)\n\n EthProcessorState.INSTANCE.getOrSetValue(sig, processor)\n}\n\nexport function getContractByABI(abiName: string, address: string, network: EthChainId) {\n const key = getKey(abiName, address, network)\n return contracts.get(key)\n}\n\nexport function addContractByABI(\n abiName: string,\n address: string,\n network: EthChainId,\n contract: ContractView<BaseContract>\n) {\n const key = getKey(abiName, address, network)\n return contracts.set(key, contract)\n}\n","import { BaseContract } from 'ethers'\nimport { BoundContractView, ContractView } from './context.js'\nimport { BindOptions } from './bind-options.js'\nimport { BaseProcessor } from './base-processor.js'\nimport { getProvider } from './provider.js'\nimport { addProcessor } from './binds.js'\n\nexport class GenericProcessor extends BaseProcessor<\n BaseContract,\n BoundContractView<BaseContract, ContractView<BaseContract>>\n> {\n eventABI: string[]\n constructor(eventABI: string[], options: BindOptions) {\n super(options)\n this.eventABI = eventABI\n }\n\n protected CreateBoundContractView(): BoundContractView<BaseContract, ContractView<BaseContract>> {\n const contract = new BaseContract(this.config.address, this.eventABI, getProvider(this.config.network))\n return new BoundContractView(this.config.address, new ContractView<BaseContract>(contract))\n }\n\n public static bind(eventABI: string[] | string, options: BindOptions): GenericProcessor {\n if (!Array.isArray(eventABI)) {\n eventABI = [eventABI]\n }\n if (!options.name) {\n options.name = 'Generic'\n }\n const processor = new GenericProcessor(eventABI, options)\n addProcessor(options, processor)\n return processor\n }\n}\n","import { BoundContractView, ContractContext, ContractView, EthContext } from './context.js'\nimport { BaseContract } from 'ethers'\nimport { BaseProcessor, defaultPreprocessHandler } from './base-processor.js'\nimport { BindOptions, getOptionsSignature } from './bind-options.js'\nimport {\n type EthFetchConfig,\n EthFetchConfigSchema,\n type HandleInterval,\n HandleIntervalSchema,\n type TemplateInstance,\n TemplateInstanceSchema,\n type PreprocessResult\n} from '@sentio/protos'\nimport { create } from '@bufbuild/protobuf'\nimport { PromiseOrVoid } from '../core/promises.js'\nimport { ListStateStorage, processMetrics } from '@sentio/runtime'\nimport { BlockParams } from 'ethers/providers'\nimport { DeferredTopicFilter } from 'ethers/contract'\nimport { TypedEvent, TypedCallTrace, validateAndNormalizeAddress } from './eth.js'\nimport { getHandlerName, proxyProcessor } from '../utils/metrics.js'\n\nexport class ProcessorTemplateProcessorState extends ListStateStorage<\n BaseProcessorTemplate<BaseContract, BoundContractView<BaseContract, any>>\n> {\n static INSTANCE = new ProcessorTemplateProcessorState()\n}\n\nexport abstract class BaseProcessorTemplate<\n TContract extends BaseContract,\n TBoundContractView extends BoundContractView<TContract, ContractView<TContract>>,\n TProcessor extends BaseProcessor<TContract, TBoundContractView> = BaseProcessor<TContract, TBoundContractView>\n> {\n id: number\n blockHandlers: {\n handlerName: string\n handler: (block: BlockParams, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid\n preprocessHandler: (\n block: BlockParams,\n ctx: ContractContext<TContract, TBoundContractView>,\n preprocessStore: { [k: string]: any }\n ) => Promise<PreprocessResult>\n blockInterval?: HandleInterval\n timeIntervalInMinutes?: HandleInterval\n fetchConfig?: EthFetchConfig\n }[] = []\n traceHandlers: {\n signature: string\n handlerName: string\n handler: (trace: TypedCallTrace, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid\n preprocessHandler: (\n trace: TypedCallTrace,\n ctx: ContractContext<TContract, TBoundContractView>,\n preprocessStore: { [k: string]: any }\n ) => Promise<PreprocessResult>\n fetchConfig?: EthFetchConfig\n }[] = []\n eventHandlers: {\n handlerName: string\n handler: (event: TypedEvent, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid\n preprocessHandler: (\n event: TypedEvent,\n ctx: ContractContext<TContract, TBoundContractView>,\n preprocessStore: { [k: string]: any }\n ) => Promise<PreprocessResult>\n filter: DeferredTopicFilter | DeferredTopicFilter[]\n fetchConfig?: EthFetchConfig\n }[] = []\n\n instances = new Set<string>()\n private handlerFactory?: (instance: TProcessor, baseLabels: { [key: string]: string } | undefined) => void\n\n constructor() {\n this.id = ProcessorTemplateProcessorState.INSTANCE.getValues().length\n // Stored type-erased as the base instantiation; the concrete type parameters only appear in\n // handler parameter positions, which `strictFunctionTypes` checks contravariantly.\n ProcessorTemplateProcessorState.INSTANCE.addValue(\n this as unknown as BaseProcessorTemplate<BaseContract, BoundContractView<BaseContract, any>>\n )\n return proxyProcessor(this)\n }\n\n /**\n * Bind template using {@param options}, using {@param ctx}'s network value if not provided in the option\n * @param options\n * @param ctx\n */\n public bind(options: Omit<BindOptions, 'network'>, ctx: EthContext): void {\n options = { ...options, address: validateAndNormalizeAddress(options.address) }\n\n const instance: TemplateInstance = create(TemplateInstanceSchema, {\n templateId: this.id,\n contract: {\n address: options.address,\n name: options.name || '',\n chainId: ctx.chainId,\n abi: ''\n },\n startBlock: BigInt(options.startBlock || 0),\n endBlock: BigInt(options.endBlock || 0),\n baseLabels: options.baseLabels\n })\n\n ctx.sendTemplateInstance(instance)\n\n ctx.update({\n states: {\n configUpdated: true\n }\n })\n\n processMetrics.processor_template_instance_count.add(1, { chain_id: ctx.chainId, template: this.constructor.name })\n }\n\n public startInstance(options: Omit<BindOptions, 'network'>, ctx: EthContext) {\n options = { ...options, address: validateAndNormalizeAddress(options.address) }\n const sig = getOptionsSignature({\n address: options.address,\n network: ctx.chainId,\n baseLabels: options.baseLabels\n })\n\n if (this.instances.has(sig)) {\n console.debug(`Same address can be bind to one template only once, ignore duplicate bind: ${sig}`)\n return\n }\n\n const processor = this.bindInternal({ ...options, network: ctx.chainId })\n this.handlerFactory?.(processor, options.baseLabels)\n for (const eh of this.eventHandlers) {\n // @ts-ignore friendly\n processor.onEthEvent(eh.handler, eh.filter, eh.fetchConfig, eh.preprocessHandler, eh.handlerName)\n }\n for (const th of this.traceHandlers) {\n // @ts-ignore friendly\n processor.onEthTrace(th.signature, th.handler, th.fetchConfig, th.preprocessHandler, th.handlerName)\n }\n for (const bh of this.blockHandlers) {\n processor.onInterval(\n bh.handler,\n bh.timeIntervalInMinutes,\n bh.blockInterval,\n bh.fetchConfig,\n bh.preprocessHandler,\n bh.handlerName\n )\n }\n this.instances.add(sig)\n }\n\n protected onEthEvent(\n handler: (event: TypedEvent, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,\n filter: DeferredTopicFilter | DeferredTopicFilter[],\n fetchConfig?: Omit<Partial<EthFetchConfig>, '$typeName' | '$unknown'>,\n preprocessHandler: (\n event: TypedEvent,\n ctx: ContractContext<TContract, TBoundContractView>,\n preprocessStore: { [k: string]: any }\n ) => Promise<PreprocessResult> = defaultPreprocessHandler\n ) {\n this.eventHandlers.push({\n handlerName: getHandlerName(),\n handler: handler,\n preprocessHandler,\n filter: filter,\n fetchConfig: create(EthFetchConfigSchema, fetchConfig || {})\n })\n return this\n }\n\n public onBlockInterval(\n handler: (block: BlockParams, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,\n blockInterval = 1000,\n backfillBlockInterval = 4000,\n fetchConfig?: EthFetchConfig,\n preprocessHandler: (\n block: BlockParams,\n ctx: ContractContext<TContract, TBoundContractView>,\n preprocessStore: { [k: string]: any }\n ) => Promise<PreprocessResult> = defaultPreprocessHandler\n ) {\n return this.onInterval(\n handler,\n undefined,\n create(HandleIntervalSchema, {\n recentInterval: blockInterval,\n backfillInterval: backfillBlockInterval\n }),\n fetchConfig,\n preprocessHandler\n )\n }\n\n public onTimeInterval(\n handler: (block: BlockParams, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,\n timeIntervalInMinutes = 60,\n backfillTimeIntervalInMinutes = 240,\n fetchConfig?: EthFetchConfig,\n preprocessHandler: (\n block: BlockParams,\n ctx: ContractContext<TContract, TBoundContractView>,\n preprocessStore: { [k: string]: any }\n ) => Promise<PreprocessResult> = defaultPreprocessHandler\n ) {\n return this.onInterval(\n handler,\n create(HandleIntervalSchema, {\n recentInterval: timeIntervalInMinutes,\n backfillInterval: backfillTimeIntervalInMinutes\n }),\n undefined,\n fetchConfig,\n preprocessHandler\n )\n }\n\n public onInterval(\n handler: (block: BlockParams, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,\n timeInterval: HandleInterval | undefined,\n blockInterval: HandleInterval | undefined,\n fetchConfig: EthFetchConfig | undefined,\n preprocessHandler: (\n block: BlockParams,\n ctx: ContractContext<TContract, TBoundContractView>,\n preprocessStore: { [k: string]: any }\n ) => Promise<PreprocessResult> = defaultPreprocessHandler\n ) {\n this.blockHandlers.push({\n handlerName: getHandlerName(),\n handler,\n preprocessHandler,\n timeIntervalInMinutes: timeInterval,\n blockInterval,\n fetchConfig\n })\n return this\n }\n\n public onTrace(\n signature: string,\n handler: (trace: TypedCallTrace, ctx: ContractContext<TContract, TBoundContractView>) => PromiseOrVoid,\n fetchConfig?: Omit<Partial<EthFetchConfig>, '$typeName' | '$unknown'>,\n preprocessHandler: (\n trace: TypedCallTrace,\n ctx: ContractContext<TContract, TBoundContractView>,\n preprocessStore: { [k: string]: any }\n ) => Promise<PreprocessResult> = defaultPreprocessHandler\n ) {\n this.traceHandlers.push({\n signature,\n handlerName: getHandlerName(),\n handler,\n preprocessHandler,\n fetchConfig: create(EthFetchConfigSchema, fetchConfig || {})\n })\n return this\n }\n\n protected abstract bindInternal(options: BindOptions): TProcessor\n\n public configureHandlerFactory(\n factory: (instance: TProcessor, baseLabels: { [key: string]: string } | undefined) => void\n ) {\n this.handlerFactory = factory\n }\n}\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\nimport { newContract, newInterface } from \"@sentio/sdk/eth\";\n\nimport { Contract, Signer, Provider, Interface } from \"ethers\";\nimport type {\n EACAggregatorProxy,\n EACAggregatorProxyInterface,\n} from \"../EACAggregatorProxy.js\";\n\nconst _abi = [\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"_aggregator\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"_accessController\",\n type: \"address\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"constructor\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"int256\",\n name: \"current\",\n type: \"int256\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"roundId\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"updatedAt\",\n type: \"uint256\",\n },\n ],\n name: \"AnswerUpdated\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"roundId\",\n type: \"uint256\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"startedBy\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"startedAt\",\n type: \"uint256\",\n },\n ],\n name: \"NewRound\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n ],\n name: \"OwnershipTransferRequested\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n ],\n name: \"OwnershipTransferred\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"acceptOwnership\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"accessController\",\n outputs: [\n {\n internalType: \"contract AccessControllerInterface\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"aggregator\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"_aggregator\",\n type: \"address\",\n },\n ],\n name: \"confirmAggregator\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"decimals\",\n outputs: [\n {\n internalType: \"uint8\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"description\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"_roundId\",\n type: \"uint256\",\n },\n ],\n name: \"getAnswer\",\n outputs: [\n {\n internalType: \"int256\",\n name: \"\",\n type: \"int256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint80\",\n name: \"_roundId\",\n type: \"uint80\",\n },\n ],\n name: \"getRoundData\",\n outputs: [\n {\n internalType: \"uint80\",\n name: \"roundId\",\n type: \"uint80\",\n },\n {\n internalType: \"int256\",\n name: \"answer\",\n type: \"int256\",\n },\n {\n internalType: \"uint256\",\n name: \"startedAt\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"updatedAt\",\n type: \"uint256\",\n },\n {\n internalType: \"uint80\",\n name: \"answeredInRound\",\n type: \"uint80\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"_roundId\",\n type: \"uint256\",\n },\n ],\n name: \"getTimestamp\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"latestAnswer\",\n outputs: [\n {\n internalType: \"int256\",\n name: \"\",\n type: \"int256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"latestRound\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"latestRoundData\",\n outputs: [\n {\n internalType: \"uint80\",\n name: \"roundId\",\n type: \"uint80\",\n },\n {\n internalType: \"int256\",\n name: \"answer\",\n type: \"int256\",\n },\n {\n internalType: \"uint256\",\n name: \"startedAt\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"updatedAt\",\n type: \"uint256\",\n },\n {\n internalType: \"uint80\",\n name: \"answeredInRound\",\n type: \"uint80\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"latestTimestamp\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"owner\",\n outputs: [\n {\n internalType: \"address payable\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n name: \"phaseAggregators\",\n outputs: [\n {\n internalType: \"contract AggregatorV2V3Interface\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"phaseId\",\n outputs: [\n {\n internalType: \"uint16\",\n name: \"\",\n type: \"uint16\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"_aggregator\",\n type: \"address\",\n },\n ],\n name: \"proposeAggregator\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"proposedAggregator\",\n outputs: [\n {\n internalType: \"contract AggregatorV2V3Interface\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint80\",\n name: \"_roundId\",\n type: \"uint80\",\n },\n ],\n name: \"proposedGetRoundData\",\n outputs: [\n {\n internalType: \"uint80\",\n name: \"roundId\",\n type: \"uint80\",\n },\n {\n internalType: \"int256\",\n name: \"answer\",\n type: \"int256\",\n },\n {\n internalType: \"uint256\",\n name: \"startedAt\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"updatedAt\",\n type: \"uint256\",\n },\n {\n internalType: \"uint80\",\n name: \"answeredInRound\",\n type: \"uint80\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"proposedLatestRoundData\",\n outputs: [\n {\n internalType: \"uint80\",\n name: \"roundId\",\n type: \"uint80\",\n },\n {\n internalType: \"int256\",\n name: \"answer\",\n type: \"int256\",\n },\n {\n internalType: \"uint256\",\n name: \"startedAt\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"updatedAt\",\n type: \"uint256\",\n },\n {\n internalType: \"uint80\",\n name: \"answeredInRound\",\n type: \"uint80\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"_accessController\",\n type: \"address\",\n },\n ],\n name: \"setController\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"_to\",\n type: \"address\",\n },\n ],\n name: \"transferOwnership\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"version\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n] as const;\n\nexport class EACAggregatorProxy__factory {\n static readonly abi = _abi;\n static createInterface(): EACAggregatorProxyInterface {\n return newInterface(_abi) as EACAggregatorProxyInterface;\n }\n static connect(\n address: string,\n signerOrProvider: Signer | Provider,\n ): EACAggregatorProxy {\n return newContract(address, _abi, signerOrProvider) as EACAggregatorProxy;\n }\n}\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\nimport { newContract, newInterface } from \"@sentio/sdk/eth\";\n\nimport { Contract, Signer, Provider, Interface } from \"ethers\";\nimport type { ERC1155, ERC1155Interface } from \"../ERC1155.js\";\n\nconst _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"ApprovalForAll\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256[]\",\n name: \"ids\",\n type: \"uint256[]\",\n },\n {\n indexed: false,\n internalType: \"uint256[]\",\n name: \"values\",\n type: \"uint256[]\",\n },\n ],\n name: \"TransferBatch\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"TransferSingle\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"string\",\n name: \"value\",\n type: \"string\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n ],\n name: \"URI\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address[]\",\n name: \"accounts\",\n type: \"address[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"ids\",\n type: \"uint256[]\",\n },\n ],\n name: \"balanceOfBatch\",\n outputs: [\n {\n internalType: \"uint256[]\",\n name: \"\",\n type: \"uint256[]\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n name: \"isApprovedForAll\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256[]\",\n name: \"ids\",\n type: \"uint256[]\",\n },\n {\n internalType: \"uint256[]\",\n name: \"amounts\",\n type: \"uint256[]\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"safeBatchTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"setApprovalForAll\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"id\",\n type: \"uint256\",\n },\n ],\n name: \"uri\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n] as const;\n\nexport class ERC1155__factory {\n static readonly abi = _abi;\n static createInterface(): ERC1155Interface {\n return newInterface(_abi) as ERC1155Interface;\n }\n static connect(\n address: string,\n signerOrProvider: Signer | Provider,\n ): ERC1155 {\n return newContract(address, _abi, signerOrProvider) as ERC1155;\n }\n}\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\nimport { newContract, newInterface } from \"@sentio/sdk/eth\";\n\nimport { Contract, Signer, Provider, Interface } from \"ethers\";\nimport type { ERC20, ERC20Interface } from \"../ERC20.js\";\n\nconst _abi = [\n {\n inputs: [],\n stateMutability: \"nonpayable\",\n type: \"constructor\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"previousOwner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"newOwner\",\n type: \"address\",\n },\n ],\n name: \"OwnershipTransferred\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n ],\n name: \"allowance\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"burn\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"account\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"burnFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"decimals\",\n outputs: [\n {\n internalType: \"uint8\",\n name: \"\",\n type: \"uint8\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"subtractedValue\",\n type: \"uint256\",\n },\n ],\n name: \"decreaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"addedValue\",\n type: \"uint256\",\n },\n ],\n name: \"increaseAllowance\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"locker\",\n outputs: [\n {\n internalType: \"contract ILocker\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"owner\",\n outputs: [\n {\n internalType: \"address\",\n name: \"\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"renounceOwnership\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"_locker\",\n type: \"address\",\n },\n ],\n name: \"setLocker\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transfer\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"sender\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"recipient\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"amount\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"newOwner\",\n type: \"address\",\n },\n ],\n name: \"transferOwnership\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n] as const;\n\nexport class ERC20__factory {\n static readonly abi = _abi;\n static createInterface(): ERC20Interface {\n return newInterface(_abi) as ERC20Interface;\n }\n static connect(address: string, signerOrProvider: Signer | Provider): ERC20 {\n return newContract(address, _abi, signerOrProvider) as ERC20;\n }\n}\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\nimport { newContract, newInterface } from \"@sentio/sdk/eth\";\n\nimport { Contract, Signer, Provider, Interface } from \"ethers\";\nimport type { ERC20Bytes, ERC20BytesInterface } from \"../ERC20Bytes.js\";\n\nconst _abi = [\n {\n constant: true,\n inputs: [],\n name: \"name\",\n outputs: [\n {\n name: \"\",\n type: \"bytes32\",\n },\n ],\n payable: false,\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n constant: false,\n inputs: [\n {\n name: \"spender\",\n type: \"address\",\n },\n {\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [\n {\n name: \"\",\n type: \"bool\",\n },\n ],\n payable: false,\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n constant: true,\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n name: \"\",\n type: \"uint256\",\n },\n ],\n payable: false,\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n constant: false,\n inputs: [\n {\n name: \"from\",\n type: \"address\",\n },\n {\n name: \"to\",\n type: \"address\",\n },\n {\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [\n {\n name: \"\",\n type: \"bool\",\n },\n ],\n payable: false,\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n constant: true,\n inputs: [],\n name: \"decimals\",\n outputs: [\n {\n name: \"\",\n type: \"uint8\",\n },\n ],\n payable: false,\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n constant: true,\n inputs: [\n {\n name: \"who\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n name: \"\",\n type: \"uint256\",\n },\n ],\n payable: false,\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n constant: true,\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n name: \"\",\n type: \"bytes32\",\n },\n ],\n payable: false,\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n constant: false,\n inputs: [\n {\n name: \"to\",\n type: \"address\",\n },\n {\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"transfer\",\n outputs: [\n {\n name: \"\",\n type: \"bool\",\n },\n ],\n payable: false,\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n constant: true,\n inputs: [\n {\n name: \"owner\",\n type: \"address\",\n },\n {\n name: \"spender\",\n type: \"address\",\n },\n ],\n name: \"allowance\",\n outputs: [\n {\n name: \"\",\n type: \"uint256\",\n },\n ],\n payable: false,\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n name: \"_name\",\n type: \"string\",\n },\n {\n name: \"_symbol\",\n type: \"string\",\n },\n {\n name: \"_decimals\",\n type: \"uint8\",\n },\n ],\n payable: false,\n stateMutability: \"nonpayable\",\n type: \"constructor\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n name: \"spender\",\n type: \"address\",\n },\n {\n indexed: false,\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: false,\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n] as const;\n\nexport class ERC20Bytes__factory {\n static readonly abi = _abi;\n static createInterface(): ERC20BytesInterface {\n return newInterface(_abi) as ERC20BytesInterface;\n }\n static connect(\n address: string,\n signerOrProvider: Signer | Provider,\n ): ERC20Bytes {\n return newContract(address, _abi, signerOrProvider) as ERC20Bytes;\n }\n}\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\nimport { newContract, newInterface } from \"@sentio/sdk/eth\";\n\nimport { Contract, Signer, Provider, Interface } from \"ethers\";\nimport type { ERC721, ERC721Interface } from \"../ERC721.js\";\n\nconst _abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"approved\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"bool\",\n name: \"approved\",\n type: \"bool\",\n },\n ],\n name: \"ApprovalForAll\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n constant: true,\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n name: \"\",\n type: \"uint256\",\n },\n ],\n payable: false,\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"balance\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"getApproved\",\n outputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n ],\n name: \"isApprovedForAll\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"ownerOf\",\n outputs: [\n {\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"safeTransferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"operator\",\n type: \"address\",\n },\n {\n internalType: \"bool\",\n name: \"_approved\",\n type: \"bool\",\n },\n ],\n name: \"setApprovalForAll\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"interfaceId\",\n type: \"bytes4\",\n },\n ],\n name: \"supportsInterface\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"tokenURI\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"from\",\n type: \"address\",\n },\n {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n] as const;\n\nexport class ERC721__factory {\n static readonly abi = _abi;\n static createInterface(): ERC721Interface {\n return newInterface(_abi) as ERC721Interface;\n }\n static connect(address: string, signerOrProvider: Signer | Provider): ERC721 {\n return newContract(address, _abi, signerOrProvider) as ERC721;\n }\n}\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\nimport { newContract, newInterface } from \"@sentio/sdk/eth\";\n\nimport { Contract, Signer, Provider, Interface } from \"ethers\";\nimport type { WETH9, WETH9Interface } from \"../WETH9.js\";\n\nconst _abi = [\n {\n constant: true,\n inputs: [],\n name: \"name\",\n outputs: [\n {\n name: \"\",\n type: \"string\",\n },\n ],\n payable: false,\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n constant: false,\n inputs: [\n {\n name: \"guy\",\n type: \"address\",\n },\n {\n name: \"wad\",\n type: \"uint256\",\n },\n ],\n name: \"approve\",\n outputs: [\n {\n name: \"\",\n type: \"bool\",\n },\n ],\n payable: false,\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n constant: true,\n inputs: [],\n name: \"totalSupply\",\n outputs: [\n {\n name: \"\",\n type: \"uint256\",\n },\n ],\n payable: false,\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n constant: false,\n inputs: [\n {\n name: \"src\",\n type: \"address\",\n },\n {\n name: \"dst\",\n type: \"address\",\n },\n {\n name: \"wad\",\n type: \"uint256\",\n },\n ],\n name: \"transferFrom\",\n outputs: [\n {\n name: \"\",\n type: \"bool\",\n },\n ],\n payable: false,\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n constant: false,\n inputs: [\n {\n name: \"wad\",\n type: \"uint256\",\n },\n ],\n name: \"withdraw\",\n outputs: [],\n payable: false,\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n constant: true,\n inputs: [],\n name: \"decimals\",\n outputs: [\n {\n name: \"\",\n type: \"uint8\",\n },\n ],\n payable: false,\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n constant: true,\n inputs: [\n {\n name: \"\",\n type: \"address\",\n },\n ],\n name: \"balanceOf\",\n outputs: [\n {\n name: \"\",\n type: \"uint256\",\n },\n ],\n payable: false,\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n constant: true,\n inputs: [],\n name: \"symbol\",\n outputs: [\n {\n name: \"\",\n type: \"string\",\n },\n ],\n payable: false,\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n constant: false,\n inputs: [\n {\n name: \"dst\",\n type: \"address\",\n },\n {\n name: \"wad\",\n type: \"uint256\",\n },\n ],\n name: \"transfer\",\n outputs: [\n {\n name: \"\",\n type: \"bool\",\n },\n ],\n payable: false,\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n constant: false,\n inputs: [],\n name: \"deposit\",\n outputs: [],\n payable: true,\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n constant: true,\n inputs: [\n {\n name: \"\",\n type: \"address\",\n },\n {\n name: \"\",\n type: \"address\",\n },\n ],\n name: \"allowance\",\n outputs: [\n {\n name: \"\",\n type: \"uint256\",\n },\n ],\n payable: false,\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n payable: true,\n stateMutability: \"payable\",\n type: \"fallback\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: \"src\",\n type: \"address\",\n },\n {\n indexed: true,\n name: \"guy\",\n type: \"address\",\n },\n {\n indexed: false,\n name: \"wad\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: \"src\",\n type: \"address\",\n },\n {\n indexed: true,\n name: \"dst\",\n type: \"address\",\n },\n {\n indexed: false,\n name: \"wad\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: \"dst\",\n type: \"address\",\n },\n {\n indexed: false,\n name: \"wad\",\n type: \"uint256\",\n },\n ],\n name: \"Deposit\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: \"src\",\n type: \"address\",\n },\n {\n indexed: false,\n name: \"wad\",\n type: \"uint256\",\n },\n ],\n name: \"Withdrawal\",\n type: \"event\",\n },\n] as const;\n\nexport class WETH9__factory {\n static readonly abi = _abi;\n static createInterface(): WETH9Interface {\n return newInterface(_abi) as WETH9Interface;\n }\n static connect(address: string, signerOrProvider: Signer | Provider): WETH9 {\n return newContract(address, _abi, signerOrProvider) as WETH9;\n }\n}\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { BigNumberish, Overrides, BytesLike } from \"ethers\";\nimport { HandlerOptions } from \"@sentio/sdk\";\nimport {\n addContractByABI,\n getContractByABI,\n addProcessor,\n getProcessor,\n getProvider,\n transformEtherError,\n BindOptions,\n BaseProcessor,\n BaseProcessorTemplate,\n BoundContractView,\n ContractContext,\n ContractView,\n DummyProvider,\n EthChainId,\n TypedCallTrace,\n EthContext,\n EthFetchConfig,\n PreprocessResult,\n encodeCallData,\n} from \"@sentio/sdk/eth\";\nimport {\n EthCallParam,\n EthCallContext,\n EthCallContextSchema,\n PreparedData,\n} from \"@sentio/protos\";\nimport { create } from \"@bufbuild/protobuf\";\n\nimport { ERC721__factory } from \"./index.js\";\nimport {\n ERC721,\n ApprovalEvent,\n ApprovalEventFilter,\n ApprovalForAllEvent,\n ApprovalForAllEventFilter,\n TransferEvent,\n TransferEventFilter,\n} from \"./ERC721.js\";\n\nexport interface ApproveCallObject {\n to: string;\n tokenId: bigint;\n}\n\nexport type ApproveCallTrace = TypedCallTrace<\n [string, bigint],\n ApproveCallObject\n>;\n\nexport interface TotalSupplyCallObject {}\n\nexport type TotalSupplyCallTrace = TypedCallTrace<[], TotalSupplyCallObject>;\n\nexport interface BalanceOfCallObject {\n owner: string;\n}\n\nexport type BalanceOfCallTrace = TypedCallTrace<[string], BalanceOfCallObject>;\n\nexport interface GetApprovedCallObject {\n tokenId: bigint;\n}\n\nexport type GetApprovedCallTrace = TypedCallTrace<\n [bigint],\n GetApprovedCallObject\n>;\n\nexport interface IsApprovedForAllCallObject {\n owner: string;\n operator: string;\n}\n\nexport type IsApprovedForAllCallTrace = TypedCallTrace<\n [string, string],\n IsApprovedForAllCallObject\n>;\n\nexport interface NameCallObject {}\n\nexport type NameCallTrace = TypedCallTrace<[], NameCallObject>;\n\nexport interface OwnerOfCallObject {\n tokenId: bigint;\n}\n\nexport type OwnerOfCallTrace = TypedCallTrace<[bigint], OwnerOfCallObject>;\n\nexport interface SafeTransferFrom_address_address_uint256CallObject {\n from: string;\n to: string;\n tokenId: bigint;\n}\n\nexport type SafeTransferFrom_address_address_uint256CallTrace = TypedCallTrace<\n [string, string, bigint],\n SafeTransferFrom_address_address_uint256CallObject\n>;\n\nexport interface SafeTransferFrom_address_address_uint256_bytesCallObject {\n from: string;\n to: string;\n tokenId: bigint;\n data: string;\n}\n\nexport type SafeTransferFrom_address_address_uint256_bytesCallTrace =\n TypedCallTrace<\n [string, string, bigint, string],\n SafeTransferFrom_address_address_uint256_bytesCallObject\n >;\n\nexport interface SetApprovalForAllCallObject {\n operator: string;\n _approved: boolean;\n}\n\nexport type SetApprovalForAllCallTrace = TypedCallTrace<\n [string, boolean],\n SetApprovalForAllCallObject\n>;\n\nexport interface SupportsInterfaceCallObject {\n interfaceId: string;\n}\n\nexport type SupportsInterfaceCallTrace = TypedCallTrace<\n [string],\n SupportsInterfaceCallObject\n>;\n\nexport interface SymbolCallObject {}\n\nexport type SymbolCallTrace = TypedCallTrace<[], SymbolCallObject>;\n\nexport interface TokenURICallObject {\n tokenId: bigint;\n}\n\nexport type TokenURICallTrace = TypedCallTrace<[bigint], TokenURICallObject>;\n\nexport interface TransferFromCallObject {\n from: string;\n to: string;\n tokenId: bigint;\n}\n\nexport type TransferFromCallTrace = TypedCallTrace<\n [string, string, bigint],\n TransferFromCallObject\n>;\n\nconst templateContract = ERC721__factory.connect(\"0x0\", DummyProvider);\n\nexport class ERC721ContractView extends ContractView<ERC721> {\n constructor(contract: ERC721) {\n super(contract);\n this.callStatic.contract = contract;\n }\n\n async totalSupply(\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<bigint> {\n try {\n return await this.contract.getFunction(\"totalSupply()\")(overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async balanceOf(\n owner: string,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<bigint> {\n try {\n return await this.contract.getFunction(\"balanceOf(address)\")(\n owner,\n overrides || {},\n );\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async getApproved(\n tokenId: BigNumberish,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<string> {\n try {\n return await this.contract.getFunction(\"getApproved(uint256)\")(\n tokenId,\n overrides || {},\n );\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async isApprovedForAll(\n owner: string,\n operator: string,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<boolean> {\n try {\n return await this.contract.getFunction(\n \"isApprovedForAll(address,address)\",\n )(owner, operator, overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async name(\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<string> {\n try {\n return await this.contract.getFunction(\"name()\")(overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async ownerOf(\n tokenId: BigNumberish,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<string> {\n try {\n return await this.contract.getFunction(\"ownerOf(uint256)\")(\n tokenId,\n overrides || {},\n );\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async supportsInterface(\n interfaceId: BytesLike,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<boolean> {\n try {\n return await this.contract.getFunction(\"supportsInterface(bytes4)\")(\n interfaceId,\n overrides || {},\n );\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async symbol(\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<string> {\n try {\n return await this.contract.getFunction(\"symbol()\")(overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async tokenURI(\n tokenId: BigNumberish,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<string> {\n try {\n return await this.contract.getFunction(\"tokenURI(uint256)\")(\n tokenId,\n overrides || {},\n );\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n callStatic = {\n contract: this.contract,\n\n async approve(\n to: string,\n tokenId: BigNumberish,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<void> {\n try {\n return await this.contract\n .getFunction(\"approve(address,uint256)\")\n .staticCall(to, tokenId, overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n },\n async safeTransferFrom_address_address_uint256(\n from: string,\n to: string,\n tokenId: BigNumberish,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<void> {\n try {\n return await this.contract\n .getFunction(\"safeTransferFrom(address,address,uint256)\")\n .staticCall(from, to, tokenId, overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n },\n async safeTransferFrom_address_address_uint256_bytes(\n from: string,\n to: string,\n tokenId: BigNumberish,\n data: BytesLike,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<void> {\n try {\n return await this.contract\n .getFunction(\"safeTransferFrom(address,address,uint256,bytes)\")\n .staticCall(from, to, tokenId, data, overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n },\n async setApprovalForAll(\n operator: string,\n _approved: boolean,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<void> {\n try {\n return await this.contract\n .getFunction(\"setApprovalForAll(address,bool)\")\n .staticCall(operator, _approved, overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n },\n async transferFrom(\n from: string,\n to: string,\n tokenId: BigNumberish,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<void> {\n try {\n return await this.contract\n .getFunction(\"transferFrom(address,address,uint256)\")\n .staticCall(from, to, tokenId, overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n },\n };\n\n encodeCall = {\n approve(\n to: string,\n tokenId: BigNumberish,\n callContext: EthCallContext,\n ): EthCallParam {\n return encodeCallData(\n callContext,\n \"approve\",\n \"function approve(address,uint256)\",\n [to, tokenId],\n );\n },\n totalSupply(callContext: EthCallContext): EthCallParam {\n return encodeCallData(\n callContext,\n \"totalSupply\",\n \"function totalSupply()\",\n [],\n );\n },\n balanceOf(owner: string, callContext: EthCallContext): EthCallParam {\n return encodeCallData(\n callContext,\n \"balanceOf\",\n \"function balanceOf(address)\",\n [owner],\n );\n },\n getApproved(\n tokenId: BigNumberish,\n callContext: EthCallContext,\n ): EthCallParam {\n return encodeCallData(\n callContext,\n \"getApproved\",\n \"function getApproved(uint256)\",\n [tokenId],\n );\n },\n isApprovedForAll(\n owner: string,\n operator: string,\n callContext: EthCallContext,\n ): EthCallParam {\n return encodeCallData(\n callContext,\n \"isApprovedForAll\",\n \"function isApprovedForAll(address,address)\",\n [owner, operator],\n );\n },\n name(callContext: EthCallContext): EthCallParam {\n return encodeCallData(callContext, \"name\", \"function name()\", []);\n },\n ownerOf(tokenId: BigNumberish, callContext: EthCallContext): EthCallParam {\n return encodeCallData(\n callContext,\n \"ownerOf\",\n \"function ownerOf(uint256)\",\n [tokenId],\n );\n },\n safeTransferFrom_address_address_uint256(\n from: string,\n to: string,\n tokenId: BigNumberish,\n callContext: EthCallContext,\n ): EthCallParam {\n return encodeCallData(\n callContext,\n \"safeTransferFrom\",\n \"function safeTransferFrom(address,address,uint256)\",\n [from, to, tokenId],\n );\n },\n safeTransferFrom_address_address_uint256_bytes(\n from: string,\n to: string,\n tokenId: BigNumberish,\n data: BytesLike,\n callContext: EthCallContext,\n ): EthCallParam {\n return encodeCallData(\n callContext,\n \"safeTransferFrom\",\n \"function safeTransferFrom(address,address,uint256,bytes)\",\n [from, to, tokenId, data],\n );\n },\n setApprovalForAll(\n operator: string,\n _approved: boolean,\n callContext: EthCallContext,\n ): EthCallParam {\n return encodeCallData(\n callContext,\n \"setApprovalForAll\",\n \"function setApprovalForAll(address,bool)\",\n [operator, _approved],\n );\n },\n supportsInterface(\n interfaceId: BytesLike,\n callContext: EthCallContext,\n ): EthCallParam {\n return encodeCallData(\n callContext,\n \"supportsInterface\",\n \"function supportsInterface(bytes4)\",\n [interfaceId],\n );\n },\n symbol(callContext: EthCallContext): EthCallParam {\n return encodeCallData(callContext, \"symbol\", \"function symbol()\", []);\n },\n tokenURI(tokenId: BigNumberish, callContext: EthCallContext): EthCallParam {\n return encodeCallData(\n callContext,\n \"tokenURI\",\n \"function tokenURI(uint256)\",\n [tokenId],\n );\n },\n transferFrom(\n from: string,\n to: string,\n tokenId: BigNumberish,\n callContext: EthCallContext,\n ): EthCallParam {\n return encodeCallData(\n callContext,\n \"transferFrom\",\n \"function transferFrom(address,address,uint256)\",\n [from, to, tokenId],\n );\n },\n };\n}\n\nexport class ERC721BoundContractView extends BoundContractView<\n ERC721,\n ERC721ContractView\n> {\n async totalSupply(overrides?: Overrides): Promise<bigint> {\n return await this.view.totalSupply(\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async balanceOf(owner: string, overrides?: Overrides): Promise<bigint> {\n return await this.view.balanceOf(\n owner,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async getApproved(\n tokenId: BigNumberish,\n overrides?: Overrides,\n ): Promise<string> {\n return await this.view.getApproved(\n tokenId,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async isApprovedForAll(\n owner: string,\n operator: string,\n overrides?: Overrides,\n ): Promise<boolean> {\n return await this.view.isApprovedForAll(\n owner,\n operator,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async name(overrides?: Overrides): Promise<string> {\n return await this.view.name(\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async ownerOf(tokenId: BigNumberish, overrides?: Overrides): Promise<string> {\n return await this.view.ownerOf(\n tokenId,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async supportsInterface(\n interfaceId: BytesLike,\n overrides?: Overrides,\n ): Promise<boolean> {\n return await this.view.supportsInterface(\n interfaceId,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async symbol(overrides?: Overrides): Promise<string> {\n return await this.view.symbol(\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async tokenURI(\n tokenId: BigNumberish,\n overrides?: Overrides,\n ): Promise<string> {\n return await this.view.tokenURI(\n tokenId,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n callStatic = {\n view: this.view,\n context: this.context,\n\n async approve(\n to: string,\n tokenId: BigNumberish,\n overrides?: Overrides,\n ): Promise<void> {\n return await this.view.callStatic.approve(\n to,\n tokenId,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n },\n async safeTransferFrom_address_address_uint256(\n from: string,\n to: string,\n tokenId: BigNumberish,\n overrides?: Overrides,\n ): Promise<void> {\n return await this.view.callStatic.safeTransferFrom_address_address_uint256(\n from,\n to,\n tokenId,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n },\n async safeTransferFrom_address_address_uint256_bytes(\n from: string,\n to: string,\n tokenId: BigNumberish,\n data: BytesLike,\n overrides?: Overrides,\n ): Promise<void> {\n return await this.view.callStatic.safeTransferFrom_address_address_uint256_bytes(\n from,\n to,\n tokenId,\n data,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n },\n async setApprovalForAll(\n operator: string,\n _approved: boolean,\n overrides?: Overrides,\n ): Promise<void> {\n return await this.view.callStatic.setApprovalForAll(\n operator,\n _approved,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n },\n async transferFrom(\n from: string,\n to: string,\n tokenId: BigNumberish,\n overrides?: Overrides,\n ): Promise<void> {\n return await this.view.callStatic.transferFrom(\n from,\n to,\n tokenId,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n },\n };\n\n encodeCall = {\n view: this.view,\n context: this.context,\n\n approve(\n to: string,\n tokenId: BigNumberish,\n overrides?: Overrides,\n ): EthCallParam {\n return this.view.encodeCall.approve(\n to,\n tokenId,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n totalSupply(overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.totalSupply(\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n balanceOf(owner: string, overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.balanceOf(\n owner,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n getApproved(tokenId: BigNumberish, overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.getApproved(\n tokenId,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n isApprovedForAll(\n owner: string,\n operator: string,\n overrides?: Overrides,\n ): EthCallParam {\n return this.view.encodeCall.isApprovedForAll(\n owner,\n operator,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n name(overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.name(\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n ownerOf(tokenId: BigNumberish, overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.ownerOf(\n tokenId,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n safeTransferFrom_address_address_uint256(\n from: string,\n to: string,\n tokenId: BigNumberish,\n overrides?: Overrides,\n ): EthCallParam {\n return this.view.encodeCall.safeTransferFrom_address_address_uint256(\n from,\n to,\n tokenId,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n safeTransferFrom_address_address_uint256_bytes(\n from: string,\n to: string,\n tokenId: BigNumberish,\n data: BytesLike,\n overrides?: Overrides,\n ): EthCallParam {\n return this.view.encodeCall.safeTransferFrom_address_address_uint256_bytes(\n from,\n to,\n tokenId,\n data,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n setApprovalForAll(\n operator: string,\n _approved: boolean,\n overrides?: Overrides,\n ): EthCallParam {\n return this.view.encodeCall.setApprovalForAll(\n operator,\n _approved,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n supportsInterface(\n interfaceId: BytesLike,\n overrides?: Overrides,\n ): EthCallParam {\n return this.view.encodeCall.supportsInterface(\n interfaceId,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n symbol(overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.symbol(\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n tokenURI(tokenId: BigNumberish, overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.tokenURI(\n tokenId,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n transferFrom(\n from: string,\n to: string,\n tokenId: BigNumberish,\n overrides?: Overrides,\n ): EthCallParam {\n return this.view.encodeCall.transferFrom(\n from,\n to,\n tokenId,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n };\n}\n\nexport type ERC721Context = ContractContext<ERC721, ERC721BoundContractView>;\n\nexport class ERC721Processor extends BaseProcessor<\n ERC721,\n ERC721BoundContractView\n> {\n onEventApproval(\n handler: (event: ApprovalEvent, ctx: ERC721Context) => void,\n filter?: ApprovalEventFilter | ApprovalEventFilter[],\n handlerOptions?: HandlerOptions<EthFetchConfig, ApprovalEvent>,\n preprocessHandler?: (\n event: ApprovalEvent,\n ctx: ERC721Context,\n preprocessStore: { [k: string]: any },\n ) => Promise<PreprocessResult>,\n ): this {\n if (!filter) {\n filter = templateContract.filters[\"Approval(address,address,uint256)\"](\n null,\n null,\n null,\n );\n }\n return super.onEthEvent(\n handler,\n filter!,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onEventApprovalForAll(\n handler: (event: ApprovalForAllEvent, ctx: ERC721Context) => void,\n filter?: ApprovalForAllEventFilter | ApprovalForAllEventFilter[],\n handlerOptions?: HandlerOptions<EthFetchConfig, ApprovalForAllEvent>,\n preprocessHandler?: (\n event: ApprovalForAllEvent,\n ctx: ERC721Context,\n preprocessStore: { [k: string]: any },\n ) => Promise<PreprocessResult>,\n ): this {\n if (!filter) {\n filter = templateContract.filters[\"ApprovalForAll(address,address,bool)\"](\n null,\n null,\n null,\n );\n }\n return super.onEthEvent(\n handler,\n filter!,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onEventTransfer(\n handler: (event: TransferEvent, ctx: ERC721Context) => void,\n filter?: TransferEventFilter | TransferEventFilter[],\n handlerOptions?: HandlerOptions<EthFetchConfig, TransferEvent>,\n preprocessHandler?: (\n event: TransferEvent,\n ctx: ERC721Context,\n preprocessStore: { [k: string]: any },\n ) => Promise<PreprocessResult>,\n ): this {\n if (!filter) {\n filter = templateContract.filters[\"Transfer(address,address,uint256)\"](\n null,\n null,\n null,\n );\n }\n return super.onEthEvent(\n handler,\n filter!,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallApprove(\n handler: (call: ApproveCallTrace, ctx: ERC721Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, ApproveCallTrace>,\n preprocessHandler?: (\n call: ApproveCallTrace,\n ctx: ERC721Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x095ea7b3\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallTotalSupply(\n handler: (call: TotalSupplyCallTrace, ctx: ERC721Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, TotalSupplyCallTrace>,\n preprocessHandler?: (\n call: TotalSupplyCallTrace,\n ctx: ERC721Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x18160ddd\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallBalanceOf(\n handler: (call: BalanceOfCallTrace, ctx: ERC721Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, BalanceOfCallTrace>,\n preprocessHandler?: (\n call: BalanceOfCallTrace,\n ctx: ERC721Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x70a08231\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallGetApproved(\n handler: (call: GetApprovedCallTrace, ctx: ERC721Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, GetApprovedCallTrace>,\n preprocessHandler?: (\n call: GetApprovedCallTrace,\n ctx: ERC721Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x081812fc\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallIsApprovedForAll(\n handler: (call: IsApprovedForAllCallTrace, ctx: ERC721Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, IsApprovedForAllCallTrace>,\n preprocessHandler?: (\n call: IsApprovedForAllCallTrace,\n ctx: ERC721Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0xe985e9c5\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallName(\n handler: (call: NameCallTrace, ctx: ERC721Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, NameCallTrace>,\n preprocessHandler?: (\n call: NameCallTrace,\n ctx: ERC721Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x06fdde03\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallOwnerOf(\n handler: (call: OwnerOfCallTrace, ctx: ERC721Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, OwnerOfCallTrace>,\n preprocessHandler?: (\n call: OwnerOfCallTrace,\n ctx: ERC721Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x6352211e\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallSafeTransferFrom_address_address_uint256(\n handler: (\n call: SafeTransferFrom_address_address_uint256CallTrace,\n ctx: ERC721Context,\n ) => void,\n handlerOptions?: HandlerOptions<\n EthFetchConfig,\n SafeTransferFrom_address_address_uint256CallTrace\n >,\n preprocessHandler?: (\n call: SafeTransferFrom_address_address_uint256CallTrace,\n ctx: ERC721Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x42842e0e\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallSafeTransferFrom_address_address_uint256_bytes(\n handler: (\n call: SafeTransferFrom_address_address_uint256_bytesCallTrace,\n ctx: ERC721Context,\n ) => void,\n handlerOptions?: HandlerOptions<\n EthFetchConfig,\n SafeTransferFrom_address_address_uint256_bytesCallTrace\n >,\n preprocessHandler?: (\n call: SafeTransferFrom_address_address_uint256_bytesCallTrace,\n ctx: ERC721Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0xb88d4fde\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallSetApprovalForAll(\n handler: (call: SetApprovalForAllCallTrace, ctx: ERC721Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, SetApprovalForAllCallTrace>,\n preprocessHandler?: (\n call: SetApprovalForAllCallTrace,\n ctx: ERC721Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0xa22cb465\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallSupportsInterface(\n handler: (call: SupportsInterfaceCallTrace, ctx: ERC721Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, SupportsInterfaceCallTrace>,\n preprocessHandler?: (\n call: SupportsInterfaceCallTrace,\n ctx: ERC721Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x01ffc9a7\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallSymbol(\n handler: (call: SymbolCallTrace, ctx: ERC721Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, SymbolCallTrace>,\n preprocessHandler?: (\n call: SymbolCallTrace,\n ctx: ERC721Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x95d89b41\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallTokenURI(\n handler: (call: TokenURICallTrace, ctx: ERC721Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, TokenURICallTrace>,\n preprocessHandler?: (\n call: TokenURICallTrace,\n ctx: ERC721Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0xc87b56dd\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallTransferFrom(\n handler: (call: TransferFromCallTrace, ctx: ERC721Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, TransferFromCallTrace>,\n preprocessHandler?: (\n call: TransferFromCallTrace,\n ctx: ERC721Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x23b872dd\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n public static filters = {\n Approval(\n owner?: string | null,\n approved?: string | null,\n tokenId?: BigNumberish | null,\n ): ApprovalEventFilter {\n return templateContract.filters[\"Approval(address,address,uint256)\"](\n owner,\n approved,\n tokenId,\n );\n },\n ApprovalForAll(\n owner?: string | null,\n operator?: string | null,\n approved?: null,\n ): ApprovalForAllEventFilter {\n return templateContract.filters[\"ApprovalForAll(address,address,bool)\"](\n owner,\n operator,\n approved,\n );\n },\n Transfer(\n from?: string | null,\n to?: string | null,\n tokenId?: BigNumberish | null,\n ): TransferEventFilter {\n return templateContract.filters[\"Transfer(address,address,uint256)\"](\n from,\n to,\n tokenId,\n );\n },\n };\n\n protected CreateBoundContractView(): ERC721BoundContractView {\n const view = getERC721Contract(this.config.network, this.config.address);\n return new ERC721BoundContractView(this.config.address, view);\n }\n\n public static bind(options: BindOptions): ERC721Processor {\n if (!options.name) {\n options.name = \"ERC721\";\n }\n let processor = getProcessor(options) as ERC721Processor;\n if (!processor) {\n processor = new ERC721Processor(options);\n addProcessor(options, processor);\n }\n return processor;\n }\n}\n\nexport class ERC721ProcessorTemplate extends BaseProcessorTemplate<\n ERC721,\n ERC721BoundContractView,\n ERC721Processor\n> {\n bindInternal(options: BindOptions) {\n if (!options.name) {\n options.name = \"ERC721\";\n }\n let processor = getProcessor(options) as ERC721Processor;\n if (!processor) {\n processor = new ERC721Processor(options);\n addProcessor(options, processor);\n }\n return processor;\n }\n\n onEventApproval(\n handler: (event: ApprovalEvent, ctx: ERC721Context) => void,\n filter?: ApprovalEventFilter | ApprovalEventFilter[],\n handlerOptions?: HandlerOptions<EthFetchConfig, ApprovalEvent>,\n preprocessHandler?: (\n event: ApprovalEvent,\n ctx: ERC721Context,\n preprocessStore: { [k: string]: any },\n ) => Promise<PreprocessResult>,\n ): this {\n if (!filter) {\n filter = templateContract.filters[\"Approval(address,address,uint256)\"](\n null,\n null,\n null,\n );\n }\n return super.onEthEvent(\n handler,\n filter!,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onEventApprovalForAll(\n handler: (event: ApprovalForAllEvent, ctx: ERC721Context) => void,\n filter?: ApprovalForAllEventFilter | ApprovalForAllEventFilter[],\n handlerOptions?: HandlerOptions<EthFetchConfig, ApprovalForAllEvent>,\n preprocessHandler?: (\n event: ApprovalForAllEvent,\n ctx: ERC721Context,\n preprocessStore: { [k: string]: any },\n ) => Promise<PreprocessResult>,\n ): this {\n if (!filter) {\n filter = templateContract.filters[\"ApprovalForAll(address,address,bool)\"](\n null,\n null,\n null,\n );\n }\n return super.onEthEvent(\n handler,\n filter!,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onEventTransfer(\n handler: (event: TransferEvent, ctx: ERC721Context) => void,\n filter?: TransferEventFilter | TransferEventFilter[],\n handlerOptions?: HandlerOptions<EthFetchConfig, TransferEvent>,\n preprocessHandler?: (\n event: TransferEvent,\n ctx: ERC721Context,\n preprocessStore: { [k: string]: any },\n ) => Promise<PreprocessResult>,\n ): this {\n if (!filter) {\n filter = templateContract.filters[\"Transfer(address,address,uint256)\"](\n null,\n null,\n null,\n );\n }\n return super.onEthEvent(\n handler,\n filter!,\n handlerOptions,\n preprocessHandler,\n );\n }\n}\n\nexport function getERC721Contract(\n chainId: EthChainId,\n address: string,\n): ERC721ContractView {\n let contract = getContractByABI(\n \"ERC721\",\n address,\n chainId,\n ) as ERC721ContractView;\n if (!contract) {\n const rawContract = ERC721__factory.connect(address, getProvider(chainId));\n contract = new ERC721ContractView(rawContract);\n addContractByABI(\"ERC721\", address, chainId, contract);\n }\n return contract;\n}\n\nexport function getERC721ContractOnContext(\n context: EthContext,\n address: string,\n): ERC721BoundContractView {\n const view = getERC721Contract(context.getChainId(), address);\n const boundView = new ERC721BoundContractView(address, view);\n boundView.context = context;\n if (boundView.callStatic) {\n boundView.callStatic.context = context;\n }\n return boundView;\n}\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { LogParams } from \"ethers/providers\";\nimport { EthChainId } from \"@sentio/sdk/eth\";\nimport {\n ApprovalEventObject,\n ApprovalForAllEventObject,\n TransferEventObject,\n} from \"./ERC721.js\";\nimport { getERC721Contract } from \"./erc721-processor.js\";\nconst mockField = {\n blockHash:\n \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n blockNumber: 0,\n logIndex: 0,\n removed: false,\n transactionHash:\n \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n transactionIndex: 0,\n};\n\nexport function mockApprovalLog(\n contractAddress: string,\n event: ApprovalEventObject,\n): LogParams {\n const contract = getERC721Contract(EthChainId.ETHEREUM, contractAddress);\n const encodedLog = contract.rawContract.interface.encodeEventLog(\n \"Approval(address,address,uint256)\",\n [event.owner, event.approved, event.tokenId],\n );\n return {\n ...mockField,\n index: 0,\n address: contractAddress,\n data: encodedLog.data,\n topics: encodedLog.topics,\n };\n}\n\nexport function mockApprovalForAllLog(\n contractAddress: string,\n event: ApprovalForAllEventObject,\n): LogParams {\n const contract = getERC721Contract(EthChainId.ETHEREUM, contractAddress);\n const encodedLog = contract.rawContract.interface.encodeEventLog(\n \"ApprovalForAll(address,address,bool)\",\n [event.owner, event.operator, event.approved],\n );\n return {\n ...mockField,\n index: 0,\n address: contractAddress,\n data: encodedLog.data,\n topics: encodedLog.topics,\n };\n}\n\nexport function mockTransferLog(\n contractAddress: string,\n event: TransferEventObject,\n): LogParams {\n const contract = getERC721Contract(EthChainId.ETHEREUM, contractAddress);\n const encodedLog = contract.rawContract.interface.encodeEventLog(\n \"Transfer(address,address,uint256)\",\n [event.from, event.to, event.tokenId],\n );\n return {\n ...mockField,\n index: 0,\n address: contractAddress,\n data: encodedLog.data,\n topics: encodedLog.topics,\n };\n}\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\n\nexport * from \"./internal/erc721-processor.js\";\nexport * from \"./internal/erc721-test-utils.js\";\nexport * from \"./internal/ERC721.js\";\nexport * from \"./internal/factories/ERC721__factory.js\";\n","import { ListStateStorage } from '@sentio/runtime'\nimport { AccountProcessor } from './account-processor.js'\n\nexport class AccountProcessorState extends ListStateStorage<AccountProcessor> {\n static INSTANCE = new AccountProcessorState()\n}\n","import { ERC20__factory, ERC721__factory } from './builtin/internal/index.js'\nimport {\n AddressType,\n type EthFetchConfig,\n EthFetchConfigSchema,\n type PreprocessResult,\n PreprocessResultSchema,\n ProcessResultSchema,\n timestampDate\n} from '@sentio/protos'\nimport { create } from '@bufbuild/protobuf'\nimport { ConnectError, Code } from '@connectrpc/connect'\n\nimport { PartiallyOptional, PromiseOrVoid } from '../core/index.js'\n\nimport { AccountBindOptions } from './bind-options.js'\nimport { ERC20Processor, TransferEvent as ERC20TransferEvent } from './builtin/erc20.js'\nimport { ERC721Processor, TransferEvent as ERC721TransferEvent } from './builtin/erc721.js'\nimport { AccountContext } from './context.js'\nimport { AddressOrTypeEventFilter, defaultPreprocessHandler, EventsHandler } from './base-processor.js'\nimport { Block } from 'ethers'\nimport { AccountProcessorState } from './account-processor-state.js'\nimport { fixEmptyKey, formatEthData, TypedEvent, validateAndNormalizeAddress } from './eth.js'\nimport { EthChainId } from '@sentio/chain'\nimport { getHandlerName, proxyProcessor } from '../utils/metrics.js'\n\nconst ERC20_INTERFACE = ERC20__factory.createInterface()\nconst ERC721_INTERFACE = ERC721__factory.createInterface()\n\nexport class AccountProcessor {\n config: AccountBindOptions\n eventHandlers: EventsHandler[] = []\n\n static bind(config: PartiallyOptional<AccountBindOptions, 'network'>): AccountProcessor {\n const processor = new AccountProcessor(config)\n AccountProcessorState.INSTANCE.addValue(processor)\n return processor\n }\n\n protected constructor(config: PartiallyOptional<AccountBindOptions, 'network'>) {\n this.config = {\n ...config,\n address: validateAndNormalizeAddress(config.address),\n network: config.network || EthChainId.ETHEREUM\n }\n\n return proxyProcessor(this)\n }\n\n public getChainId(): EthChainId {\n return this.config.network\n }\n\n /**\n * Register custom handler function to process erc20 transfer event to this account\n * @param handler custom handler function\n * @param tokensAddresses all the erc20 token address to watch\n * @param fetchConfig\n * @param preprocessHandler\n */\n onERC20TransferIn(\n handler: (event: ERC20TransferEvent, ctx: AccountContext) => PromiseOrVoid,\n tokensAddresses: string[] = [],\n fetchConfig?: Partial<EthFetchConfig>,\n preprocessHandler: (\n event: ERC20TransferEvent,\n ctx: AccountContext,\n preprocessStore: { [k: string]: any }\n ) => Promise<PreprocessResult> = defaultPreprocessHandler\n ) {\n return this.onERC20(\n handler,\n tokensAddresses,\n (address: string) => ERC20Processor.filters.Transfer(null, this.config.address),\n fetchConfig,\n preprocessHandler\n )\n }\n\n /**\n * Register custom handler function to process erc20 transfer event from this account\n * @param handler custom handler function\n * @param tokensAddresses all the erc20 token address to watch\n * @param fetchConfig\n * @param preprocessHandler\n */\n onERC20TransferOut(\n handler: (event: ERC20TransferEvent, ctx: AccountContext) => PromiseOrVoid,\n tokensAddresses: string[] = [],\n fetchConfig?: Partial<EthFetchConfig>,\n preprocessHandler: (\n event: ERC20TransferEvent,\n ctx: AccountContext,\n preprocessStore: { [k: string]: any }\n ) => Promise<PreprocessResult> = defaultPreprocessHandler\n ) {\n return this.onERC20(\n handler,\n tokensAddresses,\n (address: string) => ERC20Processor.filters.Transfer(this.config.address),\n fetchConfig,\n preprocessHandler\n )\n }\n\n /**\n * Register custom handler function to process erc20 mint for this account\n * @param handler custom handler function\n * @param tokensAddresses all the erc20 token address to watch\n * @param fetchConfig\n * @param preprocessHandler\n */\n onERC20Minted(\n handler: (event: ERC20TransferEvent, ctx: AccountContext) => PromiseOrVoid,\n tokensAddresses: string[] = [],\n fetchConfig?: Partial<EthFetchConfig>,\n preprocessHandler: (\n event: ERC20TransferEvent,\n ctx: AccountContext,\n preprocessStore: { [k: string]: any }\n ) => Promise<PreprocessResult> = defaultPreprocessHandler\n ) {\n return this.onERC20(\n handler,\n tokensAddresses,\n (address: string) =>\n ERC20Processor.filters.Transfer('0x0000000000000000000000000000000000000000', this.config.address),\n fetchConfig,\n preprocessHandler\n )\n }\n\n private onERC20(\n handler: (event: ERC20TransferEvent, ctx: AccountContext) => PromiseOrVoid,\n tokensAddresses: string[] = [],\n defaultFilter: (address: string) => AddressOrTypeEventFilter,\n fetchConfig?: Partial<EthFetchConfig>,\n preprocessHandler: (\n event: ERC20TransferEvent,\n ctx: AccountContext,\n preprocessStore: { [k: string]: any }\n ) => Promise<PreprocessResult> = defaultPreprocessHandler\n ) {\n return this.onERC(handler, tokensAddresses, defaultFilter, AddressType.ERC20, fetchConfig, preprocessHandler)\n }\n\n /**\n * Register custom handler function to process ERC721 transfer event to this account\n * @param handler custom handler function\n * @param collections all the ERC721 token address to watch, if not provided then watch all ERC721\n * @param fetchConfig\n * @param preprocessHandler\n */\n onERC721TransferIn(\n handler: (event: ERC721TransferEvent, ctx: AccountContext) => PromiseOrVoid,\n collections: string[],\n fetchConfig?: Partial<EthFetchConfig>,\n preprocessHandler: (\n event: ERC721TransferEvent,\n ctx: AccountContext,\n preprocessStore: { [k: string]: any }\n ) => Promise<PreprocessResult> = defaultPreprocessHandler\n ) {\n return this.onERC721(\n handler,\n collections,\n (address: string) => ERC721Processor.filters.Transfer(null, this.config.address),\n fetchConfig,\n preprocessHandler\n )\n }\n\n /**\n * Register custom handler function to process ERC721 transfer event from this account\n * @param handler custom handler function\n * @param collections all the ERC721 token address to watch, if not provided then watch all ERC721\n * @param fetchConfig\n * @param preprocessHandler\n */\n onERC721TransferOut(\n handler: (event: ERC721TransferEvent, ctx: AccountContext) => PromiseOrVoid,\n collections: string[],\n fetchConfig?: Partial<EthFetchConfig>,\n preprocessHandler: (\n event: ERC721TransferEvent,\n ctx: AccountContext,\n preprocessStore: { [k: string]: any }\n ) => Promise<PreprocessResult> = defaultPreprocessHandler\n ) {\n return this.onERC721(\n handler,\n collections,\n (address: string) => ERC721Processor.filters.Transfer(this.config.address),\n fetchConfig,\n preprocessHandler\n )\n }\n\n /**\n * Register custom handler function to process ERC721 mint for this account\n * @param handler custom handler function\n * @param collections all the ERC721 token address to watch, if not provided then watch all ERC721\n * @param fetchConfig\n * @param preprocessHandler\n */\n onERC721Minted(\n handler: (event: ERC721TransferEvent, ctx: AccountContext) => PromiseOrVoid,\n collections: string[] = [],\n fetchConfig?: Partial<EthFetchConfig>,\n preprocessHandler: (\n event: ERC721TransferEvent,\n ctx: AccountContext,\n preprocessStore: { [k: string]: any }\n ) => Promise<PreprocessResult> = defaultPreprocessHandler\n ) {\n return this.onERC721(\n handler,\n collections,\n (address: string) =>\n ERC721Processor.filters.Transfer('0x0000000000000000000000000000000000000000', this.config.address),\n fetchConfig,\n preprocessHandler\n )\n }\n\n private onERC721(\n handler: (event: ERC721TransferEvent, ctx: AccountContext) => PromiseOrVoid,\n collections: string[],\n defaultFilter: (address: string) => AddressOrTypeEventFilter,\n fetchConfig?: Partial<EthFetchConfig>,\n preprocessHandler: (\n event: ERC721TransferEvent,\n ctx: AccountContext,\n preprocessStore: { [k: string]: any }\n ) => Promise<PreprocessResult> = defaultPreprocessHandler\n ) {\n return this.onERC(handler, collections, defaultFilter, AddressType.ERC721, fetchConfig, preprocessHandler)\n }\n\n private onERC(\n handler: (event: any, ctx: AccountContext) => PromiseOrVoid,\n contractAddresses: string[],\n defaultFilter: (address: string) => AddressOrTypeEventFilter,\n addressType: AddressType,\n fetchConfig?: Partial<EthFetchConfig>,\n preprocessHandler: (\n event: any,\n ctx: AccountContext,\n preprocessStore: { [k: string]: any }\n ) => Promise<PreprocessResult> = defaultPreprocessHandler\n ) {\n const filters = []\n for (const token of contractAddresses) {\n const filter = defaultFilter(this.config.address)\n filter.address = token\n filters.push(filter)\n }\n if (!filters.length) {\n const filter = defaultFilter(this.config.address)\n filter.address = undefined\n filter.addressType = addressType\n filters.push(filter)\n }\n return this.onEvent(handler, filters, fetchConfig, preprocessHandler)\n }\n\n protected onEvent(\n handler: (event: TypedEvent, ctx: AccountContext) => PromiseOrVoid,\n filter: AddressOrTypeEventFilter | AddressOrTypeEventFilter[],\n fetchConfig?: Omit<Partial<EthFetchConfig>, '$typeName' | '$unknown'>,\n preprocessHandler: (\n event: TypedEvent,\n ctx: AccountContext,\n preprocessStore: { [k: string]: any }\n ) => Promise<PreprocessResult> = defaultPreprocessHandler\n ) {\n const chainId = this.getChainId()\n\n let _filters: AddressOrTypeEventFilter[] = []\n\n if (Array.isArray(filter)) {\n _filters = filter\n } else {\n _filters.push(filter)\n }\n\n // let hasVaildConfig = false\n // for (const filter of _filters) {\n // if (filter.address) {\n // hasVaildConfig = true\n // break\n // }\n // if (filter.topics && filter.topics.length) {\n // hasVaildConfig = true\n // break\n // }\n // }\n //\n // if (!hasVaildConfig) {\n // throw Error('no valid config has been found for this account')\n // }\n\n const config = this.config\n\n this.eventHandlers.push({\n filters: _filters,\n fetchConfig: create(EthFetchConfigSchema, fetchConfig || {}),\n handlerName: getHandlerName(),\n handler: async function (data) {\n const { log, block, transaction, transactionReceipt } = formatEthData(data)\n if (!log) {\n throw new ConnectError('Log is empty', Code.InvalidArgument)\n }\n // const log = data.log as { topics: Array<string>; data: string }\n const ctx = new AccountContext(\n chainId,\n config.address,\n data.timestamp ? timestampDate(data.timestamp) : undefined,\n block as Block,\n log,\n undefined,\n transaction,\n transactionReceipt\n )\n\n const logParam = log as any as { topics: Array<string>; data: string }\n const parsed = ERC20_INTERFACE.parseLog(logParam)\n if (parsed) {\n const event: TypedEvent = new TypedEvent(log, parsed.name, fixEmptyKey(parsed))\n await handler(event, ctx)\n return ctx.stopAndGetResult()\n }\n return create(ProcessResultSchema)\n },\n preprocessHandler: async function (data, preprocessStore: { [k: string]: any }) {\n const { log, block, transaction, transactionReceipt } = formatEthData(data)\n if (!log) {\n throw new ConnectError('Log is empty', Code.InvalidArgument)\n }\n // const log = data.log as { topics: Array<string>; data: string }\n const ctx = new AccountContext(\n chainId,\n config.address,\n data.timestamp ? timestampDate(data.timestamp) : undefined,\n block as Block,\n log,\n undefined,\n transaction,\n transactionReceipt\n )\n\n const logParam = log as any as { topics: Array<string>; data: string }\n const parsed = ERC20_INTERFACE.parseLog(logParam)\n if (parsed) {\n const event: TypedEvent = new TypedEvent(log, parsed.name, fixEmptyKey(parsed))\n return preprocessHandler(event, ctx, preprocessStore)\n }\n return create(PreprocessResultSchema)\n }\n })\n\n return this\n }\n}\n","import { errorString, GLOBAL_CONFIG, mergeProcessResults, Plugin, PluginManager, USER_PROCESSOR } from '@sentio/runtime'\nimport { getProvider } from './provider.js'\nimport { PartitionHandlerManager } from '../core/index.js'\nimport {\n AccountConfigSchema,\n ContractConfigSchema,\n DataBinding,\n HandlerType,\n InitResponse,\n LogFilterSchema,\n LogHandlerConfigSchema,\n OnIntervalConfigSchema,\n PreparedData,\n PreprocessResult,\n PreprocessResultSchema,\n ProcessConfigResponse,\n ProcessResult,\n ProcessStreamResponse_Partitions,\n ProcessStreamResponse_PartitionsSchema,\n StartRequest,\n TopicSchema,\n TraceHandlerConfigSchema,\n TransactionHandlerConfigSchema\n} from '@sentio/protos'\nimport { create } from '@bufbuild/protobuf'\nimport { ConnectError, Code } from '@connectrpc/connect'\nimport { EthProcessorState } from './binds.js'\nimport { AccountProcessorState } from './account-processor-state.js'\nimport { ProcessorTemplateProcessorState } from './base-processor-template.js'\nimport { GlobalProcessorState } from './base-processor.js'\nimport { validateAndNormalizeAddress } from './eth.js'\nimport { EthChainId } from '@sentio/chain'\nimport { EthContext } from './context.js'\nimport { timeOrBlockToBlockNumber } from '@sentio/sdk/utils'\nimport { HandlerRegister } from '../core/handler-register.js'\n\nexport class EthPlugin extends Plugin {\n name: string = 'EthPlugin'\n handlerRegister = new HandlerRegister()\n\n partitionManager = new PartitionHandlerManager()\n\n async init(config: InitResponse): Promise<void> {\n for (const state of [EthProcessorState.INSTANCE, GlobalProcessorState.INSTANCE, AccountProcessorState.INSTANCE]) {\n for (const processor of state.getValues()) {\n const chainId = processor.getChainId()\n config.chainIds.push(chainId)\n }\n }\n }\n\n async configure(config: ProcessConfigResponse, forChainId?: string) {\n this.handlerRegister.clear(forChainId as EthChainId)\n\n for (const processor of EthProcessorState.INSTANCE.getValues()) {\n // If server favor incremental update this need to change\n // Start basic config for contract\n const chainId = processor.getChainId()\n // this.processorsByChainId.set(chainId, processor)\n if (forChainId !== undefined && forChainId !== chainId.toString()) {\n continue\n }\n const provider = getProvider(chainId)\n const startBlock = await timeOrBlockToBlockNumber(provider, processor.config.start)\n const endBlock = processor.config.end ? await timeOrBlockToBlockNumber(provider, processor.config.end) : undefined\n\n const contractConfig = create(ContractConfigSchema, {\n processorType: USER_PROCESSOR,\n contract: {\n name: processor.config.name,\n chainId: chainId.toString(),\n address: validateAndNormalizeAddress(processor.config.address),\n abi: ''\n },\n startBlock,\n endBlock\n })\n\n // Step 1. Prepare all the block handlers\n for (const blockHandler of processor.blockHandlers) {\n const handlerId = this.handlerRegister.register(blockHandler.handler, chainId)\n\n this.partitionManager.registerPartitionHandler(HandlerType.ETH_BLOCK, handlerId, blockHandler.partitionHandler)\n // TODO wrap the block handler into one\n\n contractConfig.intervalConfigs.push(\n create(OnIntervalConfigSchema, {\n slot: 0,\n slotInterval: blockHandler.blockInterval,\n minutes: 0,\n minutesInterval: blockHandler.timeIntervalInMinutes,\n handlerId: handlerId,\n handlerName: blockHandler.handlerName,\n fetchConfig: blockHandler.fetchConfig\n })\n )\n }\n\n // Step 2. Prepare all trace handlers\n for (const traceHandler of processor.traceHandlers) {\n const handlerId = this.handlerRegister.register(traceHandler.handler, chainId)\n\n this.partitionManager.registerPartitionHandler(HandlerType.ETH_TRACE, handlerId, traceHandler.partitionHandler)\n for (const signature of traceHandler.signatures) {\n contractConfig.traceConfigs.push(\n create(TraceHandlerConfigSchema, {\n signature: signature,\n handlerId: handlerId,\n handlerName: traceHandler.handlerName,\n fetchConfig: traceHandler.fetchConfig\n })\n )\n }\n }\n\n // Step 3. Prepare all the event handlers\n for (const eventsHandler of processor.eventHandlers) {\n // associate id with filter\n const handlerId = this.handlerRegister.register(eventsHandler.handler, chainId)\n this.partitionManager.registerPartitionHandler(HandlerType.ETH_LOG, handlerId, eventsHandler.partitionHandler)\n const logConfig = create(LogHandlerConfigSchema, {\n handlerId: handlerId,\n handlerName: eventsHandler.handlerName,\n filters: [],\n fetchConfig: eventsHandler.fetchConfig\n })\n\n for (const filter of eventsHandler.filters) {\n const topics = await filter.getTopicFilter()\n\n // if (!filter.topics) {\n // throw new ConnectError('Topic should not be null', Code.InvalidArgument)\n // }\n const logFilter = create(LogFilterSchema, {\n addressOrType: contractConfig.contract?.address\n ? { case: 'address', value: validateAndNormalizeAddress(contractConfig.contract.address) }\n : undefined,\n topics: []\n })\n\n for (const ts of topics) {\n let hashes: string[] = []\n if (Array.isArray(ts)) {\n hashes = hashes.concat(ts)\n } else if (ts) {\n hashes.push(ts)\n }\n logFilter.topics.push(create(TopicSchema, { hashes: hashes }))\n }\n logConfig.filters.push(logFilter)\n }\n contractConfig.logConfigs.push(logConfig)\n }\n\n // Finish up a contract\n config.contractConfigs.push(contractConfig)\n }\n\n for (const processor of GlobalProcessorState.INSTANCE.getValues()) {\n const chainId = processor.getChainId()\n if (forChainId !== undefined && forChainId !== chainId.toString()) {\n continue\n }\n let startBlock, endBlock: bigint | undefined\n try {\n const provider = getProvider(chainId)\n startBlock = await timeOrBlockToBlockNumber(provider, processor.config.start)\n endBlock = processor.config.end ? await timeOrBlockToBlockNumber(provider, processor.config.end) : undefined\n } catch (e) {\n console.error('failed to get start/end block', e)\n startBlock = processor.config.start?.block != undefined ? BigInt(processor.config.start.block) : undefined\n endBlock = processor.config.end?.block != undefined ? BigInt(processor.config.end.block) : undefined\n }\n\n const contractConfig = create(ContractConfigSchema, {\n processorType: USER_PROCESSOR,\n contract: {\n name: processor.config.name,\n chainId: chainId.toString(),\n address: processor.config.address, // can only be *\n abi: ''\n },\n startBlock,\n endBlock\n })\n\n for (const blockHandler of processor.blockHandlers) {\n const handlerId = this.handlerRegister.register(blockHandler.handler, chainId)\n contractConfig.intervalConfigs.push(\n create(OnIntervalConfigSchema, {\n slot: 0,\n slotInterval: blockHandler.blockInterval,\n minutes: 0,\n minutesInterval: blockHandler.timeIntervalInMinutes,\n handlerId: handlerId,\n handlerName: blockHandler.handlerName,\n fetchConfig: blockHandler.fetchConfig\n })\n )\n }\n\n for (const transactionHandler of processor.transactionHandler) {\n const handlerId = this.handlerRegister.register(transactionHandler.handler, chainId)\n this.partitionManager.registerPartitionHandler(\n HandlerType.ETH_TRANSACTION,\n handlerId,\n transactionHandler.partitionHandler\n )\n contractConfig.transactionConfig.push(\n create(TransactionHandlerConfigSchema, {\n handlerId: handlerId,\n handlerName: transactionHandler.handlerName,\n fetchConfig: transactionHandler.fetchConfig\n })\n )\n }\n\n for (const traceHandler of processor.traceHandlers) {\n const handlerId = this.handlerRegister.register(traceHandler.handler, chainId)\n for (const signature of traceHandler.signatures) {\n contractConfig.traceConfigs.push(\n create(TraceHandlerConfigSchema, {\n signature: signature,\n handlerId: handlerId,\n handlerName: traceHandler.handlerName,\n fetchConfig: traceHandler.fetchConfig\n })\n )\n }\n }\n\n for (const eventsHandler of processor.eventHandlers) {\n // associate id with filter\n const handlerId = this.handlerRegister.register(eventsHandler.handler, processor.getChainId())\n const logConfig = create(LogHandlerConfigSchema, {\n handlerId: handlerId,\n handlerName: eventsHandler.handlerName,\n filters: [],\n fetchConfig: eventsHandler.fetchConfig\n })\n\n if (!eventsHandler.filters || eventsHandler.filters.length === 0) {\n // if no filter, then we assume all logs\n logConfig.filters.push(\n create(LogFilterSchema, {\n topics: []\n })\n )\n } else {\n for (const filter of eventsHandler.filters) {\n const topics = await filter.getTopicFilter()\n // if (!filter.topics) {\n // throw new ConnectError('Topic should not be null', Code.InvalidArgument)\n // }\n let address = undefined\n if (filter.address) {\n address = filter.address.toString()\n }\n const logFilter = create(LogFilterSchema, {\n addressOrType:\n filter.addressType != undefined\n ? { case: 'addressType', value: filter.addressType }\n : address\n ? { case: 'address', value: validateAndNormalizeAddress(address) }\n : undefined,\n topics: []\n })\n\n for (const ts of topics) {\n let hashes: string[] = []\n if (Array.isArray(ts)) {\n hashes = hashes.concat(ts)\n } else if (ts) {\n hashes.push(ts)\n }\n logFilter.topics.push(create(TopicSchema, { hashes: hashes }))\n }\n logConfig.filters.push(logFilter)\n }\n }\n contractConfig.logConfigs.push(logConfig)\n }\n\n config.contractConfigs.push(contractConfig)\n }\n\n // part 1.b prepare EVM account processors\n for (const processor of AccountProcessorState.INSTANCE.getValues()) {\n if (forChainId !== undefined && forChainId !== processor.getChainId().toString()) {\n continue\n }\n const accountConfig = create(AccountConfigSchema, {\n address: validateAndNormalizeAddress(processor.config.address),\n chainId: processor.getChainId().toString(),\n startBlock: processor.config.startBlock ? BigInt(processor.config.startBlock) : 0n\n })\n // TODO add interval\n for (const eventsHandler of processor.eventHandlers) {\n // associate id with filter\n const handlerId = this.handlerRegister.register(eventsHandler.handler, processor.getChainId())\n const logConfig = create(LogHandlerConfigSchema, {\n handlerId: handlerId,\n handlerName: eventsHandler.handlerName,\n filters: [],\n fetchConfig: eventsHandler.fetchConfig\n })\n\n for (const filter of eventsHandler.filters) {\n const topics = await filter.getTopicFilter()\n\n let address = undefined\n if (filter.address) {\n address = filter.address.toString()\n }\n const logFilter = create(LogFilterSchema, {\n addressOrType: filter.addressType\n ? { case: 'addressType', value: filter.addressType }\n : address\n ? { case: 'address', value: validateAndNormalizeAddress(address) }\n : undefined,\n topics: []\n })\n\n for (const ts of topics) {\n let hashes: string[] = []\n if (Array.isArray(ts)) {\n hashes = hashes.concat(ts)\n } else if (ts) {\n hashes.push(ts)\n }\n logFilter.topics.push(create(TopicSchema, { hashes: hashes }))\n }\n logConfig.filters.push(logFilter)\n }\n\n accountConfig.logConfigs.push(logConfig)\n }\n\n config.accountConfigs.push(accountConfig)\n }\n\n // this.handlers = handlers\n // this.preprocessHandlers = preprocessHandlers\n }\n\n supportedHandlers = [HandlerType.ETH_LOG, HandlerType.ETH_BLOCK, HandlerType.ETH_TRACE, HandlerType.ETH_TRANSACTION]\n\n processBinding(request: DataBinding, preparedData: PreparedData | undefined): Promise<ProcessResult> {\n // return Promise.resolve(undefined);\n switch (request.handlerType) {\n case HandlerType.ETH_LOG:\n return this.processLog(request, preparedData)\n case HandlerType.ETH_TRACE:\n return this.processTrace(request, preparedData)\n case HandlerType.ETH_BLOCK:\n return this.processBlock(request, preparedData)\n case HandlerType.ETH_TRANSACTION:\n return this.processTransaction(request, preparedData)\n default:\n throw new ConnectError('No handle type registered ' + request.handlerType, Code.InvalidArgument)\n }\n }\n\n async partition(request: DataBinding): Promise<ProcessStreamResponse_Partitions> {\n let data: any\n switch (request.handlerType) {\n case HandlerType.ETH_LOG:\n if (request.data?.value.case !== 'ethLog' || !request.data.value.value) {\n throw new ConnectError(\"ethLog can't be empty\", Code.InvalidArgument)\n }\n data = request.data.value.value\n break\n case HandlerType.ETH_TRACE:\n if (request.data?.value.case !== 'ethTrace' || !request.data.value.value) {\n throw new ConnectError(\"ethTrace can't be empty\", Code.InvalidArgument)\n }\n data = request.data.value.value\n break\n case HandlerType.ETH_BLOCK:\n if (request.data?.value.case !== 'ethBlock' || !request.data.value.value) {\n throw new ConnectError(\"ethBlock can't be empty\", Code.InvalidArgument)\n }\n data = request.data.value.value\n break\n case HandlerType.ETH_TRANSACTION:\n if (request.data?.value.case !== 'ethTransaction' || !request.data.value.value) {\n throw new ConnectError(\"ethTransaction can't be empty\", Code.InvalidArgument)\n }\n data = request.data.value.value\n break\n default:\n throw new ConnectError('No handle type registered ' + request.handlerType, Code.InvalidArgument)\n }\n const partitions = await this.partitionManager.processPartitionForHandlerType(\n request.handlerType,\n request.handlerIds,\n data\n )\n return create(ProcessStreamResponse_PartitionsSchema, {\n partitions\n })\n }\n\n async start(request: StartRequest) {\n const allowedChainIds = new Set<string>(Object.values(EthChainId))\n\n for (const instance of request.templateInstances) {\n if (!allowedChainIds.has(instance.contract?.chainId || '')) {\n continue\n }\n\n const template = ProcessorTemplateProcessorState.INSTANCE.getValues()[instance.templateId]\n if (!template) {\n throw new ConnectError('Invalid template contract:' + instance, Code.InvalidArgument)\n }\n if (!instance.contract) {\n throw new ConnectError('Contract Empty from:' + instance, Code.InvalidArgument)\n }\n const ctx = new NoopContext(instance.contract.chainId as EthChainId)\n template.startInstance(\n {\n name: instance.contract.name,\n address: validateAndNormalizeAddress(instance.contract.address),\n startBlock: instance.startBlock,\n endBlock: instance.endBlock,\n baseLabels: instance.baseLabels as { [key: string]: string } | undefined\n },\n ctx\n )\n }\n }\n\n async processLog(request: DataBinding, preparedData: PreparedData | undefined): Promise<ProcessResult> {\n if (request.data?.value.case !== 'ethLog' || !request.data.value.value.rawLog) {\n throw new ConnectError(\"Log can't be null\", Code.InvalidArgument)\n }\n const ethLog = request.data.value.value\n\n const promises: Promise<ProcessResult>[] = []\n for (const handlerId of request.handlerIds) {\n const handler = this.handlerRegister.getHandlerById(request.chainId, handlerId)\n const promise = handler(ethLog, preparedData).catch((e: any) => {\n console.error('error processing log: ', e)\n throw new ConnectError('error processing log: ' + ethLog.rawLog + '\\n' + errorString(e), Code.Internal)\n })\n if (GLOBAL_CONFIG.execution.sequential) {\n await promise\n }\n promises.push(promise)\n }\n return mergeProcessResults(await Promise.all(promises))\n }\n\n async processTrace(binding: DataBinding, preparedData: PreparedData | undefined): Promise<ProcessResult> {\n if (binding.data?.value.case !== 'ethTrace' || !binding.data.value.value.rawTrace) {\n throw new ConnectError(\"Trace can't be null\", Code.InvalidArgument)\n }\n const ethTrace = binding.data.value.value\n\n const promises: Promise<ProcessResult>[] = []\n\n for (const handlerId of binding.handlerIds) {\n const promise = this.handlerRegister\n .getHandlerById(binding.chainId, handlerId)(ethTrace, preparedData)\n .catch((e: any) => {\n console.error('error processing trace: ', e)\n throw new ConnectError('error processing trace: ' + ethTrace.rawTrace + '\\n' + errorString(e), Code.Internal)\n })\n if (GLOBAL_CONFIG.execution.sequential) {\n await promise\n }\n promises.push(promise)\n }\n return mergeProcessResults(await Promise.all(promises))\n }\n\n async processBlock(binding: DataBinding, preparedData: PreparedData | undefined): Promise<ProcessResult> {\n if (binding.data?.value.case !== 'ethBlock' || !binding.data.value.value.rawBlock) {\n throw new ConnectError(\"Block can't be empty\", Code.InvalidArgument)\n }\n const ethBlock = binding.data.value.value\n\n const promises: Promise<ProcessResult>[] = []\n for (const handlerId of binding.handlerIds) {\n const promise = this.handlerRegister\n .getHandlerById(binding.chainId, handlerId)(ethBlock, preparedData)\n .catch((e: any) => {\n console.error('error processing block: ', e)\n throw new ConnectError('error processing block: ' + errorString(e), Code.Internal)\n })\n if (GLOBAL_CONFIG.execution.sequential) {\n await promise\n }\n promises.push(promise)\n }\n return mergeProcessResults(await Promise.all(promises))\n }\n\n async processTransaction(binding: DataBinding, preparedData: PreparedData | undefined): Promise<ProcessResult> {\n if (binding.data?.value.case !== 'ethTransaction' || !binding.data.value.value.rawTransaction) {\n throw new ConnectError(\"transaction can't be null\", Code.InvalidArgument)\n }\n const ethTransaction = binding.data.value.value\n\n const promises: Promise<ProcessResult>[] = []\n\n for (const handlerId of binding.handlerIds) {\n const promise = this.handlerRegister\n .getHandlerById(binding.chainId, handlerId)(ethTransaction, preparedData)\n .catch((e: any) => {\n throw new ConnectError(\n 'error processing transaction: ' + ethTransaction.rawTransaction + '\\n' + errorString(e),\n Code.Internal\n )\n })\n if (GLOBAL_CONFIG.execution.sequential) {\n await promise\n }\n promises.push(promise)\n }\n return mergeProcessResults(await Promise.all(promises))\n }\n}\n\nPluginManager.INSTANCE.register(new EthPlugin())\n\nclass NoopContext extends EthContext {\n public constructor(chainId: EthChainId) {\n super(chainId, '')\n }\n\n protected getContractName(): string {\n return ''\n }\n}\n\nfunction mergePreprocessResults(results: PreprocessResult[]): PreprocessResult {\n const res = create(PreprocessResultSchema, { ethCallParams: [] })\n for (const r of results) {\n res.ethCallParams = res.ethCallParams.concat(r.ethCallParams)\n }\n return res\n}\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { BigNumberish, Overrides } from \"ethers\";\nimport { HandlerOptions } from \"@sentio/sdk\";\nimport {\n addContractByABI,\n getContractByABI,\n addProcessor,\n getProcessor,\n getProvider,\n transformEtherError,\n BindOptions,\n BaseProcessor,\n BaseProcessorTemplate,\n BoundContractView,\n ContractContext,\n ContractView,\n DummyProvider,\n EthChainId,\n TypedCallTrace,\n EthContext,\n EthFetchConfig,\n PreprocessResult,\n encodeCallData,\n} from \"@sentio/sdk/eth\";\nimport {\n EthCallParam,\n EthCallContext,\n EthCallContextSchema,\n PreparedData,\n} from \"@sentio/protos\";\nimport { create } from \"@bufbuild/protobuf\";\n\nimport { ERC20__factory } from \"./index.js\";\nimport {\n ERC20,\n ApprovalEvent,\n ApprovalEventFilter,\n OwnershipTransferredEvent,\n OwnershipTransferredEventFilter,\n TransferEvent,\n TransferEventFilter,\n} from \"./ERC20.js\";\n\nexport interface AllowanceCallObject {\n owner: string;\n spender: string;\n}\n\nexport type AllowanceCallTrace = TypedCallTrace<\n [string, string],\n AllowanceCallObject\n>;\n\nexport interface ApproveCallObject {\n spender: string;\n amount: bigint;\n}\n\nexport type ApproveCallTrace = TypedCallTrace<\n [string, bigint],\n ApproveCallObject\n>;\n\nexport interface BalanceOfCallObject {\n account: string;\n}\n\nexport type BalanceOfCallTrace = TypedCallTrace<[string], BalanceOfCallObject>;\n\nexport interface BurnCallObject {\n amount: bigint;\n}\n\nexport type BurnCallTrace = TypedCallTrace<[bigint], BurnCallObject>;\n\nexport interface BurnFromCallObject {\n account: string;\n amount: bigint;\n}\n\nexport type BurnFromCallTrace = TypedCallTrace<\n [string, bigint],\n BurnFromCallObject\n>;\n\nexport interface DecimalsCallObject {}\n\nexport type DecimalsCallTrace = TypedCallTrace<[], DecimalsCallObject>;\n\nexport interface DecreaseAllowanceCallObject {\n spender: string;\n subtractedValue: bigint;\n}\n\nexport type DecreaseAllowanceCallTrace = TypedCallTrace<\n [string, bigint],\n DecreaseAllowanceCallObject\n>;\n\nexport interface IncreaseAllowanceCallObject {\n spender: string;\n addedValue: bigint;\n}\n\nexport type IncreaseAllowanceCallTrace = TypedCallTrace<\n [string, bigint],\n IncreaseAllowanceCallObject\n>;\n\nexport interface LockerCallObject {}\n\nexport type LockerCallTrace = TypedCallTrace<[], LockerCallObject>;\n\nexport interface NameCallObject {}\n\nexport type NameCallTrace = TypedCallTrace<[], NameCallObject>;\n\nexport interface OwnerCallObject {}\n\nexport type OwnerCallTrace = TypedCallTrace<[], OwnerCallObject>;\n\nexport interface RenounceOwnershipCallObject {}\n\nexport type RenounceOwnershipCallTrace = TypedCallTrace<\n [],\n RenounceOwnershipCallObject\n>;\n\nexport interface SetLockerCallObject {\n _locker: string;\n}\n\nexport type SetLockerCallTrace = TypedCallTrace<[string], SetLockerCallObject>;\n\nexport interface SymbolCallObject {}\n\nexport type SymbolCallTrace = TypedCallTrace<[], SymbolCallObject>;\n\nexport interface TotalSupplyCallObject {}\n\nexport type TotalSupplyCallTrace = TypedCallTrace<[], TotalSupplyCallObject>;\n\nexport interface TransferCallObject {\n recipient: string;\n amount: bigint;\n}\n\nexport type TransferCallTrace = TypedCallTrace<\n [string, bigint],\n TransferCallObject\n>;\n\nexport interface TransferFromCallObject {\n sender: string;\n recipient: string;\n amount: bigint;\n}\n\nexport type TransferFromCallTrace = TypedCallTrace<\n [string, string, bigint],\n TransferFromCallObject\n>;\n\nexport interface TransferOwnershipCallObject {\n newOwner: string;\n}\n\nexport type TransferOwnershipCallTrace = TypedCallTrace<\n [string],\n TransferOwnershipCallObject\n>;\n\nconst templateContract = ERC20__factory.connect(\"0x0\", DummyProvider);\n\nexport class ERC20ContractView extends ContractView<ERC20> {\n constructor(contract: ERC20) {\n super(contract);\n this.callStatic.contract = contract;\n }\n\n async allowance(\n owner: string,\n spender: string,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<bigint> {\n try {\n return await this.contract.getFunction(\"allowance(address,address)\")(\n owner,\n spender,\n overrides || {},\n );\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async balanceOf(\n account: string,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<bigint> {\n try {\n return await this.contract.getFunction(\"balanceOf(address)\")(\n account,\n overrides || {},\n );\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async decimals(\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<bigint> {\n try {\n return await this.contract.getFunction(\"decimals()\")(overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async locker(\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<string> {\n try {\n return await this.contract.getFunction(\"locker()\")(overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async name(\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<string> {\n try {\n return await this.contract.getFunction(\"name()\")(overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async owner(\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<string> {\n try {\n return await this.contract.getFunction(\"owner()\")(overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async symbol(\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<string> {\n try {\n return await this.contract.getFunction(\"symbol()\")(overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async totalSupply(\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<bigint> {\n try {\n return await this.contract.getFunction(\"totalSupply()\")(overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n callStatic = {\n contract: this.contract,\n\n async approve(\n spender: string,\n amount: BigNumberish,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<boolean> {\n try {\n return await this.contract\n .getFunction(\"approve(address,uint256)\")\n .staticCall(spender, amount, overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n },\n async burn(\n amount: BigNumberish,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<void> {\n try {\n return await this.contract\n .getFunction(\"burn(uint256)\")\n .staticCall(amount, overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n },\n async burnFrom(\n account: string,\n amount: BigNumberish,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<void> {\n try {\n return await this.contract\n .getFunction(\"burnFrom(address,uint256)\")\n .staticCall(account, amount, overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n },\n async decreaseAllowance(\n spender: string,\n subtractedValue: BigNumberish,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<boolean> {\n try {\n return await this.contract\n .getFunction(\"decreaseAllowance(address,uint256)\")\n .staticCall(spender, subtractedValue, overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n },\n async increaseAllowance(\n spender: string,\n addedValue: BigNumberish,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<boolean> {\n try {\n return await this.contract\n .getFunction(\"increaseAllowance(address,uint256)\")\n .staticCall(spender, addedValue, overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n },\n async renounceOwnership(\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<void> {\n try {\n return await this.contract\n .getFunction(\"renounceOwnership()\")\n .staticCall(overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n },\n async setLocker(\n _locker: string,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<void> {\n try {\n return await this.contract\n .getFunction(\"setLocker(address)\")\n .staticCall(_locker, overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n },\n async transfer(\n recipient: string,\n amount: BigNumberish,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<boolean> {\n try {\n return await this.contract\n .getFunction(\"transfer(address,uint256)\")\n .staticCall(recipient, amount, overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n },\n async transferFrom(\n sender: string,\n recipient: string,\n amount: BigNumberish,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<boolean> {\n try {\n return await this.contract\n .getFunction(\"transferFrom(address,address,uint256)\")\n .staticCall(sender, recipient, amount, overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n },\n async transferOwnership(\n newOwner: string,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<void> {\n try {\n return await this.contract\n .getFunction(\"transferOwnership(address)\")\n .staticCall(newOwner, overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n },\n };\n\n encodeCall = {\n allowance(\n owner: string,\n spender: string,\n callContext: EthCallContext,\n ): EthCallParam {\n return encodeCallData(\n callContext,\n \"allowance\",\n \"function allowance(address,address)\",\n [owner, spender],\n );\n },\n approve(\n spender: string,\n amount: BigNumberish,\n callContext: EthCallContext,\n ): EthCallParam {\n return encodeCallData(\n callContext,\n \"approve\",\n \"function approve(address,uint256)\",\n [spender, amount],\n );\n },\n balanceOf(account: string, callContext: EthCallContext): EthCallParam {\n return encodeCallData(\n callContext,\n \"balanceOf\",\n \"function balanceOf(address)\",\n [account],\n );\n },\n burn(amount: BigNumberish, callContext: EthCallContext): EthCallParam {\n return encodeCallData(callContext, \"burn\", \"function burn(uint256)\", [\n amount,\n ]);\n },\n burnFrom(\n account: string,\n amount: BigNumberish,\n callContext: EthCallContext,\n ): EthCallParam {\n return encodeCallData(\n callContext,\n \"burnFrom\",\n \"function burnFrom(address,uint256)\",\n [account, amount],\n );\n },\n decimals(callContext: EthCallContext): EthCallParam {\n return encodeCallData(callContext, \"decimals\", \"function decimals()\", []);\n },\n decreaseAllowance(\n spender: string,\n subtractedValue: BigNumberish,\n callContext: EthCallContext,\n ): EthCallParam {\n return encodeCallData(\n callContext,\n \"decreaseAllowance\",\n \"function decreaseAllowance(address,uint256)\",\n [spender, subtractedValue],\n );\n },\n increaseAllowance(\n spender: string,\n addedValue: BigNumberish,\n callContext: EthCallContext,\n ): EthCallParam {\n return encodeCallData(\n callContext,\n \"increaseAllowance\",\n \"function increaseAllowance(address,uint256)\",\n [spender, addedValue],\n );\n },\n locker(callContext: EthCallContext): EthCallParam {\n return encodeCallData(callContext, \"locker\", \"function locker()\", []);\n },\n name(callContext: EthCallContext): EthCallParam {\n return encodeCallData(callContext, \"name\", \"function name()\", []);\n },\n owner(callContext: EthCallContext): EthCallParam {\n return encodeCallData(callContext, \"owner\", \"function owner()\", []);\n },\n renounceOwnership(callContext: EthCallContext): EthCallParam {\n return encodeCallData(\n callContext,\n \"renounceOwnership\",\n \"function renounceOwnership()\",\n [],\n );\n },\n setLocker(_locker: string, callContext: EthCallContext): EthCallParam {\n return encodeCallData(\n callContext,\n \"setLocker\",\n \"function setLocker(address)\",\n [_locker],\n );\n },\n symbol(callContext: EthCallContext): EthCallParam {\n return encodeCallData(callContext, \"symbol\", \"function symbol()\", []);\n },\n totalSupply(callContext: EthCallContext): EthCallParam {\n return encodeCallData(\n callContext,\n \"totalSupply\",\n \"function totalSupply()\",\n [],\n );\n },\n transfer(\n recipient: string,\n amount: BigNumberish,\n callContext: EthCallContext,\n ): EthCallParam {\n return encodeCallData(\n callContext,\n \"transfer\",\n \"function transfer(address,uint256)\",\n [recipient, amount],\n );\n },\n transferFrom(\n sender: string,\n recipient: string,\n amount: BigNumberish,\n callContext: EthCallContext,\n ): EthCallParam {\n return encodeCallData(\n callContext,\n \"transferFrom\",\n \"function transferFrom(address,address,uint256)\",\n [sender, recipient, amount],\n );\n },\n transferOwnership(\n newOwner: string,\n callContext: EthCallContext,\n ): EthCallParam {\n return encodeCallData(\n callContext,\n \"transferOwnership\",\n \"function transferOwnership(address)\",\n [newOwner],\n );\n },\n };\n}\n\nexport class ERC20BoundContractView extends BoundContractView<\n ERC20,\n ERC20ContractView\n> {\n async allowance(\n owner: string,\n spender: string,\n overrides?: Overrides,\n ): Promise<bigint> {\n return await this.view.allowance(\n owner,\n spender,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async balanceOf(account: string, overrides?: Overrides): Promise<bigint> {\n return await this.view.balanceOf(\n account,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async decimals(overrides?: Overrides): Promise<bigint> {\n return await this.view.decimals(\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async locker(overrides?: Overrides): Promise<string> {\n return await this.view.locker(\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async name(overrides?: Overrides): Promise<string> {\n return await this.view.name(\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async owner(overrides?: Overrides): Promise<string> {\n return await this.view.owner(\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async symbol(overrides?: Overrides): Promise<string> {\n return await this.view.symbol(\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async totalSupply(overrides?: Overrides): Promise<bigint> {\n return await this.view.totalSupply(\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n callStatic = {\n view: this.view,\n context: this.context,\n\n async approve(\n spender: string,\n amount: BigNumberish,\n overrides?: Overrides,\n ): Promise<boolean> {\n return await this.view.callStatic.approve(\n spender,\n amount,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n },\n async burn(amount: BigNumberish, overrides?: Overrides): Promise<void> {\n return await this.view.callStatic.burn(\n amount,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n },\n async burnFrom(\n account: string,\n amount: BigNumberish,\n overrides?: Overrides,\n ): Promise<void> {\n return await this.view.callStatic.burnFrom(\n account,\n amount,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n },\n async decreaseAllowance(\n spender: string,\n subtractedValue: BigNumberish,\n overrides?: Overrides,\n ): Promise<boolean> {\n return await this.view.callStatic.decreaseAllowance(\n spender,\n subtractedValue,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n },\n async increaseAllowance(\n spender: string,\n addedValue: BigNumberish,\n overrides?: Overrides,\n ): Promise<boolean> {\n return await this.view.callStatic.increaseAllowance(\n spender,\n addedValue,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n },\n async renounceOwnership(overrides?: Overrides): Promise<void> {\n return await this.view.callStatic.renounceOwnership(\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n },\n async setLocker(_locker: string, overrides?: Overrides): Promise<void> {\n return await this.view.callStatic.setLocker(\n _locker,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n },\n async transfer(\n recipient: string,\n amount: BigNumberish,\n overrides?: Overrides,\n ): Promise<boolean> {\n return await this.view.callStatic.transfer(\n recipient,\n amount,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n },\n async transferFrom(\n sender: string,\n recipient: string,\n amount: BigNumberish,\n overrides?: Overrides,\n ): Promise<boolean> {\n return await this.view.callStatic.transferFrom(\n sender,\n recipient,\n amount,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n },\n async transferOwnership(\n newOwner: string,\n overrides?: Overrides,\n ): Promise<void> {\n return await this.view.callStatic.transferOwnership(\n newOwner,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n },\n };\n\n encodeCall = {\n view: this.view,\n context: this.context,\n\n allowance(\n owner: string,\n spender: string,\n overrides?: Overrides,\n ): EthCallParam {\n return this.view.encodeCall.allowance(\n owner,\n spender,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n approve(\n spender: string,\n amount: BigNumberish,\n overrides?: Overrides,\n ): EthCallParam {\n return this.view.encodeCall.approve(\n spender,\n amount,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n balanceOf(account: string, overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.balanceOf(\n account,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n burn(amount: BigNumberish, overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.burn(\n amount,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n burnFrom(\n account: string,\n amount: BigNumberish,\n overrides?: Overrides,\n ): EthCallParam {\n return this.view.encodeCall.burnFrom(\n account,\n amount,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n decimals(overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.decimals(\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n decreaseAllowance(\n spender: string,\n subtractedValue: BigNumberish,\n overrides?: Overrides,\n ): EthCallParam {\n return this.view.encodeCall.decreaseAllowance(\n spender,\n subtractedValue,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n increaseAllowance(\n spender: string,\n addedValue: BigNumberish,\n overrides?: Overrides,\n ): EthCallParam {\n return this.view.encodeCall.increaseAllowance(\n spender,\n addedValue,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n locker(overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.locker(\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n name(overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.name(\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n owner(overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.owner(\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n renounceOwnership(overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.renounceOwnership(\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n setLocker(_locker: string, overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.setLocker(\n _locker,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n symbol(overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.symbol(\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n totalSupply(overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.totalSupply(\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n transfer(\n recipient: string,\n amount: BigNumberish,\n overrides?: Overrides,\n ): EthCallParam {\n return this.view.encodeCall.transfer(\n recipient,\n amount,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n transferFrom(\n sender: string,\n recipient: string,\n amount: BigNumberish,\n overrides?: Overrides,\n ): EthCallParam {\n return this.view.encodeCall.transferFrom(\n sender,\n recipient,\n amount,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n transferOwnership(newOwner: string, overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.transferOwnership(\n newOwner,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n };\n}\n\nexport type ERC20Context = ContractContext<ERC20, ERC20BoundContractView>;\n\nexport class ERC20Processor extends BaseProcessor<\n ERC20,\n ERC20BoundContractView\n> {\n onEventApproval(\n handler: (event: ApprovalEvent, ctx: ERC20Context) => void,\n filter?: ApprovalEventFilter | ApprovalEventFilter[],\n handlerOptions?: HandlerOptions<EthFetchConfig, ApprovalEvent>,\n preprocessHandler?: (\n event: ApprovalEvent,\n ctx: ERC20Context,\n preprocessStore: { [k: string]: any },\n ) => Promise<PreprocessResult>,\n ): this {\n if (!filter) {\n filter = templateContract.filters[\"Approval(address,address,uint256)\"](\n null,\n null,\n null,\n );\n }\n return super.onEthEvent(\n handler,\n filter!,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onEventOwnershipTransferred(\n handler: (event: OwnershipTransferredEvent, ctx: ERC20Context) => void,\n filter?:\n | OwnershipTransferredEventFilter\n | OwnershipTransferredEventFilter[],\n handlerOptions?: HandlerOptions<EthFetchConfig, OwnershipTransferredEvent>,\n preprocessHandler?: (\n event: OwnershipTransferredEvent,\n ctx: ERC20Context,\n preprocessStore: { [k: string]: any },\n ) => Promise<PreprocessResult>,\n ): this {\n if (!filter) {\n filter = templateContract.filters[\n \"OwnershipTransferred(address,address)\"\n ](null, null);\n }\n return super.onEthEvent(\n handler,\n filter!,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onEventTransfer(\n handler: (event: TransferEvent, ctx: ERC20Context) => void,\n filter?: TransferEventFilter | TransferEventFilter[],\n handlerOptions?: HandlerOptions<EthFetchConfig, TransferEvent>,\n preprocessHandler?: (\n event: TransferEvent,\n ctx: ERC20Context,\n preprocessStore: { [k: string]: any },\n ) => Promise<PreprocessResult>,\n ): this {\n if (!filter) {\n filter = templateContract.filters[\"Transfer(address,address,uint256)\"](\n null,\n null,\n null,\n );\n }\n return super.onEthEvent(\n handler,\n filter!,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallAllowance(\n handler: (call: AllowanceCallTrace, ctx: ERC20Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, AllowanceCallTrace>,\n preprocessHandler?: (\n call: AllowanceCallTrace,\n ctx: ERC20Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0xdd62ed3e\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallApprove(\n handler: (call: ApproveCallTrace, ctx: ERC20Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, ApproveCallTrace>,\n preprocessHandler?: (\n call: ApproveCallTrace,\n ctx: ERC20Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x095ea7b3\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallBalanceOf(\n handler: (call: BalanceOfCallTrace, ctx: ERC20Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, BalanceOfCallTrace>,\n preprocessHandler?: (\n call: BalanceOfCallTrace,\n ctx: ERC20Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x70a08231\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallBurn(\n handler: (call: BurnCallTrace, ctx: ERC20Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, BurnCallTrace>,\n preprocessHandler?: (\n call: BurnCallTrace,\n ctx: ERC20Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x42966c68\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallBurnFrom(\n handler: (call: BurnFromCallTrace, ctx: ERC20Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, BurnFromCallTrace>,\n preprocessHandler?: (\n call: BurnFromCallTrace,\n ctx: ERC20Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x79cc6790\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallDecimals(\n handler: (call: DecimalsCallTrace, ctx: ERC20Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, DecimalsCallTrace>,\n preprocessHandler?: (\n call: DecimalsCallTrace,\n ctx: ERC20Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x313ce567\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallDecreaseAllowance(\n handler: (call: DecreaseAllowanceCallTrace, ctx: ERC20Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, DecreaseAllowanceCallTrace>,\n preprocessHandler?: (\n call: DecreaseAllowanceCallTrace,\n ctx: ERC20Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0xa457c2d7\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallIncreaseAllowance(\n handler: (call: IncreaseAllowanceCallTrace, ctx: ERC20Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, IncreaseAllowanceCallTrace>,\n preprocessHandler?: (\n call: IncreaseAllowanceCallTrace,\n ctx: ERC20Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x39509351\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallLocker(\n handler: (call: LockerCallTrace, ctx: ERC20Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, LockerCallTrace>,\n preprocessHandler?: (\n call: LockerCallTrace,\n ctx: ERC20Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0xd7b96d4e\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallName(\n handler: (call: NameCallTrace, ctx: ERC20Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, NameCallTrace>,\n preprocessHandler?: (\n call: NameCallTrace,\n ctx: ERC20Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x06fdde03\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallOwner(\n handler: (call: OwnerCallTrace, ctx: ERC20Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, OwnerCallTrace>,\n preprocessHandler?: (\n call: OwnerCallTrace,\n ctx: ERC20Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x8da5cb5b\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallRenounceOwnership(\n handler: (call: RenounceOwnershipCallTrace, ctx: ERC20Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, RenounceOwnershipCallTrace>,\n preprocessHandler?: (\n call: RenounceOwnershipCallTrace,\n ctx: ERC20Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x715018a6\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallSetLocker(\n handler: (call: SetLockerCallTrace, ctx: ERC20Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, SetLockerCallTrace>,\n preprocessHandler?: (\n call: SetLockerCallTrace,\n ctx: ERC20Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x171060ec\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallSymbol(\n handler: (call: SymbolCallTrace, ctx: ERC20Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, SymbolCallTrace>,\n preprocessHandler?: (\n call: SymbolCallTrace,\n ctx: ERC20Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x95d89b41\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallTotalSupply(\n handler: (call: TotalSupplyCallTrace, ctx: ERC20Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, TotalSupplyCallTrace>,\n preprocessHandler?: (\n call: TotalSupplyCallTrace,\n ctx: ERC20Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x18160ddd\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallTransfer(\n handler: (call: TransferCallTrace, ctx: ERC20Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, TransferCallTrace>,\n preprocessHandler?: (\n call: TransferCallTrace,\n ctx: ERC20Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0xa9059cbb\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallTransferFrom(\n handler: (call: TransferFromCallTrace, ctx: ERC20Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, TransferFromCallTrace>,\n preprocessHandler?: (\n call: TransferFromCallTrace,\n ctx: ERC20Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x23b872dd\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallTransferOwnership(\n handler: (call: TransferOwnershipCallTrace, ctx: ERC20Context) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, TransferOwnershipCallTrace>,\n preprocessHandler?: (\n call: TransferOwnershipCallTrace,\n ctx: ERC20Context,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0xf2fde38b\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n public static filters = {\n Approval(\n owner?: string | null,\n spender?: string | null,\n value?: null,\n ): ApprovalEventFilter {\n return templateContract.filters[\"Approval(address,address,uint256)\"](\n owner,\n spender,\n value,\n );\n },\n OwnershipTransferred(\n previousOwner?: string | null,\n newOwner?: string | null,\n ): OwnershipTransferredEventFilter {\n return templateContract.filters[\"OwnershipTransferred(address,address)\"](\n previousOwner,\n newOwner,\n );\n },\n Transfer(\n from?: string | null,\n to?: string | null,\n value?: null,\n ): TransferEventFilter {\n return templateContract.filters[\"Transfer(address,address,uint256)\"](\n from,\n to,\n value,\n );\n },\n };\n\n protected CreateBoundContractView(): ERC20BoundContractView {\n const view = getERC20Contract(this.config.network, this.config.address);\n return new ERC20BoundContractView(this.config.address, view);\n }\n\n public static bind(options: BindOptions): ERC20Processor {\n if (!options.name) {\n options.name = \"ERC20\";\n }\n let processor = getProcessor(options) as ERC20Processor;\n if (!processor) {\n processor = new ERC20Processor(options);\n addProcessor(options, processor);\n }\n return processor;\n }\n}\n\nexport class ERC20ProcessorTemplate extends BaseProcessorTemplate<\n ERC20,\n ERC20BoundContractView,\n ERC20Processor\n> {\n bindInternal(options: BindOptions) {\n if (!options.name) {\n options.name = \"ERC20\";\n }\n let processor = getProcessor(options) as ERC20Processor;\n if (!processor) {\n processor = new ERC20Processor(options);\n addProcessor(options, processor);\n }\n return processor;\n }\n\n onEventApproval(\n handler: (event: ApprovalEvent, ctx: ERC20Context) => void,\n filter?: ApprovalEventFilter | ApprovalEventFilter[],\n handlerOptions?: HandlerOptions<EthFetchConfig, ApprovalEvent>,\n preprocessHandler?: (\n event: ApprovalEvent,\n ctx: ERC20Context,\n preprocessStore: { [k: string]: any },\n ) => Promise<PreprocessResult>,\n ): this {\n if (!filter) {\n filter = templateContract.filters[\"Approval(address,address,uint256)\"](\n null,\n null,\n null,\n );\n }\n return super.onEthEvent(\n handler,\n filter!,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onEventOwnershipTransferred(\n handler: (event: OwnershipTransferredEvent, ctx: ERC20Context) => void,\n filter?:\n | OwnershipTransferredEventFilter\n | OwnershipTransferredEventFilter[],\n handlerOptions?: HandlerOptions<EthFetchConfig, OwnershipTransferredEvent>,\n preprocessHandler?: (\n event: OwnershipTransferredEvent,\n ctx: ERC20Context,\n preprocessStore: { [k: string]: any },\n ) => Promise<PreprocessResult>,\n ): this {\n if (!filter) {\n filter = templateContract.filters[\n \"OwnershipTransferred(address,address)\"\n ](null, null);\n }\n return super.onEthEvent(\n handler,\n filter!,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onEventTransfer(\n handler: (event: TransferEvent, ctx: ERC20Context) => void,\n filter?: TransferEventFilter | TransferEventFilter[],\n handlerOptions?: HandlerOptions<EthFetchConfig, TransferEvent>,\n preprocessHandler?: (\n event: TransferEvent,\n ctx: ERC20Context,\n preprocessStore: { [k: string]: any },\n ) => Promise<PreprocessResult>,\n ): this {\n if (!filter) {\n filter = templateContract.filters[\"Transfer(address,address,uint256)\"](\n null,\n null,\n null,\n );\n }\n return super.onEthEvent(\n handler,\n filter!,\n handlerOptions,\n preprocessHandler,\n );\n }\n}\n\nexport function getERC20Contract(\n chainId: EthChainId,\n address: string,\n): ERC20ContractView {\n let contract = getContractByABI(\n \"ERC20\",\n address,\n chainId,\n ) as ERC20ContractView;\n if (!contract) {\n const rawContract = ERC20__factory.connect(address, getProvider(chainId));\n contract = new ERC20ContractView(rawContract);\n addContractByABI(\"ERC20\", address, chainId, contract);\n }\n return contract;\n}\n\nexport function getERC20ContractOnContext(\n context: EthContext,\n address: string,\n): ERC20BoundContractView {\n const view = getERC20Contract(context.getChainId(), address);\n const boundView = new ERC20BoundContractView(address, view);\n boundView.context = context;\n if (boundView.callStatic) {\n boundView.callStatic.context = context;\n }\n return boundView;\n}\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { LogParams } from \"ethers/providers\";\nimport { EthChainId } from \"@sentio/sdk/eth\";\nimport {\n ApprovalEventObject,\n OwnershipTransferredEventObject,\n TransferEventObject,\n} from \"./ERC20.js\";\nimport { getERC20Contract } from \"./erc20-processor.js\";\nconst mockField = {\n blockHash:\n \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n blockNumber: 0,\n logIndex: 0,\n removed: false,\n transactionHash:\n \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n transactionIndex: 0,\n};\n\nexport function mockApprovalLog(\n contractAddress: string,\n event: ApprovalEventObject,\n): LogParams {\n const contract = getERC20Contract(EthChainId.ETHEREUM, contractAddress);\n const encodedLog = contract.rawContract.interface.encodeEventLog(\n \"Approval(address,address,uint256)\",\n [event.owner, event.spender, event.value],\n );\n return {\n ...mockField,\n index: 0,\n address: contractAddress,\n data: encodedLog.data,\n topics: encodedLog.topics,\n };\n}\n\nexport function mockOwnershipTransferredLog(\n contractAddress: string,\n event: OwnershipTransferredEventObject,\n): LogParams {\n const contract = getERC20Contract(EthChainId.ETHEREUM, contractAddress);\n const encodedLog = contract.rawContract.interface.encodeEventLog(\n \"OwnershipTransferred(address,address)\",\n [event.previousOwner, event.newOwner],\n );\n return {\n ...mockField,\n index: 0,\n address: contractAddress,\n data: encodedLog.data,\n topics: encodedLog.topics,\n };\n}\n\nexport function mockTransferLog(\n contractAddress: string,\n event: TransferEventObject,\n): LogParams {\n const contract = getERC20Contract(EthChainId.ETHEREUM, contractAddress);\n const encodedLog = contract.rawContract.interface.encodeEventLog(\n \"Transfer(address,address,uint256)\",\n [event.from, event.to, event.value],\n );\n return {\n ...mockField,\n index: 0,\n address: contractAddress,\n data: encodedLog.data,\n topics: encodedLog.topics,\n };\n}\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\n\nexport * from \"./internal/erc20-processor.js\";\nexport * from \"./internal/erc20-test-utils.js\";\nexport * from \"./internal/ERC20.js\";\nexport * from \"./internal/factories/ERC20__factory.js\";\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { BigNumberish, Overrides } from \"ethers\";\nimport { HandlerOptions } from \"@sentio/sdk\";\nimport {\n addContractByABI,\n getContractByABI,\n addProcessor,\n getProcessor,\n getProvider,\n transformEtherError,\n BindOptions,\n BaseProcessor,\n BaseProcessorTemplate,\n BoundContractView,\n ContractContext,\n ContractView,\n DummyProvider,\n EthChainId,\n TypedCallTrace,\n EthContext,\n EthFetchConfig,\n PreprocessResult,\n encodeCallData,\n} from \"@sentio/sdk/eth\";\nimport {\n EthCallParam,\n EthCallContext,\n EthCallContextSchema,\n PreparedData,\n} from \"@sentio/protos\";\nimport { create } from \"@bufbuild/protobuf\";\n\nimport { ERC20Bytes__factory } from \"./index.js\";\nimport {\n ERC20Bytes,\n ApprovalEvent,\n ApprovalEventFilter,\n TransferEvent,\n TransferEventFilter,\n} from \"./ERC20Bytes.js\";\n\nexport interface NameCallObject {}\n\nexport type NameCallTrace = TypedCallTrace<[], NameCallObject>;\n\nexport interface ApproveCallObject {\n spender: string;\n value: bigint;\n}\n\nexport type ApproveCallTrace = TypedCallTrace<\n [string, bigint],\n ApproveCallObject\n>;\n\nexport interface TotalSupplyCallObject {}\n\nexport type TotalSupplyCallTrace = TypedCallTrace<[], TotalSupplyCallObject>;\n\nexport interface TransferFromCallObject {\n from: string;\n to: string;\n value: bigint;\n}\n\nexport type TransferFromCallTrace = TypedCallTrace<\n [string, string, bigint],\n TransferFromCallObject\n>;\n\nexport interface DecimalsCallObject {}\n\nexport type DecimalsCallTrace = TypedCallTrace<[], DecimalsCallObject>;\n\nexport interface BalanceOfCallObject {\n who: string;\n}\n\nexport type BalanceOfCallTrace = TypedCallTrace<[string], BalanceOfCallObject>;\n\nexport interface SymbolCallObject {}\n\nexport type SymbolCallTrace = TypedCallTrace<[], SymbolCallObject>;\n\nexport interface TransferCallObject {\n to: string;\n value: bigint;\n}\n\nexport type TransferCallTrace = TypedCallTrace<\n [string, bigint],\n TransferCallObject\n>;\n\nexport interface AllowanceCallObject {\n owner: string;\n spender: string;\n}\n\nexport type AllowanceCallTrace = TypedCallTrace<\n [string, string],\n AllowanceCallObject\n>;\n\nconst templateContract = ERC20Bytes__factory.connect(\"0x0\", DummyProvider);\n\nexport class ERC20BytesContractView extends ContractView<ERC20Bytes> {\n constructor(contract: ERC20Bytes) {\n super(contract);\n this.callStatic.contract = contract;\n }\n\n async name(\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<string> {\n try {\n return await this.contract.getFunction(\"name()\")(overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async totalSupply(\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<bigint> {\n try {\n return await this.contract.getFunction(\"totalSupply()\")(overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async decimals(\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<bigint> {\n try {\n return await this.contract.getFunction(\"decimals()\")(overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async balanceOf(\n who: string,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<bigint> {\n try {\n return await this.contract.getFunction(\"balanceOf(address)\")(\n who,\n overrides || {},\n );\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async symbol(\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<string> {\n try {\n return await this.contract.getFunction(\"symbol()\")(overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async allowance(\n owner: string,\n spender: string,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<bigint> {\n try {\n return await this.contract.getFunction(\"allowance(address,address)\")(\n owner,\n spender,\n overrides || {},\n );\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n callStatic = {\n contract: this.contract,\n\n async approve(\n spender: string,\n value: BigNumberish,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<boolean> {\n try {\n return await this.contract\n .getFunction(\"approve(address,uint256)\")\n .staticCall(spender, value, overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n },\n async transferFrom(\n from: string,\n to: string,\n value: BigNumberish,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<boolean> {\n try {\n return await this.contract\n .getFunction(\"transferFrom(address,address,uint256)\")\n .staticCall(from, to, value, overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n },\n async transfer(\n to: string,\n value: BigNumberish,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<boolean> {\n try {\n return await this.contract\n .getFunction(\"transfer(address,uint256)\")\n .staticCall(to, value, overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n },\n };\n\n encodeCall = {\n name(callContext: EthCallContext): EthCallParam {\n return encodeCallData(callContext, \"name\", \"function name()\", []);\n },\n approve(\n spender: string,\n value: BigNumberish,\n callContext: EthCallContext,\n ): EthCallParam {\n return encodeCallData(\n callContext,\n \"approve\",\n \"function approve(address,uint256)\",\n [spender, value],\n );\n },\n totalSupply(callContext: EthCallContext): EthCallParam {\n return encodeCallData(\n callContext,\n \"totalSupply\",\n \"function totalSupply()\",\n [],\n );\n },\n transferFrom(\n from: string,\n to: string,\n value: BigNumberish,\n callContext: EthCallContext,\n ): EthCallParam {\n return encodeCallData(\n callContext,\n \"transferFrom\",\n \"function transferFrom(address,address,uint256)\",\n [from, to, value],\n );\n },\n decimals(callContext: EthCallContext): EthCallParam {\n return encodeCallData(callContext, \"decimals\", \"function decimals()\", []);\n },\n balanceOf(who: string, callContext: EthCallContext): EthCallParam {\n return encodeCallData(\n callContext,\n \"balanceOf\",\n \"function balanceOf(address)\",\n [who],\n );\n },\n symbol(callContext: EthCallContext): EthCallParam {\n return encodeCallData(callContext, \"symbol\", \"function symbol()\", []);\n },\n transfer(\n to: string,\n value: BigNumberish,\n callContext: EthCallContext,\n ): EthCallParam {\n return encodeCallData(\n callContext,\n \"transfer\",\n \"function transfer(address,uint256)\",\n [to, value],\n );\n },\n allowance(\n owner: string,\n spender: string,\n callContext: EthCallContext,\n ): EthCallParam {\n return encodeCallData(\n callContext,\n \"allowance\",\n \"function allowance(address,address)\",\n [owner, spender],\n );\n },\n };\n}\n\nexport class ERC20BytesBoundContractView extends BoundContractView<\n ERC20Bytes,\n ERC20BytesContractView\n> {\n async name(overrides?: Overrides): Promise<string> {\n return await this.view.name(\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async totalSupply(overrides?: Overrides): Promise<bigint> {\n return await this.view.totalSupply(\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async decimals(overrides?: Overrides): Promise<bigint> {\n return await this.view.decimals(\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async balanceOf(who: string, overrides?: Overrides): Promise<bigint> {\n return await this.view.balanceOf(\n who,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async symbol(overrides?: Overrides): Promise<string> {\n return await this.view.symbol(\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async allowance(\n owner: string,\n spender: string,\n overrides?: Overrides,\n ): Promise<bigint> {\n return await this.view.allowance(\n owner,\n spender,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n callStatic = {\n view: this.view,\n context: this.context,\n\n async approve(\n spender: string,\n value: BigNumberish,\n overrides?: Overrides,\n ): Promise<boolean> {\n return await this.view.callStatic.approve(\n spender,\n value,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n },\n async transferFrom(\n from: string,\n to: string,\n value: BigNumberish,\n overrides?: Overrides,\n ): Promise<boolean> {\n return await this.view.callStatic.transferFrom(\n from,\n to,\n value,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n },\n async transfer(\n to: string,\n value: BigNumberish,\n overrides?: Overrides,\n ): Promise<boolean> {\n return await this.view.callStatic.transfer(\n to,\n value,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n },\n };\n\n encodeCall = {\n view: this.view,\n context: this.context,\n\n name(overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.name(\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n approve(\n spender: string,\n value: BigNumberish,\n overrides?: Overrides,\n ): EthCallParam {\n return this.view.encodeCall.approve(\n spender,\n value,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n totalSupply(overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.totalSupply(\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n transferFrom(\n from: string,\n to: string,\n value: BigNumberish,\n overrides?: Overrides,\n ): EthCallParam {\n return this.view.encodeCall.transferFrom(\n from,\n to,\n value,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n decimals(overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.decimals(\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n balanceOf(who: string, overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.balanceOf(\n who,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n symbol(overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.symbol(\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n transfer(\n to: string,\n value: BigNumberish,\n overrides?: Overrides,\n ): EthCallParam {\n return this.view.encodeCall.transfer(\n to,\n value,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n allowance(\n owner: string,\n spender: string,\n overrides?: Overrides,\n ): EthCallParam {\n return this.view.encodeCall.allowance(\n owner,\n spender,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n };\n}\n\nexport type ERC20BytesContext = ContractContext<\n ERC20Bytes,\n ERC20BytesBoundContractView\n>;\n\nexport class ERC20BytesProcessor extends BaseProcessor<\n ERC20Bytes,\n ERC20BytesBoundContractView\n> {\n onEventApproval(\n handler: (event: ApprovalEvent, ctx: ERC20BytesContext) => void,\n filter?: ApprovalEventFilter | ApprovalEventFilter[],\n handlerOptions?: HandlerOptions<EthFetchConfig, ApprovalEvent>,\n preprocessHandler?: (\n event: ApprovalEvent,\n ctx: ERC20BytesContext,\n preprocessStore: { [k: string]: any },\n ) => Promise<PreprocessResult>,\n ): this {\n if (!filter) {\n filter = templateContract.filters[\"Approval(address,address,uint256)\"](\n null,\n null,\n null,\n );\n }\n return super.onEthEvent(\n handler,\n filter!,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onEventTransfer(\n handler: (event: TransferEvent, ctx: ERC20BytesContext) => void,\n filter?: TransferEventFilter | TransferEventFilter[],\n handlerOptions?: HandlerOptions<EthFetchConfig, TransferEvent>,\n preprocessHandler?: (\n event: TransferEvent,\n ctx: ERC20BytesContext,\n preprocessStore: { [k: string]: any },\n ) => Promise<PreprocessResult>,\n ): this {\n if (!filter) {\n filter = templateContract.filters[\"Transfer(address,address,uint256)\"](\n null,\n null,\n null,\n );\n }\n return super.onEthEvent(\n handler,\n filter!,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallName(\n handler: (call: NameCallTrace, ctx: ERC20BytesContext) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, NameCallTrace>,\n preprocessHandler?: (\n call: NameCallTrace,\n ctx: ERC20BytesContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x06fdde03\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallApprove(\n handler: (call: ApproveCallTrace, ctx: ERC20BytesContext) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, ApproveCallTrace>,\n preprocessHandler?: (\n call: ApproveCallTrace,\n ctx: ERC20BytesContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x095ea7b3\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallTotalSupply(\n handler: (call: TotalSupplyCallTrace, ctx: ERC20BytesContext) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, TotalSupplyCallTrace>,\n preprocessHandler?: (\n call: TotalSupplyCallTrace,\n ctx: ERC20BytesContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x18160ddd\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallTransferFrom(\n handler: (call: TransferFromCallTrace, ctx: ERC20BytesContext) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, TransferFromCallTrace>,\n preprocessHandler?: (\n call: TransferFromCallTrace,\n ctx: ERC20BytesContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x23b872dd\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallDecimals(\n handler: (call: DecimalsCallTrace, ctx: ERC20BytesContext) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, DecimalsCallTrace>,\n preprocessHandler?: (\n call: DecimalsCallTrace,\n ctx: ERC20BytesContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x313ce567\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallBalanceOf(\n handler: (call: BalanceOfCallTrace, ctx: ERC20BytesContext) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, BalanceOfCallTrace>,\n preprocessHandler?: (\n call: BalanceOfCallTrace,\n ctx: ERC20BytesContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x70a08231\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallSymbol(\n handler: (call: SymbolCallTrace, ctx: ERC20BytesContext) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, SymbolCallTrace>,\n preprocessHandler?: (\n call: SymbolCallTrace,\n ctx: ERC20BytesContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x95d89b41\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallTransfer(\n handler: (call: TransferCallTrace, ctx: ERC20BytesContext) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, TransferCallTrace>,\n preprocessHandler?: (\n call: TransferCallTrace,\n ctx: ERC20BytesContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0xa9059cbb\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallAllowance(\n handler: (call: AllowanceCallTrace, ctx: ERC20BytesContext) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, AllowanceCallTrace>,\n preprocessHandler?: (\n call: AllowanceCallTrace,\n ctx: ERC20BytesContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0xdd62ed3e\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n public static filters = {\n Approval(\n owner?: string | null,\n spender?: string | null,\n value?: null,\n ): ApprovalEventFilter {\n return templateContract.filters[\"Approval(address,address,uint256)\"](\n owner,\n spender,\n value,\n );\n },\n Transfer(\n from?: string | null,\n to?: string | null,\n value?: null,\n ): TransferEventFilter {\n return templateContract.filters[\"Transfer(address,address,uint256)\"](\n from,\n to,\n value,\n );\n },\n };\n\n protected CreateBoundContractView(): ERC20BytesBoundContractView {\n const view = getERC20BytesContract(\n this.config.network,\n this.config.address,\n );\n return new ERC20BytesBoundContractView(this.config.address, view);\n }\n\n public static bind(options: BindOptions): ERC20BytesProcessor {\n if (!options.name) {\n options.name = \"ERC20Bytes\";\n }\n let processor = getProcessor(options) as ERC20BytesProcessor;\n if (!processor) {\n processor = new ERC20BytesProcessor(options);\n addProcessor(options, processor);\n }\n return processor;\n }\n}\n\nexport class ERC20BytesProcessorTemplate extends BaseProcessorTemplate<\n ERC20Bytes,\n ERC20BytesBoundContractView,\n ERC20BytesProcessor\n> {\n bindInternal(options: BindOptions) {\n if (!options.name) {\n options.name = \"ERC20Bytes\";\n }\n let processor = getProcessor(options) as ERC20BytesProcessor;\n if (!processor) {\n processor = new ERC20BytesProcessor(options);\n addProcessor(options, processor);\n }\n return processor;\n }\n\n onEventApproval(\n handler: (event: ApprovalEvent, ctx: ERC20BytesContext) => void,\n filter?: ApprovalEventFilter | ApprovalEventFilter[],\n handlerOptions?: HandlerOptions<EthFetchConfig, ApprovalEvent>,\n preprocessHandler?: (\n event: ApprovalEvent,\n ctx: ERC20BytesContext,\n preprocessStore: { [k: string]: any },\n ) => Promise<PreprocessResult>,\n ): this {\n if (!filter) {\n filter = templateContract.filters[\"Approval(address,address,uint256)\"](\n null,\n null,\n null,\n );\n }\n return super.onEthEvent(\n handler,\n filter!,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onEventTransfer(\n handler: (event: TransferEvent, ctx: ERC20BytesContext) => void,\n filter?: TransferEventFilter | TransferEventFilter[],\n handlerOptions?: HandlerOptions<EthFetchConfig, TransferEvent>,\n preprocessHandler?: (\n event: TransferEvent,\n ctx: ERC20BytesContext,\n preprocessStore: { [k: string]: any },\n ) => Promise<PreprocessResult>,\n ): this {\n if (!filter) {\n filter = templateContract.filters[\"Transfer(address,address,uint256)\"](\n null,\n null,\n null,\n );\n }\n return super.onEthEvent(\n handler,\n filter!,\n handlerOptions,\n preprocessHandler,\n );\n }\n}\n\nexport function getERC20BytesContract(\n chainId: EthChainId,\n address: string,\n): ERC20BytesContractView {\n let contract = getContractByABI(\n \"ERC20Bytes\",\n address,\n chainId,\n ) as ERC20BytesContractView;\n if (!contract) {\n const rawContract = ERC20Bytes__factory.connect(\n address,\n getProvider(chainId),\n );\n contract = new ERC20BytesContractView(rawContract);\n addContractByABI(\"ERC20Bytes\", address, chainId, contract);\n }\n return contract;\n}\n\nexport function getERC20BytesContractOnContext(\n context: EthContext,\n address: string,\n): ERC20BytesBoundContractView {\n const view = getERC20BytesContract(context.getChainId(), address);\n const boundView = new ERC20BytesBoundContractView(address, view);\n boundView.context = context;\n if (boundView.callStatic) {\n boundView.callStatic.context = context;\n }\n return boundView;\n}\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { LogParams } from \"ethers/providers\";\nimport { EthChainId } from \"@sentio/sdk/eth\";\nimport { ApprovalEventObject, TransferEventObject } from \"./ERC20Bytes.js\";\nimport { getERC20BytesContract } from \"./erc20bytes-processor.js\";\nconst mockField = {\n blockHash:\n \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n blockNumber: 0,\n logIndex: 0,\n removed: false,\n transactionHash:\n \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n transactionIndex: 0,\n};\n\nexport function mockApprovalLog(\n contractAddress: string,\n event: ApprovalEventObject,\n): LogParams {\n const contract = getERC20BytesContract(EthChainId.ETHEREUM, contractAddress);\n const encodedLog = contract.rawContract.interface.encodeEventLog(\n \"Approval(address,address,uint256)\",\n [event.owner, event.spender, event.value],\n );\n return {\n ...mockField,\n index: 0,\n address: contractAddress,\n data: encodedLog.data,\n topics: encodedLog.topics,\n };\n}\n\nexport function mockTransferLog(\n contractAddress: string,\n event: TransferEventObject,\n): LogParams {\n const contract = getERC20BytesContract(EthChainId.ETHEREUM, contractAddress);\n const encodedLog = contract.rawContract.interface.encodeEventLog(\n \"Transfer(address,address,uint256)\",\n [event.from, event.to, event.value],\n );\n return {\n ...mockField,\n index: 0,\n address: contractAddress,\n data: encodedLog.data,\n topics: encodedLog.topics,\n };\n}\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\n\nexport * from \"./internal/erc20bytes-processor.js\";\nexport * from \"./internal/erc20bytes-test-utils.js\";\nexport * from \"./internal/ERC20Bytes.js\";\nexport * from \"./internal/factories/ERC20Bytes__factory.js\";\n","import { getERC20Contract } from '../eth/builtin/erc20.js'\nimport { getERC20BytesContract } from '../eth/builtin/erc20bytes.js'\nimport { BigDecimal, scaleDown } from '../core/big-decimal.js'\nimport { PromiseOrValue } from '../eth/builtin/internal/common.js'\nimport { decodeBytes32String } from 'ethers'\nimport { EthChainId, EthContext } from '../eth/index.js'\nimport { BaseContext } from '../core/index.js'\nimport { LRUCache } from 'lru-cache'\n\nexport interface TokenInfo {\n symbol: string\n name: string\n decimal: number\n}\n\nexport const NATIVE_ETH = {\n symbol: 'ETH',\n decimal: 18,\n name: 'Native ETH'\n}\n\nconst TOKEN_INFOS = new LRUCache<string, Promise<TokenInfo>>({\n max: 10000,\n ttl: 1000 * 60 * 60 // 1 hour\n})\n\nasync function getTokenInfoPromise(\n symbol: PromiseOrValue<string> | string,\n name: PromiseOrValue<string> | string,\n decimal: PromiseOrValue<bigint>\n): Promise<TokenInfo> {\n return {\n symbol: await symbol,\n name: await name,\n decimal: Number(await decimal)\n }\n}\n\nexport async function getERC20TokenInfo(\n contextOrNetworkish: EthContext | EthChainId,\n tokenAddress: string\n): Promise<TokenInfo> {\n let chainId: EthChainId\n if (contextOrNetworkish instanceof BaseContext) {\n chainId = contextOrNetworkish.getChainId()\n } else {\n chainId = contextOrNetworkish || EthChainId.ETHEREUM\n }\n\n const key = chainId + tokenAddress\n const res = TOKEN_INFOS.get(key)\n if (res) {\n return res\n }\n const contract = getERC20Contract(chainId, tokenAddress)\n const bytesContract = getERC20BytesContract(chainId, tokenAddress)\n\n let name = ''\n try {\n name = await contract.name()\n } catch (e) {\n name = decodeBytes32String(await bytesContract.name())\n }\n\n let symbol = ''\n try {\n symbol = await contract.symbol()\n } catch (e) {\n symbol = decodeBytes32String(await bytesContract.symbol())\n }\n\n const decimal = await contract.decimals()\n const info = getTokenInfoPromise(symbol, name, decimal)\n\n TOKEN_INFOS.set(key, info)\n return info\n}\n\nexport async function getER20NormalizedAmount(\n contextOrNetworkish: EthContext | EthChainId,\n tokenAddress: string,\n amount: bigint\n): Promise<BigDecimal> {\n const tokenInfo = await getERC20TokenInfo(contextOrNetworkish, tokenAddress)\n return scaleDown(amount, tokenInfo.decimal)\n}\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { BigNumberish, Overrides } from \"ethers\";\nimport { HandlerOptions } from \"@sentio/sdk\";\nimport {\n addContractByABI,\n getContractByABI,\n addProcessor,\n getProcessor,\n getProvider,\n transformEtherError,\n BindOptions,\n BaseProcessor,\n BaseProcessorTemplate,\n BoundContractView,\n ContractContext,\n ContractView,\n DummyProvider,\n EthChainId,\n TypedCallTrace,\n EthContext,\n EthFetchConfig,\n PreprocessResult,\n encodeCallData,\n} from \"@sentio/sdk/eth\";\nimport {\n EthCallParam,\n EthCallContext,\n EthCallContextSchema,\n PreparedData,\n} from \"@sentio/protos\";\nimport { create } from \"@bufbuild/protobuf\";\n\nimport { EACAggregatorProxy__factory } from \"./index.js\";\nimport {\n EACAggregatorProxy,\n AnswerUpdatedEvent,\n AnswerUpdatedEventFilter,\n NewRoundEvent,\n NewRoundEventFilter,\n OwnershipTransferRequestedEvent,\n OwnershipTransferRequestedEventFilter,\n OwnershipTransferredEvent,\n OwnershipTransferredEventFilter,\n} from \"./EACAggregatorProxy.js\";\n\nexport interface AcceptOwnershipCallObject {}\n\nexport type AcceptOwnershipCallTrace = TypedCallTrace<\n [],\n AcceptOwnershipCallObject\n>;\n\nexport interface AccessControllerCallObject {}\n\nexport type AccessControllerCallTrace = TypedCallTrace<\n [],\n AccessControllerCallObject\n>;\n\nexport interface AggregatorCallObject {}\n\nexport type AggregatorCallTrace = TypedCallTrace<[], AggregatorCallObject>;\n\nexport interface ConfirmAggregatorCallObject {\n _aggregator: string;\n}\n\nexport type ConfirmAggregatorCallTrace = TypedCallTrace<\n [string],\n ConfirmAggregatorCallObject\n>;\n\nexport interface DecimalsCallObject {}\n\nexport type DecimalsCallTrace = TypedCallTrace<[], DecimalsCallObject>;\n\nexport interface DescriptionCallObject {}\n\nexport type DescriptionCallTrace = TypedCallTrace<[], DescriptionCallObject>;\n\nexport interface GetAnswerCallObject {\n _roundId: bigint;\n}\n\nexport type GetAnswerCallTrace = TypedCallTrace<[bigint], GetAnswerCallObject>;\n\nexport interface GetRoundDataCallObject {\n _roundId: bigint;\n}\n\nexport type GetRoundDataCallTrace = TypedCallTrace<\n [bigint],\n GetRoundDataCallObject\n>;\n\nexport interface GetTimestampCallObject {\n _roundId: bigint;\n}\n\nexport type GetTimestampCallTrace = TypedCallTrace<\n [bigint],\n GetTimestampCallObject\n>;\n\nexport interface LatestAnswerCallObject {}\n\nexport type LatestAnswerCallTrace = TypedCallTrace<[], LatestAnswerCallObject>;\n\nexport interface LatestRoundCallObject {}\n\nexport type LatestRoundCallTrace = TypedCallTrace<[], LatestRoundCallObject>;\n\nexport interface LatestRoundDataCallObject {}\n\nexport type LatestRoundDataCallTrace = TypedCallTrace<\n [],\n LatestRoundDataCallObject\n>;\n\nexport interface LatestTimestampCallObject {}\n\nexport type LatestTimestampCallTrace = TypedCallTrace<\n [],\n LatestTimestampCallObject\n>;\n\nexport interface OwnerCallObject {}\n\nexport type OwnerCallTrace = TypedCallTrace<[], OwnerCallObject>;\n\nexport interface PhaseAggregatorsCallObject {}\n\nexport type PhaseAggregatorsCallTrace = TypedCallTrace<\n [bigint],\n PhaseAggregatorsCallObject\n>;\n\nexport interface PhaseIdCallObject {}\n\nexport type PhaseIdCallTrace = TypedCallTrace<[], PhaseIdCallObject>;\n\nexport interface ProposeAggregatorCallObject {\n _aggregator: string;\n}\n\nexport type ProposeAggregatorCallTrace = TypedCallTrace<\n [string],\n ProposeAggregatorCallObject\n>;\n\nexport interface ProposedAggregatorCallObject {}\n\nexport type ProposedAggregatorCallTrace = TypedCallTrace<\n [],\n ProposedAggregatorCallObject\n>;\n\nexport interface ProposedGetRoundDataCallObject {\n _roundId: bigint;\n}\n\nexport type ProposedGetRoundDataCallTrace = TypedCallTrace<\n [bigint],\n ProposedGetRoundDataCallObject\n>;\n\nexport interface ProposedLatestRoundDataCallObject {}\n\nexport type ProposedLatestRoundDataCallTrace = TypedCallTrace<\n [],\n ProposedLatestRoundDataCallObject\n>;\n\nexport interface SetControllerCallObject {\n _accessController: string;\n}\n\nexport type SetControllerCallTrace = TypedCallTrace<\n [string],\n SetControllerCallObject\n>;\n\nexport interface TransferOwnershipCallObject {\n _to: string;\n}\n\nexport type TransferOwnershipCallTrace = TypedCallTrace<\n [string],\n TransferOwnershipCallObject\n>;\n\nexport interface VersionCallObject {}\n\nexport type VersionCallTrace = TypedCallTrace<[], VersionCallObject>;\n\nconst templateContract = EACAggregatorProxy__factory.connect(\n \"0x0\",\n DummyProvider,\n);\n\nexport class EACAggregatorProxyContractView extends ContractView<EACAggregatorProxy> {\n constructor(contract: EACAggregatorProxy) {\n super(contract);\n this.callStatic.contract = contract;\n }\n\n async accessController(\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<string> {\n try {\n return await this.contract.getFunction(\"accessController()\")(\n overrides || {},\n );\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async aggregator(\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<string> {\n try {\n return await this.contract.getFunction(\"aggregator()\")(overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async decimals(\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<bigint> {\n try {\n return await this.contract.getFunction(\"decimals()\")(overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async description(\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<string> {\n try {\n return await this.contract.getFunction(\"description()\")(overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async getAnswer(\n _roundId: BigNumberish,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<bigint> {\n try {\n return await this.contract.getFunction(\"getAnswer(uint256)\")(\n _roundId,\n overrides || {},\n );\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async getRoundData(\n _roundId: BigNumberish,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<\n [bigint, bigint, bigint, bigint, bigint] & {\n roundId: bigint;\n answer: bigint;\n startedAt: bigint;\n updatedAt: bigint;\n answeredInRound: bigint;\n }\n > {\n try {\n return await this.contract.getFunction(\"getRoundData(uint80)\")(\n _roundId,\n overrides || {},\n );\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async getTimestamp(\n _roundId: BigNumberish,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<bigint> {\n try {\n return await this.contract.getFunction(\"getTimestamp(uint256)\")(\n _roundId,\n overrides || {},\n );\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async latestAnswer(\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<bigint> {\n try {\n return await this.contract.getFunction(\"latestAnswer()\")(overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async latestRound(\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<bigint> {\n try {\n return await this.contract.getFunction(\"latestRound()\")(overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async latestRoundData(\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<\n [bigint, bigint, bigint, bigint, bigint] & {\n roundId: bigint;\n answer: bigint;\n startedAt: bigint;\n updatedAt: bigint;\n answeredInRound: bigint;\n }\n > {\n try {\n return await this.contract.getFunction(\"latestRoundData()\")(\n overrides || {},\n );\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async latestTimestamp(\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<bigint> {\n try {\n return await this.contract.getFunction(\"latestTimestamp()\")(\n overrides || {},\n );\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async owner(\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<string> {\n try {\n return await this.contract.getFunction(\"owner()\")(overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async phaseAggregators(\n arg0: BigNumberish,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<string> {\n try {\n return await this.contract.getFunction(\"phaseAggregators(uint16)\")(\n arg0,\n overrides || {},\n );\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async phaseId(\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<bigint> {\n try {\n return await this.contract.getFunction(\"phaseId()\")(overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async proposedAggregator(\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<string> {\n try {\n return await this.contract.getFunction(\"proposedAggregator()\")(\n overrides || {},\n );\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async proposedGetRoundData(\n _roundId: BigNumberish,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<\n [bigint, bigint, bigint, bigint, bigint] & {\n roundId: bigint;\n answer: bigint;\n startedAt: bigint;\n updatedAt: bigint;\n answeredInRound: bigint;\n }\n > {\n try {\n return await this.contract.getFunction(\"proposedGetRoundData(uint80)\")(\n _roundId,\n overrides || {},\n );\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async proposedLatestRoundData(\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<\n [bigint, bigint, bigint, bigint, bigint] & {\n roundId: bigint;\n answer: bigint;\n startedAt: bigint;\n updatedAt: bigint;\n answeredInRound: bigint;\n }\n > {\n try {\n return await this.contract.getFunction(\"proposedLatestRoundData()\")(\n overrides || {},\n );\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n async version(\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<bigint> {\n try {\n return await this.contract.getFunction(\"version()\")(overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n }\n\n callStatic = {\n contract: this.contract,\n\n async acceptOwnership(\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<void> {\n try {\n return await this.contract\n .getFunction(\"acceptOwnership()\")\n .staticCall(overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n },\n async confirmAggregator(\n _aggregator: string,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<void> {\n try {\n return await this.contract\n .getFunction(\"confirmAggregator(address)\")\n .staticCall(_aggregator, overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n },\n async proposeAggregator(\n _aggregator: string,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<void> {\n try {\n return await this.contract\n .getFunction(\"proposeAggregator(address)\")\n .staticCall(_aggregator, overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n },\n async setController(\n _accessController: string,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<void> {\n try {\n return await this.contract\n .getFunction(\"setController(address)\")\n .staticCall(_accessController, overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n },\n async transferOwnership(\n _to: string,\n overrides?: Overrides,\n preparedData?: PreparedData,\n ethCallContext?: EthCallContext,\n ): Promise<void> {\n try {\n return await this.contract\n .getFunction(\"transferOwnership(address)\")\n .staticCall(_to, overrides || {});\n } catch (e) {\n const stack = new Error().stack;\n throw transformEtherError(e, undefined, stack);\n }\n },\n };\n\n encodeCall = {\n acceptOwnership(callContext: EthCallContext): EthCallParam {\n return encodeCallData(\n callContext,\n \"acceptOwnership\",\n \"function acceptOwnership()\",\n [],\n );\n },\n accessController(callContext: EthCallContext): EthCallParam {\n return encodeCallData(\n callContext,\n \"accessController\",\n \"function accessController()\",\n [],\n );\n },\n aggregator(callContext: EthCallContext): EthCallParam {\n return encodeCallData(\n callContext,\n \"aggregator\",\n \"function aggregator()\",\n [],\n );\n },\n confirmAggregator(\n _aggregator: string,\n callContext: EthCallContext,\n ): EthCallParam {\n return encodeCallData(\n callContext,\n \"confirmAggregator\",\n \"function confirmAggregator(address)\",\n [_aggregator],\n );\n },\n decimals(callContext: EthCallContext): EthCallParam {\n return encodeCallData(callContext, \"decimals\", \"function decimals()\", []);\n },\n description(callContext: EthCallContext): EthCallParam {\n return encodeCallData(\n callContext,\n \"description\",\n \"function description()\",\n [],\n );\n },\n getAnswer(\n _roundId: BigNumberish,\n callContext: EthCallContext,\n ): EthCallParam {\n return encodeCallData(\n callContext,\n \"getAnswer\",\n \"function getAnswer(uint256)\",\n [_roundId],\n );\n },\n getRoundData(\n _roundId: BigNumberish,\n callContext: EthCallContext,\n ): EthCallParam {\n return encodeCallData(\n callContext,\n \"getRoundData\",\n \"function getRoundData(uint80)\",\n [_roundId],\n );\n },\n getTimestamp(\n _roundId: BigNumberish,\n callContext: EthCallContext,\n ): EthCallParam {\n return encodeCallData(\n callContext,\n \"getTimestamp\",\n \"function getTimestamp(uint256)\",\n [_roundId],\n );\n },\n latestAnswer(callContext: EthCallContext): EthCallParam {\n return encodeCallData(\n callContext,\n \"latestAnswer\",\n \"function latestAnswer()\",\n [],\n );\n },\n latestRound(callContext: EthCallContext): EthCallParam {\n return encodeCallData(\n callContext,\n \"latestRound\",\n \"function latestRound()\",\n [],\n );\n },\n latestRoundData(callContext: EthCallContext): EthCallParam {\n return encodeCallData(\n callContext,\n \"latestRoundData\",\n \"function latestRoundData()\",\n [],\n );\n },\n latestTimestamp(callContext: EthCallContext): EthCallParam {\n return encodeCallData(\n callContext,\n \"latestTimestamp\",\n \"function latestTimestamp()\",\n [],\n );\n },\n owner(callContext: EthCallContext): EthCallParam {\n return encodeCallData(callContext, \"owner\", \"function owner()\", []);\n },\n phaseAggregators(\n arg0: BigNumberish,\n callContext: EthCallContext,\n ): EthCallParam {\n return encodeCallData(\n callContext,\n \"phaseAggregators\",\n \"function phaseAggregators(uint16)\",\n [arg0],\n );\n },\n phaseId(callContext: EthCallContext): EthCallParam {\n return encodeCallData(callContext, \"phaseId\", \"function phaseId()\", []);\n },\n proposeAggregator(\n _aggregator: string,\n callContext: EthCallContext,\n ): EthCallParam {\n return encodeCallData(\n callContext,\n \"proposeAggregator\",\n \"function proposeAggregator(address)\",\n [_aggregator],\n );\n },\n proposedAggregator(callContext: EthCallContext): EthCallParam {\n return encodeCallData(\n callContext,\n \"proposedAggregator\",\n \"function proposedAggregator()\",\n [],\n );\n },\n proposedGetRoundData(\n _roundId: BigNumberish,\n callContext: EthCallContext,\n ): EthCallParam {\n return encodeCallData(\n callContext,\n \"proposedGetRoundData\",\n \"function proposedGetRoundData(uint80)\",\n [_roundId],\n );\n },\n proposedLatestRoundData(callContext: EthCallContext): EthCallParam {\n return encodeCallData(\n callContext,\n \"proposedLatestRoundData\",\n \"function proposedLatestRoundData()\",\n [],\n );\n },\n setController(\n _accessController: string,\n callContext: EthCallContext,\n ): EthCallParam {\n return encodeCallData(\n callContext,\n \"setController\",\n \"function setController(address)\",\n [_accessController],\n );\n },\n transferOwnership(_to: string, callContext: EthCallContext): EthCallParam {\n return encodeCallData(\n callContext,\n \"transferOwnership\",\n \"function transferOwnership(address)\",\n [_to],\n );\n },\n version(callContext: EthCallContext): EthCallParam {\n return encodeCallData(callContext, \"version\", \"function version()\", []);\n },\n };\n}\n\nexport class EACAggregatorProxyBoundContractView extends BoundContractView<\n EACAggregatorProxy,\n EACAggregatorProxyContractView\n> {\n async accessController(overrides?: Overrides): Promise<string> {\n return await this.view.accessController(\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async aggregator(overrides?: Overrides): Promise<string> {\n return await this.view.aggregator(\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async decimals(overrides?: Overrides): Promise<bigint> {\n return await this.view.decimals(\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async description(overrides?: Overrides): Promise<string> {\n return await this.view.description(\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async getAnswer(\n _roundId: BigNumberish,\n overrides?: Overrides,\n ): Promise<bigint> {\n return await this.view.getAnswer(\n _roundId,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async getRoundData(\n _roundId: BigNumberish,\n overrides?: Overrides,\n ): Promise<\n [bigint, bigint, bigint, bigint, bigint] & {\n roundId: bigint;\n answer: bigint;\n startedAt: bigint;\n updatedAt: bigint;\n answeredInRound: bigint;\n }\n > {\n return await this.view.getRoundData(\n _roundId,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async getTimestamp(\n _roundId: BigNumberish,\n overrides?: Overrides,\n ): Promise<bigint> {\n return await this.view.getTimestamp(\n _roundId,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async latestAnswer(overrides?: Overrides): Promise<bigint> {\n return await this.view.latestAnswer(\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async latestRound(overrides?: Overrides): Promise<bigint> {\n return await this.view.latestRound(\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async latestRoundData(\n overrides?: Overrides,\n ): Promise<\n [bigint, bigint, bigint, bigint, bigint] & {\n roundId: bigint;\n answer: bigint;\n startedAt: bigint;\n updatedAt: bigint;\n answeredInRound: bigint;\n }\n > {\n return await this.view.latestRoundData(\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async latestTimestamp(overrides?: Overrides): Promise<bigint> {\n return await this.view.latestTimestamp(\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async owner(overrides?: Overrides): Promise<string> {\n return await this.view.owner(\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async phaseAggregators(\n arg0: BigNumberish,\n overrides?: Overrides,\n ): Promise<string> {\n return await this.view.phaseAggregators(\n arg0,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async phaseId(overrides?: Overrides): Promise<bigint> {\n return await this.view.phaseId(\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async proposedAggregator(overrides?: Overrides): Promise<string> {\n return await this.view.proposedAggregator(\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async proposedGetRoundData(\n _roundId: BigNumberish,\n overrides?: Overrides,\n ): Promise<\n [bigint, bigint, bigint, bigint, bigint] & {\n roundId: bigint;\n answer: bigint;\n startedAt: bigint;\n updatedAt: bigint;\n answeredInRound: bigint;\n }\n > {\n return await this.view.proposedGetRoundData(\n _roundId,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async proposedLatestRoundData(\n overrides?: Overrides,\n ): Promise<\n [bigint, bigint, bigint, bigint, bigint] & {\n roundId: bigint;\n answer: bigint;\n startedAt: bigint;\n updatedAt: bigint;\n answeredInRound: bigint;\n }\n > {\n return await this.view.proposedLatestRoundData(\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n async version(overrides?: Overrides): Promise<bigint> {\n return await this.view.version(\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n }\n\n callStatic = {\n view: this.view,\n context: this.context,\n\n async acceptOwnership(overrides?: Overrides): Promise<void> {\n return await this.view.callStatic.acceptOwnership(\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n },\n async confirmAggregator(\n _aggregator: string,\n overrides?: Overrides,\n ): Promise<void> {\n return await this.view.callStatic.confirmAggregator(\n _aggregator,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n },\n async proposeAggregator(\n _aggregator: string,\n overrides?: Overrides,\n ): Promise<void> {\n return await this.view.callStatic.proposeAggregator(\n _aggregator,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n },\n async setController(\n _accessController: string,\n overrides?: Overrides,\n ): Promise<void> {\n return await this.view.callStatic.setController(\n _accessController,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n },\n async transferOwnership(_to: string, overrides?: Overrides): Promise<void> {\n return await this.view.callStatic.transferOwnership(\n _to,\n {\n blockTag: this.context.blockNumber,\n ...overrides,\n },\n this.context.preparedData,\n this.context.getEthCallContext(),\n );\n },\n };\n\n encodeCall = {\n view: this.view,\n context: this.context,\n\n acceptOwnership(overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.acceptOwnership(\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n accessController(overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.accessController(\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n aggregator(overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.aggregator(\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n confirmAggregator(\n _aggregator: string,\n overrides?: Overrides,\n ): EthCallParam {\n return this.view.encodeCall.confirmAggregator(\n _aggregator,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n decimals(overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.decimals(\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n description(overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.description(\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n getAnswer(_roundId: BigNumberish, overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.getAnswer(\n _roundId,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n getRoundData(_roundId: BigNumberish, overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.getRoundData(\n _roundId,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n getTimestamp(_roundId: BigNumberish, overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.getTimestamp(\n _roundId,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n latestAnswer(overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.latestAnswer(\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n latestRound(overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.latestRound(\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n latestRoundData(overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.latestRoundData(\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n latestTimestamp(overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.latestTimestamp(\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n owner(overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.owner(\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n phaseAggregators(arg0: BigNumberish, overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.phaseAggregators(\n arg0,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n phaseId(overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.phaseId(\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n proposeAggregator(\n _aggregator: string,\n overrides?: Overrides,\n ): EthCallParam {\n return this.view.encodeCall.proposeAggregator(\n _aggregator,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n proposedAggregator(overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.proposedAggregator(\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n proposedGetRoundData(\n _roundId: BigNumberish,\n overrides?: Overrides,\n ): EthCallParam {\n return this.view.encodeCall.proposedGetRoundData(\n _roundId,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n proposedLatestRoundData(overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.proposedLatestRoundData(\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n setController(\n _accessController: string,\n overrides?: Overrides,\n ): EthCallParam {\n return this.view.encodeCall.setController(\n _accessController,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n transferOwnership(_to: string, overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.transferOwnership(\n _to,\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n version(overrides?: Overrides): EthCallParam {\n return this.view.encodeCall.version(\n create(EthCallContextSchema, {\n chainId: this.context.chainId.toString(),\n address: this.context.address,\n blockTag: this.context.getBlockTag(overrides),\n }),\n );\n },\n };\n}\n\nexport type EACAggregatorProxyContext = ContractContext<\n EACAggregatorProxy,\n EACAggregatorProxyBoundContractView\n>;\n\nexport class EACAggregatorProxyProcessor extends BaseProcessor<\n EACAggregatorProxy,\n EACAggregatorProxyBoundContractView\n> {\n onEventAnswerUpdated(\n handler: (\n event: AnswerUpdatedEvent,\n ctx: EACAggregatorProxyContext,\n ) => void,\n filter?: AnswerUpdatedEventFilter | AnswerUpdatedEventFilter[],\n handlerOptions?: HandlerOptions<EthFetchConfig, AnswerUpdatedEvent>,\n preprocessHandler?: (\n event: AnswerUpdatedEvent,\n ctx: EACAggregatorProxyContext,\n preprocessStore: { [k: string]: any },\n ) => Promise<PreprocessResult>,\n ): this {\n if (!filter) {\n filter = templateContract.filters[\n \"AnswerUpdated(int256,uint256,uint256)\"\n ](null, null, null);\n }\n return super.onEthEvent(\n handler,\n filter!,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onEventNewRound(\n handler: (event: NewRoundEvent, ctx: EACAggregatorProxyContext) => void,\n filter?: NewRoundEventFilter | NewRoundEventFilter[],\n handlerOptions?: HandlerOptions<EthFetchConfig, NewRoundEvent>,\n preprocessHandler?: (\n event: NewRoundEvent,\n ctx: EACAggregatorProxyContext,\n preprocessStore: { [k: string]: any },\n ) => Promise<PreprocessResult>,\n ): this {\n if (!filter) {\n filter = templateContract.filters[\"NewRound(uint256,address,uint256)\"](\n null,\n null,\n null,\n );\n }\n return super.onEthEvent(\n handler,\n filter!,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onEventOwnershipTransferRequested(\n handler: (\n event: OwnershipTransferRequestedEvent,\n ctx: EACAggregatorProxyContext,\n ) => void,\n filter?:\n | OwnershipTransferRequestedEventFilter\n | OwnershipTransferRequestedEventFilter[],\n handlerOptions?: HandlerOptions<\n EthFetchConfig,\n OwnershipTransferRequestedEvent\n >,\n preprocessHandler?: (\n event: OwnershipTransferRequestedEvent,\n ctx: EACAggregatorProxyContext,\n preprocessStore: { [k: string]: any },\n ) => Promise<PreprocessResult>,\n ): this {\n if (!filter) {\n filter = templateContract.filters[\n \"OwnershipTransferRequested(address,address)\"\n ](null, null);\n }\n return super.onEthEvent(\n handler,\n filter!,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onEventOwnershipTransferred(\n handler: (\n event: OwnershipTransferredEvent,\n ctx: EACAggregatorProxyContext,\n ) => void,\n filter?:\n | OwnershipTransferredEventFilter\n | OwnershipTransferredEventFilter[],\n handlerOptions?: HandlerOptions<EthFetchConfig, OwnershipTransferredEvent>,\n preprocessHandler?: (\n event: OwnershipTransferredEvent,\n ctx: EACAggregatorProxyContext,\n preprocessStore: { [k: string]: any },\n ) => Promise<PreprocessResult>,\n ): this {\n if (!filter) {\n filter = templateContract.filters[\n \"OwnershipTransferred(address,address)\"\n ](null, null);\n }\n return super.onEthEvent(\n handler,\n filter!,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallAcceptOwnership(\n handler: (\n call: AcceptOwnershipCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, AcceptOwnershipCallTrace>,\n preprocessHandler?: (\n call: AcceptOwnershipCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x79ba5097\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallAccessController(\n handler: (\n call: AccessControllerCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, AccessControllerCallTrace>,\n preprocessHandler?: (\n call: AccessControllerCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0xbc43cbaf\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallAggregator(\n handler: (\n call: AggregatorCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, AggregatorCallTrace>,\n preprocessHandler?: (\n call: AggregatorCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x245a7bfc\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallConfirmAggregator(\n handler: (\n call: ConfirmAggregatorCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, ConfirmAggregatorCallTrace>,\n preprocessHandler?: (\n call: ConfirmAggregatorCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0xa928c096\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallDecimals(\n handler: (call: DecimalsCallTrace, ctx: EACAggregatorProxyContext) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, DecimalsCallTrace>,\n preprocessHandler?: (\n call: DecimalsCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x313ce567\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallDescription(\n handler: (\n call: DescriptionCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, DescriptionCallTrace>,\n preprocessHandler?: (\n call: DescriptionCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x7284e416\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallGetAnswer(\n handler: (call: GetAnswerCallTrace, ctx: EACAggregatorProxyContext) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, GetAnswerCallTrace>,\n preprocessHandler?: (\n call: GetAnswerCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0xb5ab58dc\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallGetRoundData(\n handler: (\n call: GetRoundDataCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, GetRoundDataCallTrace>,\n preprocessHandler?: (\n call: GetRoundDataCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x9a6fc8f5\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallGetTimestamp(\n handler: (\n call: GetTimestampCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, GetTimestampCallTrace>,\n preprocessHandler?: (\n call: GetTimestampCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0xb633620c\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallLatestAnswer(\n handler: (\n call: LatestAnswerCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, LatestAnswerCallTrace>,\n preprocessHandler?: (\n call: LatestAnswerCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x50d25bcd\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallLatestRound(\n handler: (\n call: LatestRoundCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, LatestRoundCallTrace>,\n preprocessHandler?: (\n call: LatestRoundCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x668a0f02\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallLatestRoundData(\n handler: (\n call: LatestRoundDataCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, LatestRoundDataCallTrace>,\n preprocessHandler?: (\n call: LatestRoundDataCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0xfeaf968c\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallLatestTimestamp(\n handler: (\n call: LatestTimestampCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, LatestTimestampCallTrace>,\n preprocessHandler?: (\n call: LatestTimestampCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x8205bf6a\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallOwner(\n handler: (call: OwnerCallTrace, ctx: EACAggregatorProxyContext) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, OwnerCallTrace>,\n preprocessHandler?: (\n call: OwnerCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x8da5cb5b\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallPhaseAggregators(\n handler: (\n call: PhaseAggregatorsCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, PhaseAggregatorsCallTrace>,\n preprocessHandler?: (\n call: PhaseAggregatorsCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0xc1597304\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallPhaseId(\n handler: (call: PhaseIdCallTrace, ctx: EACAggregatorProxyContext) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, PhaseIdCallTrace>,\n preprocessHandler?: (\n call: PhaseIdCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x58303b10\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallProposeAggregator(\n handler: (\n call: ProposeAggregatorCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, ProposeAggregatorCallTrace>,\n preprocessHandler?: (\n call: ProposeAggregatorCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0xf8a2abd3\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallProposedAggregator(\n handler: (\n call: ProposedAggregatorCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => void,\n handlerOptions?: HandlerOptions<\n EthFetchConfig,\n ProposedAggregatorCallTrace\n >,\n preprocessHandler?: (\n call: ProposedAggregatorCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0xe8c4be30\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallProposedGetRoundData(\n handler: (\n call: ProposedGetRoundDataCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => void,\n handlerOptions?: HandlerOptions<\n EthFetchConfig,\n ProposedGetRoundDataCallTrace\n >,\n preprocessHandler?: (\n call: ProposedGetRoundDataCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x6001ac53\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallProposedLatestRoundData(\n handler: (\n call: ProposedLatestRoundDataCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => void,\n handlerOptions?: HandlerOptions<\n EthFetchConfig,\n ProposedLatestRoundDataCallTrace\n >,\n preprocessHandler?: (\n call: ProposedLatestRoundDataCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x8f6b4d91\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallSetController(\n handler: (\n call: SetControllerCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, SetControllerCallTrace>,\n preprocessHandler?: (\n call: SetControllerCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x92eefe9b\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallTransferOwnership(\n handler: (\n call: TransferOwnershipCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, TransferOwnershipCallTrace>,\n preprocessHandler?: (\n call: TransferOwnershipCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0xf2fde38b\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onCallVersion(\n handler: (call: VersionCallTrace, ctx: EACAggregatorProxyContext) => void,\n handlerOptions?: HandlerOptions<EthFetchConfig, VersionCallTrace>,\n preprocessHandler?: (\n call: VersionCallTrace,\n ctx: EACAggregatorProxyContext,\n ) => Promise<PreprocessResult>,\n ): this {\n return super.onEthTrace(\n \"0x54fd4d50\",\n handler as any,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n public static filters = {\n AnswerUpdated(\n current?: BigNumberish | null,\n roundId?: BigNumberish | null,\n updatedAt?: null,\n ): AnswerUpdatedEventFilter {\n return templateContract.filters[\"AnswerUpdated(int256,uint256,uint256)\"](\n current,\n roundId,\n updatedAt,\n );\n },\n NewRound(\n roundId?: BigNumberish | null,\n startedBy?: string | null,\n startedAt?: null,\n ): NewRoundEventFilter {\n return templateContract.filters[\"NewRound(uint256,address,uint256)\"](\n roundId,\n startedBy,\n startedAt,\n );\n },\n OwnershipTransferRequested(\n from?: string | null,\n to?: string | null,\n ): OwnershipTransferRequestedEventFilter {\n return templateContract.filters[\n \"OwnershipTransferRequested(address,address)\"\n ](from, to);\n },\n OwnershipTransferred(\n from?: string | null,\n to?: string | null,\n ): OwnershipTransferredEventFilter {\n return templateContract.filters[\"OwnershipTransferred(address,address)\"](\n from,\n to,\n );\n },\n };\n\n protected CreateBoundContractView(): EACAggregatorProxyBoundContractView {\n const view = getEACAggregatorProxyContract(\n this.config.network,\n this.config.address,\n );\n return new EACAggregatorProxyBoundContractView(this.config.address, view);\n }\n\n public static bind(options: BindOptions): EACAggregatorProxyProcessor {\n if (!options.name) {\n options.name = \"EACAggregatorProxy\";\n }\n let processor = getProcessor(options) as EACAggregatorProxyProcessor;\n if (!processor) {\n processor = new EACAggregatorProxyProcessor(options);\n addProcessor(options, processor);\n }\n return processor;\n }\n}\n\nexport class EACAggregatorProxyProcessorTemplate extends BaseProcessorTemplate<\n EACAggregatorProxy,\n EACAggregatorProxyBoundContractView,\n EACAggregatorProxyProcessor\n> {\n bindInternal(options: BindOptions) {\n if (!options.name) {\n options.name = \"EACAggregatorProxy\";\n }\n let processor = getProcessor(options) as EACAggregatorProxyProcessor;\n if (!processor) {\n processor = new EACAggregatorProxyProcessor(options);\n addProcessor(options, processor);\n }\n return processor;\n }\n\n onEventAnswerUpdated(\n handler: (\n event: AnswerUpdatedEvent,\n ctx: EACAggregatorProxyContext,\n ) => void,\n filter?: AnswerUpdatedEventFilter | AnswerUpdatedEventFilter[],\n handlerOptions?: HandlerOptions<EthFetchConfig, AnswerUpdatedEvent>,\n preprocessHandler?: (\n event: AnswerUpdatedEvent,\n ctx: EACAggregatorProxyContext,\n preprocessStore: { [k: string]: any },\n ) => Promise<PreprocessResult>,\n ): this {\n if (!filter) {\n filter = templateContract.filters[\n \"AnswerUpdated(int256,uint256,uint256)\"\n ](null, null, null);\n }\n return super.onEthEvent(\n handler,\n filter!,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onEventNewRound(\n handler: (event: NewRoundEvent, ctx: EACAggregatorProxyContext) => void,\n filter?: NewRoundEventFilter | NewRoundEventFilter[],\n handlerOptions?: HandlerOptions<EthFetchConfig, NewRoundEvent>,\n preprocessHandler?: (\n event: NewRoundEvent,\n ctx: EACAggregatorProxyContext,\n preprocessStore: { [k: string]: any },\n ) => Promise<PreprocessResult>,\n ): this {\n if (!filter) {\n filter = templateContract.filters[\"NewRound(uint256,address,uint256)\"](\n null,\n null,\n null,\n );\n }\n return super.onEthEvent(\n handler,\n filter!,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onEventOwnershipTransferRequested(\n handler: (\n event: OwnershipTransferRequestedEvent,\n ctx: EACAggregatorProxyContext,\n ) => void,\n filter?:\n | OwnershipTransferRequestedEventFilter\n | OwnershipTransferRequestedEventFilter[],\n handlerOptions?: HandlerOptions<\n EthFetchConfig,\n OwnershipTransferRequestedEvent\n >,\n preprocessHandler?: (\n event: OwnershipTransferRequestedEvent,\n ctx: EACAggregatorProxyContext,\n preprocessStore: { [k: string]: any },\n ) => Promise<PreprocessResult>,\n ): this {\n if (!filter) {\n filter = templateContract.filters[\n \"OwnershipTransferRequested(address,address)\"\n ](null, null);\n }\n return super.onEthEvent(\n handler,\n filter!,\n handlerOptions,\n preprocessHandler,\n );\n }\n\n onEventOwnershipTransferred(\n handler: (\n event: OwnershipTransferredEvent,\n ctx: EACAggregatorProxyContext,\n ) => void,\n filter?:\n | OwnershipTransferredEventFilter\n | OwnershipTransferredEventFilter[],\n handlerOptions?: HandlerOptions<EthFetchConfig, OwnershipTransferredEvent>,\n preprocessHandler?: (\n event: OwnershipTransferredEvent,\n ctx: EACAggregatorProxyContext,\n preprocessStore: { [k: string]: any },\n ) => Promise<PreprocessResult>,\n ): this {\n if (!filter) {\n filter = templateContract.filters[\n \"OwnershipTransferred(address,address)\"\n ](null, null);\n }\n return super.onEthEvent(\n handler,\n filter!,\n handlerOptions,\n preprocessHandler,\n );\n }\n}\n\nexport function getEACAggregatorProxyContract(\n chainId: EthChainId,\n address: string,\n): EACAggregatorProxyContractView {\n let contract = getContractByABI(\n \"EACAggregatorProxy\",\n address,\n chainId,\n ) as EACAggregatorProxyContractView;\n if (!contract) {\n const rawContract = EACAggregatorProxy__factory.connect(\n address,\n getProvider(chainId),\n );\n contract = new EACAggregatorProxyContractView(rawContract);\n addContractByABI(\"EACAggregatorProxy\", address, chainId, contract);\n }\n return contract;\n}\n\nexport function getEACAggregatorProxyContractOnContext(\n context: EthContext,\n address: string,\n): EACAggregatorProxyBoundContractView {\n const view = getEACAggregatorProxyContract(context.getChainId(), address);\n const boundView = new EACAggregatorProxyBoundContractView(address, view);\n boundView.context = context;\n if (boundView.callStatic) {\n boundView.callStatic.context = context;\n }\n return boundView;\n}\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { LogParams } from \"ethers/providers\";\nimport { EthChainId } from \"@sentio/sdk/eth\";\nimport {\n AnswerUpdatedEventObject,\n NewRoundEventObject,\n OwnershipTransferRequestedEventObject,\n OwnershipTransferredEventObject,\n} from \"./EACAggregatorProxy.js\";\nimport { getEACAggregatorProxyContract } from \"./eacaggregatorproxy-processor.js\";\nconst mockField = {\n blockHash:\n \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n blockNumber: 0,\n logIndex: 0,\n removed: false,\n transactionHash:\n \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n transactionIndex: 0,\n};\n\nexport function mockAnswerUpdatedLog(\n contractAddress: string,\n event: AnswerUpdatedEventObject,\n): LogParams {\n const contract = getEACAggregatorProxyContract(\n EthChainId.ETHEREUM,\n contractAddress,\n );\n const encodedLog = contract.rawContract.interface.encodeEventLog(\n \"AnswerUpdated(int256,uint256,uint256)\",\n [event.current, event.roundId, event.updatedAt],\n );\n return {\n ...mockField,\n index: 0,\n address: contractAddress,\n data: encodedLog.data,\n topics: encodedLog.topics,\n };\n}\n\nexport function mockNewRoundLog(\n contractAddress: string,\n event: NewRoundEventObject,\n): LogParams {\n const contract = getEACAggregatorProxyContract(\n EthChainId.ETHEREUM,\n contractAddress,\n );\n const encodedLog = contract.rawContract.interface.encodeEventLog(\n \"NewRound(uint256,address,uint256)\",\n [event.roundId, event.startedBy, event.startedAt],\n );\n return {\n ...mockField,\n index: 0,\n address: contractAddress,\n data: encodedLog.data,\n topics: encodedLog.topics,\n };\n}\n\nexport function mockOwnershipTransferRequestedLog(\n contractAddress: string,\n event: OwnershipTransferRequestedEventObject,\n): LogParams {\n const contract = getEACAggregatorProxyContract(\n EthChainId.ETHEREUM,\n contractAddress,\n );\n const encodedLog = contract.rawContract.interface.encodeEventLog(\n \"OwnershipTransferRequested(address,address)\",\n [event.from, event.to],\n );\n return {\n ...mockField,\n index: 0,\n address: contractAddress,\n data: encodedLog.data,\n topics: encodedLog.topics,\n };\n}\n\nexport function mockOwnershipTransferredLog(\n contractAddress: string,\n event: OwnershipTransferredEventObject,\n): LogParams {\n const contract = getEACAggregatorProxyContract(\n EthChainId.ETHEREUM,\n contractAddress,\n );\n const encodedLog = contract.rawContract.interface.encodeEventLog(\n \"OwnershipTransferred(address,address)\",\n [event.from, event.to],\n );\n return {\n ...mockField,\n index: 0,\n address: contractAddress,\n data: encodedLog.data,\n topics: encodedLog.topics,\n };\n}\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\n\nexport * from \"./internal/eacaggregatorproxy-processor.js\";\nexport * from \"./internal/eacaggregatorproxy-test-utils.js\";\nexport * from \"./internal/EACAggregatorProxy.js\";\nexport * from \"./internal/factories/EACAggregatorProxy__factory.js\";\n","import { getEACAggregatorProxyContract } from '../eth/builtin/eacaggregatorproxy.js'\nimport fs from 'fs'\nimport { BlockTag } from 'ethers/providers'\nimport { scaleDown } from '../core/big-decimal.js'\nimport { EthChainId } from '@sentio/chain'\nimport { createRequire } from 'module'\nimport path from 'path'\n\n// Maps an oracle pair (e.g. \"ETH / USD\") to its EACAggregatorProxy address.\ntype OracleMap = Record<string, string>\n\nexport enum PriceUnit {\n USD = 0,\n ETH = 1,\n BTC = 2\n}\n\nexport interface DexPriceResult {\n price?: number\n error?: string\n}\n\nexport function getPackageRoot(pkgId: string): string {\n const require = createRequire(import.meta.url)\n const m = require.resolve(pkgId)\n\n let dir = path.dirname(m)\n while (!fs.existsSync(path.join(dir, 'package.json'))) {\n dir = path.dirname(dir)\n }\n return dir\n}\n\n// Load price feed from https://docs.chain.link/docs/data-feeds/price-feeds/addresses/?network=ethereum\n// and then use EACAggregatorProxy contract to get price\nclass DexPrice {\n USD_ORACLE_MAP = new Map<string, string>()\n ETH_ORACLE_MAP = new Map<string, string>()\n BTC_ORACLE_MAP = new Map<string, string>()\n ASSETS_INFOS = new Map<string, number>()\n\n readonly chainId: EthChainId\n\n constructor(jsonFileName: string, chainId: EthChainId) {\n this.chainId = chainId\n const packageRoot = getPackageRoot('@sentio/sdk')\n const jsonFilePath = path.join(packageRoot, 'assets', jsonFileName)\n const fileContent = fs.readFileSync(jsonFilePath, { encoding: 'utf-8' })\n\n const oracles: OracleMap = JSON.parse(fileContent)\n\n for (const [rawPair, rawAddress] of Object.entries(oracles)) {\n const pair = rawPair.split('/')\n const asset = pair[0].trim().toLowerCase()\n const target = pair[1].trim().toLowerCase()\n const address = rawAddress.toLowerCase()\n if (target === 'usd') {\n this.USD_ORACLE_MAP.set(asset, address)\n } else if (target === 'eth') {\n this.ETH_ORACLE_MAP.set(asset, address)\n } else if (target == 'btc') {\n this.BTC_ORACLE_MAP.set(asset, address)\n } else {\n console.error('wrong asset record: ' + JSON.stringify({ [rawPair]: rawAddress }))\n }\n }\n }\n\n // asset: symbol of the asset\n // unit: usd, eth or btc\n // blockTag: blockNumber of block symbol like \"latest\"\n // returns the asset price,\n // throw exception if calling to price feed failed, e.g. due to a invalid block number\n async getPrice(\n asset: string,\n blockTag: BlockTag = 'latest',\n unit: PriceUnit = PriceUnit.USD\n ): Promise<DexPriceResult> {\n // if (chainId !== 1 && chainId !== 5) {\n // return {\n // error: \"current dex price only support chain 1 (mainnet) or 5 (goerli)\"\n // }\n // }\n\n let oracleMap = this.USD_ORACLE_MAP\n switch (unit) {\n case PriceUnit.ETH:\n oracleMap = this.ETH_ORACLE_MAP\n break\n case PriceUnit.BTC:\n oracleMap = this.BTC_ORACLE_MAP\n break\n default:\n }\n\n asset = asset.trim().toLowerCase()\n\n const addr = oracleMap.get(asset)\n if (!addr) {\n return {\n error: 'No price feed found for asset'\n }\n }\n\n const contract = getEACAggregatorProxyContract(this.chainId, addr)\n try {\n const price = await contract.latestAnswer({\n blockTag: blockTag\n })\n\n let decimal = this.ASSETS_INFOS.get(asset)\n if (!decimal) {\n decimal = Number(await contract.decimals())\n this.ASSETS_INFOS.set(asset, decimal)\n }\n\n return {\n price: scaleDown(price, decimal).toNumber()\n }\n } catch (e) {\n return {\n error:\n 'Price query error for ' +\n asset +\n ' failed at ' +\n addr +\n ' at chain ' +\n this.chainId +\n '. Details: ' +\n String(e)\n }\n }\n }\n}\n\nexport const EthereumDexPrice = new DexPrice('chainlink-oracles.json', EthChainId.ETHEREUM)\nexport const SepoliaDexPrice = new DexPrice('chainlink-oracles-sepolia.json', EthChainId.SEPOLIA)\n","// Copyright 2021-2026 The Connect Authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n/**\n * applyInterceptors takes the given UnaryFn or ServerStreamingFn, and wraps\n * it with each of the given interceptors, returning a new UnaryFn or\n * ServerStreamingFn.\n */\nexport function applyInterceptors(next, interceptors) {\n if (!interceptors) {\n return next;\n }\n for (const i of interceptors.concat().reverse()) {\n next = i(next);\n }\n return next;\n}\n","// Copyright 2021-2026 The Connect Authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { ConnectError } from \"../connect-error.js\";\nimport { Code } from \"../code.js\";\n/**\n * Create an AbortController that is automatically aborted if one of the given\n * signals is aborted.\n *\n * For convenience, the linked AbortSignals can be undefined.\n *\n * If the controller or any of the signals is aborted, all event listeners are\n * removed.\n *\n * @private Internal code, does not follow semantic versioning.\n */\nexport function createLinkedAbortController(...signals) {\n const controller = new AbortController();\n const sa = signals.filter((s) => s !== undefined).concat(controller.signal);\n for (const signal of sa) {\n if (signal.aborted) {\n onAbort.apply(signal);\n break;\n }\n signal.addEventListener(\"abort\", onAbort);\n }\n function onAbort() {\n if (!controller.signal.aborted) {\n controller.abort(getAbortSignalReason(this));\n }\n for (const signal of sa) {\n signal.removeEventListener(\"abort\", onAbort);\n }\n }\n return controller;\n}\n/**\n * Create a deadline signal. The returned object contains an AbortSignal, but\n * also a cleanup function to stop the timer, which must be called once the\n * calling code is no longer interested in the signal.\n *\n * Ideally, we would simply use AbortSignal.timeout(), but it is not widely\n * available yet.\n *\n * @private Internal code, does not follow semantic versioning.\n */\nexport function createDeadlineSignal(timeoutMs) {\n const controller = new AbortController();\n const listener = () => {\n controller.abort(new ConnectError(\"the operation timed out\", Code.DeadlineExceeded));\n };\n let timeoutId;\n if (timeoutMs !== undefined) {\n if (timeoutMs <= 0)\n listener();\n else\n timeoutId = setTimeout(listener, timeoutMs);\n }\n return {\n signal: controller.signal,\n cleanup: () => clearTimeout(timeoutId),\n };\n}\n/**\n * Returns the reason why an AbortSignal was aborted. Returns undefined if the\n * signal has not been aborted.\n *\n * The property AbortSignal.reason is not widely available. This function\n * returns an AbortError if the signal is aborted, but reason is undefined.\n *\n * @private Internal code, does not follow semantic versioning.\n */\nexport function getAbortSignalReason(signal) {\n if (!signal.aborted) {\n return undefined;\n }\n if (signal.reason !== undefined) {\n return signal.reason;\n }\n // AbortSignal.reason is available in Node.js v16, v18, and later,\n // and in all browsers since early 2022.\n const e = new Error(\"This operation was aborted\");\n e.name = \"AbortError\";\n return e;\n}\n","// Copyright 2021-2026 The Connect Authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { create } from \"@bufbuild/protobuf\";\n/**\n * Takes a partial protobuf messages of the\n * specified message type as input, and returns full instances.\n */\nexport function normalize(desc, message) {\n return create(desc, message);\n}\n/**\n * Takes an AsyncIterable of partial protobuf messages of the\n * specified message type as input, and yields full instances.\n */\nexport function normalizeIterable(desc, input) {\n function transform(result) {\n if (result.done === true) {\n return result;\n }\n return {\n done: result.done,\n value: normalize(desc, result.value),\n };\n }\n return {\n [Symbol.asyncIterator]() {\n const it = input[Symbol.asyncIterator]();\n const res = {\n next: () => it.next().then(transform),\n };\n if (it.throw !== undefined) {\n res.throw = (e) => it.throw(e).then(transform);\n }\n if (it.return !== undefined) {\n res.return = (v) => it.return(v).then(transform);\n }\n return res;\n },\n };\n}\n","// Copyright 2021-2026 The Connect Authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { applyInterceptors } from \"../interceptor.js\";\nimport { ConnectError } from \"../connect-error.js\";\nimport { createDeadlineSignal, createLinkedAbortController, getAbortSignalReason, } from \"./signals.js\";\nimport { normalize, normalizeIterable } from \"./normalize.js\";\nimport { Code } from \"../code.js\";\n/**\n * Runs a unary method with the given interceptors. Note that this function\n * is only used when implementing a Transport.\n */\nexport function runUnaryCall(opt) {\n const next = applyInterceptors(opt.next, opt.interceptors);\n const [signal, abort, done] = setupSignal(opt);\n const req = Object.assign(Object.assign({}, opt.req), { message: normalize(opt.req.method.input, opt.req.message), signal });\n return next(req).then((res) => {\n done();\n return res;\n }, abort);\n}\n/**\n * Runs a server-streaming method with the given interceptors. Note that this\n * function is only used when implementing a Transport.\n */\nexport function runStreamingCall(opt) {\n const next = applyInterceptors(opt.next, opt.interceptors);\n const [signal, abort, done] = setupSignal(opt);\n const req = Object.assign(Object.assign({}, opt.req), { message: normalizeIterable(opt.req.method.input, opt.req.message), signal });\n let doneCalled = false;\n // Call return on the request iterable to indicate\n // that we will no longer consume it and it should\n // cleanup any allocated resources.\n signal.addEventListener(\"abort\", function () {\n var _a, _b;\n const it = opt.req.message[Symbol.asyncIterator]();\n // If the signal is aborted due to an error, we want to throw\n // the error to the request iterator.\n if (!doneCalled) {\n (_a = it.throw) === null || _a === void 0 ? void 0 : _a.call(it, this.reason).catch(() => {\n // throw returns a promise, which we don't care about.\n //\n // Uncaught promises are thrown at sometime/somewhere by the event loop,\n // this is to ensure error is caught and ignored.\n });\n }\n (_b = it.return) === null || _b === void 0 ? void 0 : _b.call(it).catch(() => {\n // return returns a promise, which we don't care about.\n //\n // Uncaught promises are thrown at sometime/somewhere by the event loop,\n // this is to ensure error is caught and ignored.\n });\n });\n return next(req).then((res) => {\n return Object.assign(Object.assign({}, res), { message: {\n [Symbol.asyncIterator]() {\n const it = res.message[Symbol.asyncIterator]();\n return {\n next() {\n return it.next().then((r) => {\n if (r.done == true) {\n doneCalled = true;\n done();\n }\n return r;\n }, abort);\n },\n // We deliberately omit throw/return.\n };\n },\n } });\n }, abort);\n}\n/**\n * Create an AbortSignal for Transport implementations. The signal is available\n * in UnaryRequest and StreamingRequest, and is triggered when the call is\n * aborted (via a timeout or explicit cancellation), errored (e.g. when reading\n * an error from the server from the wire), or finished successfully.\n *\n * Transport implementations can pass the signal to HTTP clients to ensure that\n * there are no unused connections leak.\n *\n * Returns a tuple:\n * [0]: The signal, which is also aborted if the optional deadline is reached.\n * [1]: Function to call if the Transport encountered an error.\n * [2]: Function to call if the Transport finished without an error.\n */\nfunction setupSignal(opt) {\n const { signal, cleanup } = createDeadlineSignal(opt.timeoutMs);\n const controller = createLinkedAbortController(opt.signal, signal);\n return [\n controller.signal,\n function abort(reason) {\n // We peek at the signal because fetch() will throw an error on abort\n // that discards the signal reason.\n const e = controller.signal.aborted\n ? ConnectError.from(getAbortSignalReason(controller.signal), Code.Canceled)\n : ConnectError.from(reason);\n controller.abort(e);\n cleanup();\n return Promise.reject(e);\n },\n function done() {\n cleanup();\n controller.abort();\n },\n ];\n}\n","import { createContextKey } from '@connectrpc/connect';\nexport const gatewayBindingKey = createContextKey(undefined);\n/**\n * Per-call fetch RequestInit overrides (e.g. credentials: 'include' on embed\n * pages). Merged over the transport-level requestInit; method/headers/body/\n * signal are controlled by the transport and cannot be overridden.\n */\nexport const gatewayRequestInitKey = createContextKey(undefined);\n//# sourceMappingURL=context.js.map","import { fromJson } from '@bufbuild/protobuf';\nimport { AnySchema } from '@bufbuild/protobuf/wkt';\nimport { Code, ConnectError } from '@connectrpc/connect';\nconst errorInfoMap = new WeakMap();\n/**\n * Returns the HTTP status and raw body for an error produced by the gateway\n * transport, or undefined for any other error.\n */\nexport function gatewayErrorInfo(error) {\n return error instanceof ConnectError ? errorInfoMap.get(error) : undefined;\n}\n// Reverse of grpc-gateway's HTTPStatusFromCode, for responses that did not\n// carry a google.rpc.Status body (LB/proxy errors, HTML error pages).\nconst HTTP_STATUS_CODES = {\n 400: Code.InvalidArgument,\n 401: Code.Unauthenticated,\n 403: Code.PermissionDenied,\n 404: Code.NotFound,\n 408: Code.DeadlineExceeded,\n 409: Code.Aborted,\n 412: Code.FailedPrecondition,\n 413: Code.ResourceExhausted,\n 429: Code.ResourceExhausted,\n 431: Code.ResourceExhausted,\n 499: Code.Canceled,\n 501: Code.Unimplemented,\n 502: Code.Unavailable,\n 503: Code.Unavailable,\n 504: Code.DeadlineExceeded\n};\nexport function codeFromHttpStatus(status) {\n return HTTP_STATUS_CODES[status] ?? (status >= 500 ? Code.Internal : Code.Unknown);\n}\nfunction isStatusJson(body) {\n return typeof body === 'object' && body !== null && !Array.isArray(body);\n}\n/**\n * Converts a grpc-gateway error response into a ConnectError. The body is the\n * protojson form of google.rpc.Status ({code, message, details: [Any...]}).\n * Falls back to an HTTP-status mapping when the body is not a Status. Error\n * details decode into ConnectError.details (findDetails-compatible) when the\n * registry knows the type; the raw body stays available via gatewayErrorInfo.\n */\nexport function gatewayErrorFromBody(body, httpStatus, headers, registry) {\n // Streaming responses that fail before the first chunk arrive as the\n // stream-chunk wrapper {\"error\": {code, message, details}} — unwrap it.\n if (isStatusJson(body) && body.code === undefined && body.error !== undefined && isStatusJson(body.error)) {\n body = body.error;\n }\n let code = codeFromHttpStatus(httpStatus);\n let message = `HTTP ${httpStatus}`;\n let detailsJson = [];\n if (isStatusJson(body)) {\n const statusCode = body.code;\n if (typeof statusCode === 'number' && Number.isInteger(statusCode) && statusCode > 0 && statusCode <= 16) {\n code = statusCode;\n }\n if (typeof body.message === 'string') {\n message = body.message;\n }\n if (Array.isArray(body.details)) {\n detailsJson = body.details;\n }\n }\n else if (typeof body === 'string' && body.trim() !== '') {\n message = body.length > 300 ? `${body.slice(0, 300)}…` : body;\n }\n const error = new ConnectError(message, code, headers);\n for (const detail of detailsJson) {\n if (registry === undefined) {\n break;\n }\n try {\n const any = fromJson(AnySchema, detail, { registry });\n error.details.push({\n type: any.typeUrl.substring(any.typeUrl.lastIndexOf('/') + 1),\n value: any.value,\n debug: detail\n });\n }\n catch {\n // Type not in the registry — the raw detail remains in gatewayErrorInfo.\n }\n }\n errorInfoMap.set(error, { httpStatus, rawBody: body });\n return error;\n}\n/**\n * Reads an error response body as JSON when possible, else as text.\n */\nexport async function readErrorBody(response) {\n let text;\n try {\n text = await response.text();\n }\n catch {\n return undefined;\n }\n if (text === '') {\n return undefined;\n }\n try {\n return JSON.parse(text);\n }\n catch {\n return text;\n }\n}\n/**\n * fromJson with decode failures wrapped into a ConnectError.\n */\nexport function decodeJsonMessage(schema, json, jsonRead, headers) {\n try {\n return fromJson(schema, json, jsonRead);\n }\n catch (cause) {\n throw new ConnectError(`failed to decode ${schema.typeName} from response JSON`, Code.Internal, headers, [], cause);\n }\n}\n//# sourceMappingURL=error.js.map","/**\n * Merges transport-default headers with per-call headers (per-call wins) and\n * applies gateway content negotiation defaults.\n */\nexport function buildRequestHeaders(defaults, callHeader, contentType) {\n const headers = new Headers(defaults);\n callHeader.forEach((value, key) => headers.set(key, value));\n if (contentType !== null && !headers.has('content-type')) {\n headers.set('content-type', contentType);\n }\n if (!headers.has('accept')) {\n headers.set('accept', 'application/json');\n }\n return headers;\n}\nconst GRPC_METADATA_PREFIX = 'grpc-metadata-';\n/**\n * Demangles grpc-gateway's Grpc-Metadata-* response headers back into plain\n * metadata keys. Browsers cannot read HTTP trailers, so the trailer Headers is\n * always synthesized empty.\n */\nexport function splitGatewayMetadata(responseHeaders) {\n const header = new Headers();\n const trailer = new Headers();\n responseHeaders.forEach((value, key) => {\n if (key.startsWith(GRPC_METADATA_PREFIX)) {\n header.append(key.slice(GRPC_METADATA_PREFIX.length), value);\n }\n else {\n header.append(key, value);\n }\n });\n return { header, trailer };\n}\n//# sourceMappingURL=headers.js.map","import { create, toJson } from '@bufbuild/protobuf';\nexport const HTTP_BODY_TYPE_NAME = 'google.api.HttpBody';\n/**\n * Detects google.api.HttpBody by type name so the transport core needs no\n * static import of the vendored httpbody schema.\n */\nexport function isHttpBody(desc) {\n return desc.typeName === HTTP_BODY_TYPE_NAME;\n}\n/**\n * Builds the HTTP request parts for an RPC whose input is google.api.HttpBody.\n * 'raw' sends data as the body with content_type as Content-Type (matching\n * gateways registered with an HTTPBodyMarshaler); 'json' sends the protojson\n * form of the HttpBody message itself (plain JSONPb gateways).\n */\nexport function httpBodyRequestParts(schema, message, mode, jsonWrite) {\n if (mode === 'json') {\n return {\n body: JSON.stringify(toJson(schema, message, jsonWrite)),\n contentType: 'application/json'\n };\n }\n return {\n body: message.data ?? new Uint8Array(),\n contentType: message.contentType !== '' ? message.contentType : 'application/octet-stream'\n };\n}\n/**\n * Builds the HttpBody response message from a raw gateway response: body bytes\n * plus the Content-Type header.\n */\nexport async function httpBodyFromResponse(schema, response) {\n const data = new Uint8Array(await response.arrayBuffer());\n return create(schema, {\n contentType: response.headers.get('content-type') ?? '',\n data\n });\n}\n//# sourceMappingURL=http-body.js.map","export function normalizeGatewayOptions(options) {\n if (options.jsonOptions?.useProtoFieldName) {\n // The transcoder carves the protojson tree by jsonName; proto-name JSON\n // keys would silently break path/query extraction.\n throw new Error('connect-gateway-es: jsonOptions.useProtoFieldName is not supported (use queryParamCase: \"proto\" for snake_case query keys)');\n }\n // Single source of truth for the registry: the dedicated option wins, else\n // a registry passed through jsonOptions; used for JSON I/O AND error details.\n const registry = options.registry ?? options.jsonOptions?.registry;\n const jsonRead = { ignoreUnknownFields: true, ...options.jsonOptions };\n const jsonWrite = { ...options.jsonOptions };\n if (registry !== undefined) {\n jsonRead.registry = registry;\n jsonWrite.registry = registry;\n }\n return {\n baseUrl: options.baseUrl.replace(/\\/+$/, ''),\n fetch: options.fetch ?? globalThis.fetch?.bind(globalThis),\n interceptors: options.interceptors ?? [],\n defaultTimeoutMs: options.defaultTimeoutMs,\n registry,\n jsonRead,\n jsonWrite,\n queryParamCase: options.queryParamCase ?? 'json',\n fallbackRule: options.fallbackRule,\n selectBinding: options.selectBinding,\n httpBodyRequest: options.httpBodyRequest ?? 'raw',\n headers: options.headers,\n requestInit: options.requestInit\n };\n}\n//# sourceMappingURL=options.js.map","import { Code, ConnectError } from '@connectrpc/connect';\nconst IDENT_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;\nfunction parseError(template, message) {\n return new ConnectError(`invalid path template \"${template}\": ${message}`, Code.Internal);\n}\nexport function parsePathTemplate(raw) {\n if (!raw.startsWith('/')) {\n throw parseError(raw, 'must start with \"/\"');\n }\n let body = raw.slice(1);\n // Extract the trailing \":verb\" of the final segment (a ':' outside braces).\n let verb;\n let depthScan = 0;\n for (let i = body.length - 1; i >= 0; i--) {\n const c = body[i];\n if (c === '}')\n depthScan++;\n else if (c === '{')\n depthScan--;\n else if (c === '/' && depthScan === 0)\n break;\n else if (c === ':' && depthScan === 0) {\n verb = body.slice(i + 1);\n body = body.slice(0, i);\n if (verb === '' || !IDENT_RE.test(verb)) {\n throw parseError(raw, `invalid verb \":${verb}\"`);\n }\n break;\n }\n }\n // Split into raw segments on '/' outside braces.\n const rawSegments = [];\n let cur = '';\n let depth = 0;\n for (const c of body) {\n if (c === '{') {\n depth++;\n if (depth > 1)\n throw parseError(raw, 'nested \"{\" is not allowed');\n cur += c;\n }\n else if (c === '}') {\n depth--;\n if (depth < 0)\n throw parseError(raw, 'unbalanced \"}\"');\n cur += c;\n }\n else if (c === '/' && depth === 0) {\n rawSegments.push(cur);\n cur = '';\n }\n else {\n cur += c;\n }\n }\n if (depth !== 0)\n throw parseError(raw, 'unbalanced \"{\"');\n rawSegments.push(cur);\n const segments = [];\n for (const [index, seg] of rawSegments.entries()) {\n if (seg === '') {\n throw parseError(raw, 'empty path segment');\n }\n const prev = segments[segments.length - 1];\n if (prev &&\n ((prev.kind === 'wildcard' && prev.multi) || (prev.kind === 'variable' && prev.pattern.includes('**')))) {\n throw parseError(raw, '\"**\" must be the last segment');\n }\n if (seg === '*' || seg === '**') {\n segments.push({ kind: 'wildcard', multi: seg === '**' });\n continue;\n }\n if (seg.startsWith('{')) {\n if (!seg.endsWith('}')) {\n throw parseError(raw, `malformed variable segment \"${seg}\"`);\n }\n const inside = seg.slice(1, -1);\n const eq = inside.indexOf('=');\n const fieldPathStr = eq < 0 ? inside : inside.slice(0, eq);\n const patternStr = eq < 0 ? undefined : inside.slice(eq + 1);\n const fieldPath = fieldPathStr.split('.');\n for (const ident of fieldPath) {\n if (!IDENT_RE.test(ident)) {\n throw parseError(raw, `invalid field path \"${fieldPathStr}\"`);\n }\n }\n let pattern;\n if (patternStr === undefined) {\n pattern = ['*'];\n }\n else {\n pattern = patternStr.split('/');\n for (const [pi, p] of pattern.entries()) {\n if (p === '')\n throw parseError(raw, `empty segment in pattern \"${patternStr}\"`);\n if (p.includes('{') || p.includes('}')) {\n throw parseError(raw, `variables may not nest in pattern \"${patternStr}\"`);\n }\n if (p === '**' && pi !== pattern.length - 1) {\n throw parseError(raw, `\"**\" must be the last segment of pattern \"${patternStr}\"`);\n }\n }\n }\n segments.push({\n kind: 'variable',\n fieldPath,\n pattern,\n allowSlashes: pattern.length > 1 || pattern.includes('**')\n });\n continue;\n }\n if (seg.includes('}') || seg.includes(':')) {\n throw parseError(raw, `malformed segment \"${seg}\" (index ${index})`);\n }\n segments.push({ kind: 'literal', value: seg });\n }\n const varFieldPaths = segments.flatMap((s) => (s.kind === 'variable' ? [s.fieldPath] : []));\n const seen = new Set();\n for (const fp of varFieldPaths) {\n const key = fp.join('.');\n if (seen.has(key))\n throw parseError(raw, `duplicate variable \"{${key}}\"`);\n seen.add(key);\n }\n return { raw, segments, verb, varFieldPaths };\n}\n/**\n * Percent-encodes a single path segment value. Everything outside the RFC 3986\n * unreserved set is encoded — unlike encodeURIComponent, which leaves !'()* raw.\n */\nexport function encodeSegment(value) {\n return encodeURIComponent(value).replace(/[!'()*]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`);\n}\n/**\n * Percent-encodes a multi-segment path value, preserving '/' separators.\n */\nexport function encodeMultiSegment(value) {\n return value.split('/').map(encodeSegment).join('/');\n}\nfunction escapeRegExp(literal) {\n return literal.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\nfunction patternRegExp(pattern) {\n const parts = pattern.map((p) => (p === '**' ? '.*' : p === '*' ? '[^/]+' : escapeRegExp(p)));\n return new RegExp(`^${parts.join('/')}$`);\n}\nconst isTrivial = (pattern) => pattern.length === 1 && (pattern[0] === '*' || pattern[0] === '**');\n/**\n * Renders the template into a percent-encoded URL path. `lookup` resolves a\n * variable's field path to its protojson scalar value (already stringified for\n * int64 etc.); returning undefined means the field is unset.\n */\nexport function renderPath(template, lookup) {\n const parts = [];\n for (const seg of template.segments) {\n switch (seg.kind) {\n case 'literal':\n parts.push(seg.value);\n break;\n case 'wildcard':\n throw new ConnectError(`cannot render path template \"${template.raw}\": bare \"${seg.multi ? '**' : '*'}\" segments have no request field to substitute`, Code.Internal);\n case 'variable': {\n const name = seg.fieldPath.join('.');\n const value = lookup(seg.fieldPath);\n if (value === undefined || value === null) {\n throw new ConnectError(`missing required path parameter \"${name}\" for \"${template.raw}\"`, Code.Internal);\n }\n if (typeof value === 'object') {\n throw new ConnectError(`path parameter \"${name}\" for \"${template.raw}\" must be a scalar, got ${typeof value}`, Code.Internal);\n }\n const str = String(value);\n if (str === '' && !seg.allowSlashes) {\n throw new ConnectError(`path parameter \"${name}\" for \"${template.raw}\" must not be empty`, Code.Internal);\n }\n if (!isTrivial(seg.pattern) && !patternRegExp(seg.pattern).test(str)) {\n throw new ConnectError(`path parameter \"${name}\" value ${JSON.stringify(str)} does not match pattern \"${seg.pattern.join('/')}\" in \"${template.raw}\"`, Code.Internal);\n }\n parts.push(seg.allowSlashes ? encodeMultiSegment(str) : encodeSegment(str));\n break;\n }\n }\n }\n let path = '/' + parts.join('/');\n if (template.verb !== undefined) {\n path += ':' + template.verb;\n }\n return path;\n}\n//# sourceMappingURL=path-template.js.map","import { Code, ConnectError } from '@connectrpc/connect';\n// These serialize to arbitrary JSON; grpc-gateway parses the raw query value\n// with the type's UnmarshalJSON, so we send the JSON text as a single param.\n// ListValue is NOT included: the gateway's query parser rejects it.\nconst JSON_BLOB_TYPES = new Set(['google.protobuf.Struct', 'google.protobuf.Value']);\nfunction scalarToString(value) {\n return typeof value === 'string' ? value : String(value);\n}\n// protojson camelCases FieldMask paths ('display_name' -> 'displayName'), but\n// grpc-gateway's query parser stores the comma-split paths verbatim with no\n// reversal (that only happens for request bodies). Convert back to snake_case\n// so the server sees the proto field paths. Lossless: protobuf-es toJson\n// already rejects irreversible paths.\nfunction fieldMaskToQueryValue(protojsonValue) {\n return protojsonValue\n .split(',')\n .map((path) => path.replace(/[A-Z]/g, (c) => `_${c.toLowerCase()}`))\n .join(',');\n}\nfunction unsupported(fullKey, why) {\n return new ConnectError(`field \"${fullKey}\" cannot be encoded as a query parameter: ${why}`, Code.Internal);\n}\n/**\n * Flattens the leftover request fields (a protojson object produced by toJson,\n * minus path variables and body) into grpc-gateway query parameters: nested\n * messages become dotted keys, repeated scalars repeat the key, well-known\n * types keep their protojson scalar encoding.\n */\nexport function flattenQueryParams(json, schema, caseMode) {\n const pairs = [];\n flattenInto(json, schema, caseMode, '', pairs);\n return pairs;\n}\nfunction flattenInto(json, schema, caseMode, prefix, sink) {\n for (const field of schema.fields) {\n const value = json[field.jsonName];\n if (value === undefined) {\n continue;\n }\n const key = caseMode === 'json' ? field.jsonName : field.name;\n const fullKey = prefix === '' ? key : `${prefix}.${key}`;\n switch (field.fieldKind) {\n case 'scalar':\n case 'enum':\n if (value === null || typeof value === 'object') {\n throw unsupported(fullKey, `unexpected JSON ${value === null ? 'null' : 'object'}`);\n }\n sink.push([fullKey, scalarToString(value)]);\n break;\n case 'list': {\n if (field.listKind === 'message' && JSON_BLOB_TYPES.has(field.message.typeName)) {\n // Scalar-serialized Value elements would lose their JSON typing and\n // the gateway rejects repeated Struct either way.\n throw unsupported(fullKey, `repeated ${field.message.typeName} is not supported in query strings`);\n }\n for (const element of value) {\n if (element === null || typeof element === 'object') {\n throw unsupported(fullKey, 'repeated message values are not supported in query strings');\n }\n sink.push([fullKey, scalarToString(element)]);\n }\n break;\n }\n case 'map':\n // grpc-gateway can parse key[mapKey]=value pairs, but the encoding is\n // version-sensitive; rejecting keeps the dialect predictable.\n throw unsupported(fullKey, 'map fields are not supported in query strings');\n case 'message': {\n const typeName = field.message.typeName;\n if (JSON_BLOB_TYPES.has(typeName)) {\n sink.push([fullKey, JSON.stringify(value)]);\n break;\n }\n if (typeName === 'google.api.HttpBody' ||\n typeName === 'google.protobuf.Any' ||\n typeName === 'google.protobuf.ListValue') {\n throw unsupported(fullKey, `${typeName} is not supported in query strings`);\n }\n if (value === null) {\n break;\n }\n if (typeName === 'google.protobuf.FieldMask') {\n if (typeof value === 'string' && value !== '') {\n sink.push([fullKey, fieldMaskToQueryValue(value)]);\n }\n break;\n }\n if (typeof value !== 'object') {\n // Scalar-serializing well-known types: Timestamp, Duration and the\n // wrapper types.\n sink.push([fullKey, scalarToString(value)]);\n break;\n }\n if (Array.isArray(value)) {\n throw unsupported(fullKey, 'unexpected JSON array');\n }\n flattenInto(value, field.message, caseMode, fullKey, sink);\n break;\n }\n }\n }\n}\n/**\n * Encodes query pairs with URLSearchParams semantics (spaces become '+'),\n * matching what grpc-gateway's net/url parsing expects.\n */\nexport function encodeQueryString(pairs) {\n if (pairs.length === 0) {\n return '';\n }\n const params = new URLSearchParams();\n for (const [key, value] of pairs) {\n params.append(key, value);\n }\n return params.toString();\n}\n//# sourceMappingURL=query-params.js.map","// Copyright 2026 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { fileDesc, messageDesc } from \"@bufbuild/protobuf/codegenv2\";\n/**\n * Describes the file google/api/http.proto.\n */\nexport const file_google_api_http = /*@__PURE__*/ fileDesc(\"ChVnb29nbGUvYXBpL2h0dHAucHJvdG8SCmdvb2dsZS5hcGkiVAoESHR0cBIjCgVydWxlcxgBIAMoCzIULmdvb2dsZS5hcGkuSHR0cFJ1bGUSJwofZnVsbHlfZGVjb2RlX3Jlc2VydmVkX2V4cGFuc2lvbhgCIAEoCCKBAgoISHR0cFJ1bGUSEAoIc2VsZWN0b3IYASABKAkSDQoDZ2V0GAIgASgJSAASDQoDcHV0GAMgASgJSAASDgoEcG9zdBgEIAEoCUgAEhAKBmRlbGV0ZRgFIAEoCUgAEg8KBXBhdGNoGAYgASgJSAASLwoGY3VzdG9tGAggASgLMh0uZ29vZ2xlLmFwaS5DdXN0b21IdHRwUGF0dGVybkgAEgwKBGJvZHkYByABKAkSFQoNcmVzcG9uc2VfYm9keRgMIAEoCRIxChNhZGRpdGlvbmFsX2JpbmRpbmdzGAsgAygLMhQuZ29vZ2xlLmFwaS5IdHRwUnVsZUIJCgdwYXR0ZXJuIi8KEUN1c3RvbUh0dHBQYXR0ZXJuEgwKBGtpbmQYASABKAkSDAoEcGF0aBgCIAEoCUJnCg5jb20uZ29vZ2xlLmFwaUIJSHR0cFByb3RvUAFaQWdvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvYXBpL2Fubm90YXRpb25zO2Fubm90YXRpb25zogIER0FQSWIGcHJvdG8z\");\n/**\n * Describes the message google.api.Http.\n * Use `create(HttpSchema)` to create a new message.\n */\nexport const HttpSchema = /*@__PURE__*/ messageDesc(file_google_api_http, 0);\n/**\n * Describes the message google.api.HttpRule.\n * Use `create(HttpRuleSchema)` to create a new message.\n */\nexport const HttpRuleSchema = /*@__PURE__*/ messageDesc(file_google_api_http, 1);\n/**\n * Describes the message google.api.CustomHttpPattern.\n * Use `create(CustomHttpPatternSchema)` to create a new message.\n */\nexport const CustomHttpPatternSchema = /*@__PURE__*/ messageDesc(file_google_api_http, 2);\n//# sourceMappingURL=http_pb.js.map","// Copyright 2025 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { extDesc, fileDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport { file_google_api_http } from \"./http_pb.js\";\nimport { file_google_protobuf_descriptor } from \"@bufbuild/protobuf/wkt\";\n/**\n * Describes the file google/api/annotations.proto.\n */\nexport const file_google_api_annotations = /*@__PURE__*/ fileDesc(\"Chxnb29nbGUvYXBpL2Fubm90YXRpb25zLnByb3RvEgpnb29nbGUuYXBpOksKBGh0dHASHi5nb29nbGUucHJvdG9idWYuTWV0aG9kT3B0aW9ucxiwyrwiIAEoCzIULmdvb2dsZS5hcGkuSHR0cFJ1bGVSBGh0dHBCbgoOY29tLmdvb2dsZS5hcGlCEEFubm90YXRpb25zUHJvdG9QAVpBZ29vZ2xlLmdvbGFuZy5vcmcvZ2VucHJvdG8vZ29vZ2xlYXBpcy9hcGkvYW5ub3RhdGlvbnM7YW5ub3RhdGlvbnOiAgRHQVBJYgZwcm90bzM\", [file_google_api_http, file_google_protobuf_descriptor]);\n/**\n * See `HttpRule`.\n *\n * @generated from extension: google.api.HttpRule http = 72295728;\n */\nexport const http = /*@__PURE__*/ extDesc(file_google_api_annotations, 0);\n//# sourceMappingURL=annotations_pb.js.map","import { create, getOption, hasOption } from '@bufbuild/protobuf';\nimport { Code, ConnectError } from '@connectrpc/connect';\nimport { http } from './gen/google/api/annotations_pb.js';\nimport { HttpRuleSchema } from './gen/google/api/http_pb.js';\nimport { parsePathTemplate } from './path-template.js';\n/**\n * A fallback used for methods without a google.api.http annotation. Mirrors\n * grpc-gateway's generate_unbound_methods registration:\n * POST /<package>.<Service>/<Method> with body \"*\".\n */\nexport function unboundMethodsFallback(method) {\n return create(HttpRuleSchema, {\n pattern: { case: 'post', value: `/${method.parent.typeName}/${method.name}` },\n body: '*'\n });\n}\nfunction compileBinding(method, rule, top) {\n const where = `rpc ${method.parent.typeName}.${method.name}`;\n const { case: patternCase, value } = rule.pattern;\n if (patternCase === undefined) {\n throw new ConnectError(`${where}: google.api.http rule has no pattern`, Code.Internal);\n }\n if (patternCase === 'custom') {\n throw new ConnectError(`${where}: custom HTTP verbs are not supported`, Code.Unimplemented);\n }\n if (rule.responseBody !== '') {\n throw new ConnectError(`${where}: response_body is not supported`, Code.Unimplemented);\n }\n if (!top && rule.additionalBindings.length > 0) {\n throw new ConnectError(`${where}: additional_bindings may not be nested`, Code.Internal);\n }\n const verb = patternCase.toUpperCase();\n const template = parsePathTemplate(value);\n let body;\n if (rule.body === '') {\n body = undefined;\n }\n else if (rule.body === '*') {\n body = '*';\n }\n else {\n const fieldPath = rule.body.split('.');\n if (fieldPath.length !== 1) {\n throw new ConnectError(`${where}: body must be \"*\" or a top-level field name, got \"${rule.body}\"`, Code.Internal);\n }\n const field = method.input.fields.find((f) => f.name === fieldPath[0]);\n if (field === undefined) {\n throw new ConnectError(`${where}: body field \"${rule.body}\" does not exist on ${method.input.typeName}`, Code.Internal);\n }\n body = fieldPath;\n }\n if (body !== undefined && (verb === 'GET' || verb === 'DELETE')) {\n throw new ConnectError(`${where}: ${verb} bindings must not declare a body`, Code.Internal);\n }\n return { verb, template, body };\n}\nfunction compileRoute(method, rule) {\n const bindings = [compileBinding(method, rule, true)];\n for (const extra of rule.additionalBindings) {\n bindings.push(compileBinding(method, extra, false));\n }\n return { method, bindings };\n}\n// Annotation-derived routes are intrinsic to the descriptor, so a module-level\n// cache keyed by descriptor identity is safe. null marks \"no annotation\".\nconst annotatedRouteCache = new WeakMap();\nfunction resolveAnnotatedRoute(method) {\n const cached = annotatedRouteCache.get(method);\n if (cached !== undefined) {\n return cached ?? undefined;\n }\n let route = null;\n if (hasOption(method, http)) {\n route = compileRoute(method, getOption(method, http));\n }\n annotatedRouteCache.set(method, route);\n return route ?? undefined;\n}\n/**\n * Resolves the gateway routing plan for an RPC from its google.api.http\n * annotation. Works on descriptors generated with options-only imports\n * stripped (the option bytes survive as unknown fields). Returns undefined if\n * the method has no annotation and no fallback produces a rule.\n *\n * Fallback-derived routes are not cached here — callers owning a fallback\n * (e.g. a transport instance) should memoize per instance.\n */\nexport function resolveGatewayRoute(method, fallbackRule) {\n const annotated = resolveAnnotatedRoute(method);\n if (annotated !== undefined) {\n return annotated;\n }\n const fallback = fallbackRule?.(method);\n return fallback === undefined ? undefined : compileRoute(method, fallback);\n}\n/**\n * A stable, human-readable key for an RPC's primary binding, e.g.\n * \"GET /v1/simple/{id}\". Useful for client-side cache keys (SWR etc.).\n */\nexport function routeKey(method, fallbackRule) {\n const route = resolveGatewayRoute(method, fallbackRule);\n if (route === undefined) {\n return `${method.parent.typeName}/${method.name}`;\n }\n const binding = route.bindings[0];\n return `${binding.verb} ${binding.template.raw}`;\n}\n//# sourceMappingURL=route.js.map","import { Code, ConnectError } from '@connectrpc/connect';\nimport { decodeJsonMessage, gatewayErrorFromBody } from './error.js';\n/**\n * Reads grpc-gateway's server-streaming wire format: newline-delimited JSON\n * chunks, each {\"result\": <message>} or {\"error\": <google.rpc.Status>}. An\n * error chunk terminates iteration by throwing the mapped ConnectError.\n * Abandoned iteration cancels the underlying reader.\n */\nexport async function* readNdjsonStream(body, schema, jsonRead, registry, responseHeaders) {\n const reader = body.getReader();\n const decoder = new TextDecoder('utf-8');\n let buffer = '';\n const parseChunk = (line) => {\n let json;\n try {\n json = JSON.parse(line);\n }\n catch (cause) {\n throw new ConnectError('malformed stream chunk: invalid JSON', Code.Internal, responseHeaders, [], cause);\n }\n if (json !== null && typeof json === 'object' && !Array.isArray(json)) {\n const obj = json;\n if (obj.error !== undefined && obj.error !== null) {\n throw gatewayErrorFromBody(obj.error, 200, responseHeaders, registry);\n }\n if (obj.result !== undefined) {\n return decodeJsonMessage(schema, obj.result, jsonRead, responseHeaders);\n }\n }\n throw new ConnectError('unexpected stream chunk shape (expected {\"result\": ...} or {\"error\": ...})', Code.Internal);\n };\n try {\n for (;;) {\n const { done, value } = await reader.read();\n if (done) {\n break;\n }\n buffer += decoder.decode(value, { stream: true });\n let newline;\n while ((newline = buffer.indexOf('\\n')) >= 0) {\n const line = buffer.slice(0, newline).replace(/\\r$/, '');\n buffer = buffer.slice(newline + 1);\n if (line.trim() !== '') {\n yield parseChunk(line);\n }\n }\n }\n buffer += decoder.decode();\n const tail = buffer.trim();\n if (tail !== '') {\n yield parseChunk(tail);\n }\n }\n finally {\n await reader.cancel().catch(() => undefined);\n }\n}\n//# sourceMappingURL=stream.js.map","import { ScalarType, toJson } from '@bufbuild/protobuf';\nimport { FeatureSet_FieldPresence } from '@bufbuild/protobuf/wkt';\nimport { Code, ConnectError } from '@connectrpc/connect';\nimport { flattenQueryParams } from './query-params.js';\nimport { renderPath } from './path-template.js';\nfunction fieldByProtoName(schema, name) {\n return schema.fields.find((f) => f.name === name || f.jsonName === name);\n}\nfunction resolveByProtoPath(schema, json, fieldPath) {\n let curSchema = schema;\n let curJson = json;\n const jsonKeyChain = [];\n let leaf;\n for (const [index, segment] of fieldPath.entries()) {\n const field = fieldByProtoName(curSchema, segment);\n if (field === undefined) {\n throw new ConnectError(`path template field \"${fieldPath.join('.')}\" does not exist on ${schema.typeName}`, Code.Internal);\n }\n jsonKeyChain.push(field.jsonName);\n leaf = field;\n if (curJson === undefined || curJson === null || typeof curJson !== 'object' || Array.isArray(curJson)) {\n curJson = undefined;\n }\n else {\n curJson = curJson[field.jsonName];\n }\n if (index < fieldPath.length - 1) {\n if (field.fieldKind !== 'message') {\n throw new ConnectError(`path template field \"${fieldPath.join('.')}\" traverses non-message field \"${segment}\" on ${curSchema.typeName}`, Code.Internal);\n }\n curSchema = field.message;\n }\n }\n return { value: curJson, jsonKeyChain, leaf };\n}\n/**\n * The protojson zero value for an implicit-presence scalar/enum field. For\n * such fields \"unset\" IS the zero value (proto3 cannot tell them apart), so a\n * path variable resolving to an omitted field must render the zero — the\n * gateway happily routes /v1/things/0 — rather than fail as \"missing\".\n */\nfunction implicitZeroValue(field) {\n if (field.presence !== FeatureSet_FieldPresence.IMPLICIT) {\n return undefined;\n }\n if (field.fieldKind === 'enum') {\n return field.enum.values.find((v) => v.number === 0)?.name ?? '0';\n }\n if (field.fieldKind !== 'scalar') {\n return undefined;\n }\n switch (field.scalar) {\n case ScalarType.BOOL:\n return false;\n case ScalarType.STRING:\n case ScalarType.BYTES:\n // The zero is the empty string, which cannot occupy a path segment;\n // renderPath produces the proper \"must not be empty\" error.\n return '';\n default:\n // All numeric kinds (including 64-bit, which protojson renders as a\n // decimal string) stringify to '0'.\n return 0;\n }\n}\nfunction deleteAtChain(json, chain) {\n let cur = json;\n for (let i = 0; i < chain.length - 1; i++) {\n if (cur === null || typeof cur !== 'object' || Array.isArray(cur)) {\n return;\n }\n cur = cur[chain[i]];\n }\n if (cur !== null && typeof cur === 'object' && !Array.isArray(cur)) {\n delete cur[chain[chain.length - 1]];\n }\n}\n/**\n * Splits one request message into the three transport parts of a gateway\n * binding: rendered URL path, query parameters and JSON body. Strategy is\n * toJson-carving — serialize the whole message once with protojson (which\n * already matches the value formats grpc-gateway accepts: int64 as string,\n * enums as names, bytes as base64, Timestamp as RFC 3339, implicit zero\n * fields omitted), then carve out path variables and the body.\n */\nexport function transcodeRequest(binding, schema, message, opts) {\n // toJson returns a fresh tree per call, so it can be carved up in place.\n const remaining = toJson(schema, message, opts.jsonWriteOptions);\n if (remaining === null || typeof remaining !== 'object' || Array.isArray(remaining)) {\n throw new ConnectError(`request message ${schema.typeName} did not serialize to a JSON object`, Code.Internal);\n }\n const path = renderPath(binding.template, (fieldPath) => {\n const resolved = resolveByProtoPath(schema, remaining, fieldPath);\n if (resolved.value === undefined) {\n // Implicit-presence zero fields are omitted by protojson but are\n // perfectly valid path values.\n return resolved.leaf === undefined ? undefined : implicitZeroValue(resolved.leaf);\n }\n deleteAtChain(remaining, resolved.jsonKeyChain);\n return resolved.value;\n });\n let body = null;\n if (binding.body === '*') {\n body = JSON.stringify(remaining);\n return { path, query: [], body };\n }\n if (binding.body !== undefined) {\n const field = fieldByProtoName(schema, binding.body[0]);\n if (field === undefined) {\n throw new ConnectError(`body field \"${binding.body[0]}\" does not exist on ${schema.typeName}`, Code.Internal);\n }\n const bodyValue = remaining[field.jsonName];\n deleteAtChain(remaining, [field.jsonName]);\n body = JSON.stringify(bodyValue === undefined ? {} : bodyValue);\n }\n const query = flattenQueryParams(remaining, schema, opts.queryParamCase);\n return { path, query, body };\n}\n//# sourceMappingURL=transcode.js.map","import { create } from '@bufbuild/protobuf';\nimport { Code, ConnectError, createContextValues } from '@connectrpc/connect';\nimport { runStreamingCall, runUnaryCall } from '@connectrpc/connect/protocol';\nimport { gatewayBindingKey, gatewayRequestInitKey } from './context.js';\nimport { decodeJsonMessage, gatewayErrorFromBody, readErrorBody } from './error.js';\nimport { buildRequestHeaders, splitGatewayMetadata } from './headers.js';\nimport { httpBodyFromResponse, httpBodyRequestParts, isHttpBody } from './http-body.js';\nimport { normalizeGatewayOptions } from './options.js';\nimport { renderPath } from './path-template.js';\nimport { encodeQueryString } from './query-params.js';\nimport { resolveGatewayRoute } from './route.js';\nimport { readNdjsonStream } from './stream.js';\nimport { transcodeRequest } from './transcode.js';\nfunction buildHttpRequest(opt, method, binding, message, callHeader, contextValues) {\n let path;\n let queryString = '';\n let body = null;\n let contentType = null;\n if (isHttpBody(method.input) && binding.body === '*') {\n // Raw passthrough: HttpBody fields are not addressable by templates or\n // query params; templates with variables fail with a clear error.\n path = renderPath(binding.template, () => undefined);\n const parts = httpBodyRequestParts(method.input, message, opt.httpBodyRequest, opt.jsonWrite);\n body = parts.body;\n contentType = parts.contentType;\n }\n else {\n const transcoded = transcodeRequest(binding, method.input, message, {\n jsonWriteOptions: opt.jsonWrite,\n queryParamCase: opt.queryParamCase\n });\n path = transcoded.path;\n queryString = encodeQueryString(transcoded.query);\n if (transcoded.body !== null) {\n body = transcoded.body;\n contentType = 'application/json';\n }\n }\n const url = opt.baseUrl + path + (queryString === '' ? '' : `?${queryString}`);\n const headers = buildRequestHeaders(opt.headers, callHeader, contentType);\n const perCallInit = contextValues.get(gatewayRequestInitKey);\n const init = {\n ...opt.requestInit,\n ...perCallInit,\n method: binding.verb,\n headers,\n body\n };\n return { url, init };\n}\n/**\n * Creates a connect-es Transport that speaks the grpc-gateway REST/JSON\n * dialect. Routing is derived at runtime from each method's google.api.http\n * annotation; requests are transcoded into the path/query/body mapping the\n * gateway expects, and responses (including errors and NDJSON\n * server-streaming) are mapped back into connect semantics.\n *\n * Use it with a standard client:\n *\n * const transport = createGatewayTransport({ baseUrl: '' })\n * const client = createClient(MyService, transport)\n */\nexport function createGatewayTransport(options) {\n const opt = normalizeGatewayOptions(options);\n // The module-level cache only holds annotation-derived routes; fallback\n // routes depend on this transport's fallbackRule, so they are cached here.\n const fallbackRouteCache = new WeakMap();\n function resolveRoute(method) {\n let route = resolveGatewayRoute(method);\n if (route === undefined && opt.fallbackRule !== undefined) {\n route = fallbackRouteCache.get(method);\n if (route === undefined) {\n route = resolveGatewayRoute(method, opt.fallbackRule);\n if (route !== undefined) {\n fallbackRouteCache.set(method, route);\n }\n }\n }\n if (route === undefined) {\n throw new ConnectError(`no google.api.http annotation for ${method.parent.typeName}.${method.name} (set fallbackRule to route unannotated methods)`, Code.Unimplemented);\n }\n return route;\n }\n function pickBinding(route, contextValues, message) {\n const selector = contextValues.get(gatewayBindingKey);\n if (selector !== undefined) {\n if (selector.index !== undefined) {\n const binding = route.bindings[selector.index];\n if (binding === undefined) {\n throw new ConnectError(`binding index ${selector.index} out of range (method has ${route.bindings.length} bindings)`, Code.Internal);\n }\n return binding;\n }\n if (selector.verb !== undefined) {\n const verb = selector.verb.toUpperCase();\n const binding = route.bindings.find((b) => b.verb === verb);\n if (binding === undefined) {\n throw new ConnectError(`no ${verb} binding on ${route.method.parent.typeName}.${route.method.name}`, Code.Internal);\n }\n return binding;\n }\n }\n if (opt.selectBinding !== undefined) {\n const index = opt.selectBinding(route.method, route.bindings, message);\n const binding = route.bindings[index];\n if (binding === undefined) {\n throw new ConnectError(`selectBinding returned out-of-range index ${index}`, Code.Internal);\n }\n return binding;\n }\n return route.bindings[0];\n }\n async function doFetch(url, init, signal) {\n try {\n return await opt.fetch(url, { ...init, signal });\n }\n catch (cause) {\n throw ConnectError.from(cause);\n }\n }\n return {\n unary(method, signal, timeoutMs, header, message, contextValues) {\n const route = resolveRoute(method);\n const ctx = contextValues ?? createContextValues();\n // Pre-selection only feeds the interceptor-visible requestMethod/url;\n // the effective binding is re-picked in next() so interceptors can set\n // gatewayBindingKey or swap the message.\n const previewBinding = pickBinding(route, ctx, message);\n return runUnaryCall({\n interceptors: opt.interceptors,\n signal,\n timeoutMs: timeoutMs ?? opt.defaultTimeoutMs,\n req: {\n stream: false,\n service: method.parent,\n method,\n requestMethod: previewBinding.verb,\n // Interceptors see the un-substituted template: the final URL\n // depends on the message after interceptors run.\n url: opt.baseUrl + previewBinding.template.raw,\n header: new Headers(header),\n contextValues: ctx,\n message\n },\n next: async (req) => {\n // req.message is the normalized full message here (runUnaryCall\n // applies create()), so selectBinding sees a real MessageShape.\n const binding = pickBinding(route, req.contextValues, req.message);\n const { url, init } = buildHttpRequest(opt, method, binding, req.message, req.header, req.contextValues);\n const response = await doFetch(url, init, req.signal);\n const { header: resHeader, trailer } = splitGatewayMetadata(response.headers);\n if (!response.ok) {\n throw gatewayErrorFromBody(await readErrorBody(response), response.status, resHeader, opt.registry);\n }\n let outMessage;\n if (isHttpBody(method.output)) {\n outMessage = await httpBodyFromResponse(method.output, response);\n }\n else {\n let json;\n try {\n json = (await response.json());\n }\n catch (cause) {\n throw new ConnectError('failed to parse response JSON', Code.Internal, resHeader, [], cause);\n }\n outMessage = decodeJsonMessage(method.output, json, opt.jsonRead, resHeader);\n }\n return {\n stream: false,\n service: method.parent,\n method,\n header: resHeader,\n trailer,\n message: outMessage\n };\n }\n });\n },\n stream(method, signal, timeoutMs, header, input, contextValues) {\n if (method.methodKind !== 'server_streaming') {\n throw new ConnectError(`${method.methodKind} is not supported: grpc-gateway only transcodes unary and server-streaming RPCs`, Code.Unimplemented);\n }\n if (isHttpBody(method.output)) {\n throw new ConnectError('server-streaming google.api.HttpBody responses are not supported: the gateway emits raw unframed bytes, not NDJSON', Code.Unimplemented);\n }\n const route = resolveRoute(method);\n const ctx = contextValues ?? createContextValues();\n return runStreamingCall({\n interceptors: opt.interceptors,\n signal,\n timeoutMs: timeoutMs ?? opt.defaultTimeoutMs,\n req: {\n stream: true,\n service: method.parent,\n method,\n requestMethod: route.bindings[0].verb,\n url: opt.baseUrl + route.bindings[0].template.raw,\n header: new Headers(header),\n contextValues: ctx,\n message: input\n },\n next: async (req) => {\n let single;\n for await (const message of req.message) {\n if (single !== undefined) {\n throw new ConnectError('a server-streaming RPC takes exactly one request message', Code.Internal);\n }\n single = message;\n }\n single ??= create(method.input);\n const binding = pickBinding(route, req.contextValues, single);\n const { url, init } = buildHttpRequest(opt, method, binding, single, req.header, req.contextValues);\n const response = await doFetch(url, init, req.signal);\n const { header: resHeader, trailer } = splitGatewayMetadata(response.headers);\n if (!response.ok) {\n throw gatewayErrorFromBody(await readErrorBody(response), response.status, resHeader, opt.registry);\n }\n if (response.body === null) {\n throw new ConnectError('streaming response has no body', Code.Internal, resHeader);\n }\n return {\n stream: true,\n service: method.parent,\n method,\n header: resHeader,\n trailer,\n message: readNdjsonStream(response.body, method.output, opt.jsonRead, opt.registry, resHeader)\n };\n }\n });\n }\n };\n}\n//# sourceMappingURL=transport.js.map","import { createClient } from '@connectrpc/connect';\nimport { createGatewayTransport } from '@sentio/connect-gateway-es';\n/**\n * Default API origin. `api.sentio.xyz` serves the API under the prefix-stripped\n * `/v1/...` paths (the same surface documented in `openapi.json` and the REST\n * reference). The legacy `https://app.sentio.xyz/api/v1/...` origin is being\n * deprecated; see {@link createSentioTransport} for the path rewrite that lets\n * the generated `/api/v1/...` bindings reach this host.\n */\nexport const DEFAULT_BASE_URL = 'https://api.sentio.xyz';\n/**\n * Drops the gateway's historical `/api` path prefix from an outgoing request.\n * The CI-generated descriptors carry the `/api/v1/...` annotation paths that the\n * legacy `app.sentio.xyz` host served verbatim, but `api.sentio.xyz` exposes the\n * same RPCs under `/v1/...`. Every binding in the public surface is `/api/v1/*`,\n * so removing a leading `/api` segment yields the path the current host routes.\n */\nfunction stripGatewayPathPrefix(input) {\n if (typeof input !== 'string')\n return input;\n try {\n const url = new URL(input);\n if (url.pathname.startsWith('/api/v1/')) {\n url.pathname = url.pathname.slice('/api'.length);\n return url.toString();\n }\n return input;\n }\n catch {\n // Relative URL (baseUrl: '', e.g. behind a same-origin proxy).\n return input.startsWith('/api/v1/') ? input.slice('/api'.length) : input;\n }\n}\n/**\n * Creates a Connect transport that speaks Sentio's REST (grpc-gateway)\n * dialect. Share one transport across clients of multiple services.\n */\nexport function createSentioTransport(options = {}) {\n const { apiKey, baseUrl, headers, fetch: customFetch, ...rest } = options;\n const h = new Headers(headers);\n if (apiKey !== undefined && !h.has('api-key')) {\n h.set('api-key', apiKey);\n }\n const baseFetch = customFetch ?? globalThis.fetch;\n return createGatewayTransport({\n baseUrl: baseUrl ?? DEFAULT_BASE_URL,\n headers: h,\n fetch: (input, init) => baseFetch(stripGatewayPathPrefix(input), init),\n ...rest,\n });\n}\n/**\n * Creates a typed client for one Sentio service:\n *\n * ```ts\n * const web = createSentioClient(WebService, { apiKey })\n * const projects = await web.getProjectList({})\n * ```\n *\n * To talk to several services, create one transport and pass it to\n * connect's `createClient` per service instead.\n */\nexport function createSentioClient(service, options = {}) {\n return createClient(service, createSentioTransport(options));\n}\nexport { createClient };\n//# sourceMappingURL=client.js.map","// @generated by protoc-gen-es v2.12.0 with parameter \"target=ts,import_extension=js,keep_empty_files=true,json_types=true\"\n// @generated from file service/price/protos/price.proto (package price_service, syntax proto3)\n/* eslint-disable */\nimport { enumDesc, fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport { file_google_protobuf_empty, file_google_protobuf_timestamp } from \"@bufbuild/protobuf/wkt\";\n/**\n * Describes the file service/price/protos/price.proto.\n */\nexport const file_service_price_protos_price = /*@__PURE__*/ fileDesc(\"CiBzZXJ2aWNlL3ByaWNlL3Byb3Rvcy9wcmljZS5wcm90bxINcHJpY2Vfc2VydmljZSKRAQoGQ29pbklEEhAKBnN5bWJvbBgCIAEoCUgAEjoKB2FkZHJlc3MYAyABKAsyJy5wcmljZV9zZXJ2aWNlLkNvaW5JRC5BZGRyZXNzSWRlbnRpZmllckgAGjMKEUFkZHJlc3NJZGVudGlmaWVyEg8KB2FkZHJlc3MYASABKAkSDQoFY2hhaW4YAiABKAlCBAoCaWQiLgoQRXhwZXJpbWVudGFsRmxhZxIaChJlbmFibGVfcHl0aF9zb3VyY2UYASABKAgizwEKD0dldFByaWNlUmVxdWVzdBItCgl0aW1lc3RhbXAYASABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEiYKB2NvaW5faWQYAiABKAsyFS5wcmljZV9zZXJ2aWNlLkNvaW5JRBIOCgZzb3VyY2UYAyABKAkSPwoRZXhwZXJpbWVudGFsX2ZsYWcYZCABKAsyHy5wcmljZV9zZXJ2aWNlLkV4cGVyaW1lbnRhbEZsYWdIAIgBAUIUChJfZXhwZXJpbWVudGFsX2ZsYWcicAoQR2V0UHJpY2VSZXNwb25zZRINCgVwcmljZRgBIAEoARItCgl0aW1lc3RhbXAYAiABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEhMKBn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U2VyaWVzVjJSZXNwb25zZSIdgtPkkwIXEhUvYXBpL3YyL3ByaWNlcy9zZXJpZXMShAEKEEJhdGNoR2V0UHJpY2VzVjISJi5wcmljZV9zZXJ2aWNlLkJhdGNoR2V0UHJpY2VzVjJSZXF1ZXN0GicucHJpY2Vfc2VydmljZS5CYXRjaEdldFByaWNlc1YyUmVzcG9uc2UiH4LT5JMCGSIUL2FwaS92Mi9wcmljZXMvYmF0Y2g6ASoSgQEKDVJlc29sdmVBc3NldHMSIy5wcmljZV9zZXJ2aWNlLlJlc29sdmVBc3NldHNSZXF1ZXN0GiQucHJpY2Vfc2VydmljZS5SZXNvbHZlQXNzZXRzUmVzcG9uc2UiJYLT5JMCHxIdL2FwaS92Mi9wcmljZXMvYXNzZXRzL3Jlc29sdmUSdgoMTGlzdEFzc2V0c1YyEiIucHJpY2Vfc2VydmljZS5MaXN0QXNzZXRzVjJSZXF1ZXN0GiMucHJpY2Vfc2VydmljZS5MaXN0QXNzZXRzVjJSZXNwb25zZSIdgtPkkwIXEhUvYXBpL3YyL3ByaWNlcy9hc3NldHMSjwEKD0FkZEFzc2V0QnlHZWNrbxIlLnByaWNlX3NlcnZpY2UuQWRkQXNzZXRCeUdlY2tvUmVxdWVzdBomLnByaWNlX3NlcnZpY2UuQWRkQXNzZXRCeUdlY2tvUmVzcG9uc2UiLYLT5JMCJyIiL2FwaS92Mi9wcmljZXMvYXNzZXRzL2FkZF9ieV9nZWNrbzoBKkInWiVzZW50aW94eXovc2VudGlvL3NlcnZpY2UvcHJpY2UvcHJvdG9zYgZwcm90bzM\", [file_google_protobuf_timestamp, file_google_protobuf_empty]);\n/**\n * Describes the message price_service.CoinID.\n * Use `create(CoinIDSchema)` to create a new message.\n */\nexport const CoinIDSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 0);\n/**\n * Describes the message price_service.CoinID.AddressIdentifier.\n * Use `create(CoinID_AddressIdentifierSchema)` to create a new message.\n */\nexport const CoinID_AddressIdentifierSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 0, 0);\n/**\n * Describes the message price_service.ExperimentalFlag.\n * Use `create(ExperimentalFlagSchema)` to create a new message.\n */\nexport const ExperimentalFlagSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 1);\n/**\n * Describes the message price_service.GetPriceRequest.\n * Use `create(GetPriceRequestSchema)` to create a new message.\n */\nexport const GetPriceRequestSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 2);\n/**\n * Describes the message price_service.GetPriceResponse.\n * Use `create(GetPriceResponseSchema)` to create a new message.\n */\nexport const GetPriceResponseSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 3);\n/**\n * Describes the message price_service.BatchGetPricesRequest.\n * Use `create(BatchGetPricesRequestSchema)` to create a new message.\n */\nexport const BatchGetPricesRequestSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 4);\n/**\n * Describes the message price_service.BatchGetPricesResponse.\n * Use `create(BatchGetPricesResponseSchema)` to create a new message.\n */\nexport const BatchGetPricesResponseSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 5);\n/**\n * Describes the message price_service.BatchGetPricesResponse.CoinPrice.\n * Use `create(BatchGetPricesResponse_CoinPriceSchema)` to create a new message.\n */\nexport const BatchGetPricesResponse_CoinPriceSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 5, 0);\n/**\n * Describes the message price_service.BatchGetPricesResponse.CoinPrice.Price.\n * Use `create(BatchGetPricesResponse_CoinPrice_PriceSchema)` to create a new message.\n */\nexport const BatchGetPricesResponse_CoinPrice_PriceSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 5, 0, 0);\n/**\n * Describes the message price_service.ListCoinsRequest.\n * Use `create(ListCoinsRequestSchema)` to create a new message.\n */\nexport const ListCoinsRequestSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 6);\n/**\n * Describes the message price_service.ListCoinsResponse.\n * Use `create(ListCoinsResponseSchema)` to create a new message.\n */\nexport const ListCoinsResponseSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 7);\n/**\n * Describes the message price_service.CheckLatestPriceResponse.\n * Use `create(CheckLatestPriceResponseSchema)` to create a new message.\n */\nexport const CheckLatestPriceResponseSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 8);\n/**\n * Describes the message price_service.CheckLatestPriceResponse.CoinPrice.\n * Use `create(CheckLatestPriceResponse_CoinPriceSchema)` to create a new message.\n */\nexport const CheckLatestPriceResponse_CoinPriceSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 8, 0);\n/**\n * Describes the message price_service.AddCoinByGeckoRequest.\n * Use `create(AddCoinByGeckoRequestSchema)` to create a new message.\n */\nexport const AddCoinByGeckoRequestSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 9);\n/**\n * Describes the message price_service.AddCoinByGeckoResponse.\n * Use `create(AddCoinByGeckoResponseSchema)` to create a new message.\n */\nexport const AddCoinByGeckoResponseSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 10);\n/**\n * @generated from enum price_service.AddCoinByGeckoResponse.Status\n */\nexport var AddCoinByGeckoResponse_Status;\n(function (AddCoinByGeckoResponse_Status) {\n /**\n * @generated from enum value: OK = 0;\n */\n AddCoinByGeckoResponse_Status[AddCoinByGeckoResponse_Status[\"OK\"] = 0] = \"OK\";\n /**\n * @generated from enum value: ALREADY_EXISTS = 1;\n */\n AddCoinByGeckoResponse_Status[AddCoinByGeckoResponse_Status[\"ALREADY_EXISTS\"] = 1] = \"ALREADY_EXISTS\";\n /**\n * @generated from enum value: MISMATCH_WITH_EXISTING = 2;\n */\n AddCoinByGeckoResponse_Status[AddCoinByGeckoResponse_Status[\"MISMATCH_WITH_EXISTING\"] = 2] = \"MISMATCH_WITH_EXISTING\";\n /**\n * @generated from enum value: GECKO_NOT_FOUND = 3;\n */\n AddCoinByGeckoResponse_Status[AddCoinByGeckoResponse_Status[\"GECKO_NOT_FOUND\"] = 3] = \"GECKO_NOT_FOUND\";\n /**\n * @generated from enum value: GECKO_RETURN_NON_SUPPORTED_CHAIN = 4;\n */\n AddCoinByGeckoResponse_Status[AddCoinByGeckoResponse_Status[\"GECKO_RETURN_NON_SUPPORTED_CHAIN\"] = 4] = \"GECKO_RETURN_NON_SUPPORTED_CHAIN\";\n /**\n * @generated from enum value: GECKO_HAS_DUPLICATE_SYMBOL = 5;\n */\n AddCoinByGeckoResponse_Status[AddCoinByGeckoResponse_Status[\"GECKO_HAS_DUPLICATE_SYMBOL\"] = 5] = \"GECKO_HAS_DUPLICATE_SYMBOL\";\n})(AddCoinByGeckoResponse_Status || (AddCoinByGeckoResponse_Status = {}));\n/**\n * Describes the enum price_service.AddCoinByGeckoResponse.Status.\n */\nexport const AddCoinByGeckoResponse_StatusSchema = /*@__PURE__*/ enumDesc(file_service_price_protos_price, 10, 0);\n/**\n * Describes the message price_service.AddressID.\n * Use `create(AddressIDSchema)` to create a new message.\n */\nexport const AddressIDSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 11);\n/**\n * Describes the message price_service.AssetRef.\n * Use `create(AssetRefSchema)` to create a new message.\n */\nexport const AssetRefSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 12);\n/**\n * Describes the message price_service.PricePoint.\n * Use `create(PricePointSchema)` to create a new message.\n */\nexport const PricePointSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 13);\n/**\n * Describes the message price_service.AssetCandidate.\n * Use `create(AssetCandidateSchema)` to create a new message.\n */\nexport const AssetCandidateSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 14);\n/**\n * Describes the message price_service.CandidateList.\n * Use `create(CandidateListSchema)` to create a new message.\n */\nexport const CandidateListSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 15);\n/**\n * Describes the message price_service.GetPriceV2Request.\n * Use `create(GetPriceV2RequestSchema)` to create a new message.\n */\nexport const GetPriceV2RequestSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 16);\n/**\n * Describes the message price_service.GetPriceV2Response.\n * Use `create(GetPriceV2ResponseSchema)` to create a new message.\n */\nexport const GetPriceV2ResponseSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 17);\n/**\n * Describes the message price_service.PriceSeries.\n * Use `create(PriceSeriesSchema)` to create a new message.\n */\nexport const PriceSeriesSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 18);\n/**\n * Describes the message price_service.GetPriceSeriesV2Request.\n * Use `create(GetPriceSeriesV2RequestSchema)` to create a new message.\n */\nexport const GetPriceSeriesV2RequestSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 19);\n/**\n * Describes the message price_service.GetPriceSeriesV2Response.\n * Use `create(GetPriceSeriesV2ResponseSchema)` to create a new message.\n */\nexport const GetPriceSeriesV2ResponseSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 20);\n/**\n * Describes the message price_service.BatchGetPricesV2Request.\n * Use `create(BatchGetPricesV2RequestSchema)` to create a new message.\n */\nexport const BatchGetPricesV2RequestSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 21);\n/**\n * Describes the message price_service.BatchGetPricesV2Response.\n * Use `create(BatchGetPricesV2ResponseSchema)` to create a new message.\n */\nexport const BatchGetPricesV2ResponseSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 22);\n/**\n * Describes the message price_service.BatchGetPricesV2Response.Item.\n * Use `create(BatchGetPricesV2Response_ItemSchema)` to create a new message.\n */\nexport const BatchGetPricesV2Response_ItemSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 22, 0);\n/**\n * Describes the message price_service.ResolveAssetsRequest.\n * Use `create(ResolveAssetsRequestSchema)` to create a new message.\n */\nexport const ResolveAssetsRequestSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 23);\n/**\n * Describes the message price_service.ResolveAssetsResponse.\n * Use `create(ResolveAssetsResponseSchema)` to create a new message.\n */\nexport const ResolveAssetsResponseSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 24);\n/**\n * Describes the message price_service.ListAssetsV2Request.\n * Use `create(ListAssetsV2RequestSchema)` to create a new message.\n */\nexport const ListAssetsV2RequestSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 25);\n/**\n * Describes the message price_service.ListAssetsV2Response.\n * Use `create(ListAssetsV2ResponseSchema)` to create a new message.\n */\nexport const ListAssetsV2ResponseSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 26);\n/**\n * Describes the message price_service.AddAssetByGeckoRequest.\n * Use `create(AddAssetByGeckoRequestSchema)` to create a new message.\n */\nexport const AddAssetByGeckoRequestSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 27);\n/**\n * Describes the message price_service.AddAssetByGeckoResponse.\n * Use `create(AddAssetByGeckoResponseSchema)` to create a new message.\n */\nexport const AddAssetByGeckoResponseSchema = /*@__PURE__*/ messageDesc(file_service_price_protos_price, 28);\n/**\n * @generated from enum price_service.AddAssetByGeckoResponse.Status\n */\nexport var AddAssetByGeckoResponse_Status;\n(function (AddAssetByGeckoResponse_Status) {\n /**\n * @generated from enum value: OK = 0;\n */\n AddAssetByGeckoResponse_Status[AddAssetByGeckoResponse_Status[\"OK\"] = 0] = \"OK\";\n /**\n * @generated from enum value: ALREADY_EXISTS = 1;\n */\n AddAssetByGeckoResponse_Status[AddAssetByGeckoResponse_Status[\"ALREADY_EXISTS\"] = 1] = \"ALREADY_EXISTS\";\n /**\n * @generated from enum value: GECKO_NOT_FOUND = 2;\n */\n AddAssetByGeckoResponse_Status[AddAssetByGeckoResponse_Status[\"GECKO_NOT_FOUND\"] = 2] = \"GECKO_NOT_FOUND\";\n /**\n * @generated from enum value: GECKO_RETURN_NON_SUPPORTED_CHAIN = 3;\n */\n AddAssetByGeckoResponse_Status[AddAssetByGeckoResponse_Status[\"GECKO_RETURN_NON_SUPPORTED_CHAIN\"] = 3] = \"GECKO_RETURN_NON_SUPPORTED_CHAIN\";\n})(AddAssetByGeckoResponse_Status || (AddAssetByGeckoResponse_Status = {}));\n/**\n * Describes the enum price_service.AddAssetByGeckoResponse.Status.\n */\nexport const AddAssetByGeckoResponse_StatusSchema = /*@__PURE__*/ enumDesc(file_service_price_protos_price, 28, 0);\n/**\n * @generated from service price_service.PriceService\n */\nexport const PriceService = /*@__PURE__*/ serviceDesc(file_service_price_protos_price, 0);\n/**\n * @generated from service price_service.PriceServiceV2\n */\nexport const PriceServiceV2 = /*@__PURE__*/ serviceDesc(file_service_price_protos_price, 1);\n//# sourceMappingURL=price_pb.js.map","import { type CoinID, CoinIDSchema } from '@sentio/protos'\nimport { create } from '@bufbuild/protobuf'\nimport { timestampDate, timestampFromDate } from '@bufbuild/protobuf/wkt'\nimport { Endpoints, processMetrics } from '@sentio/runtime'\nimport { ChainId } from '@sentio/chain'\nimport { LRUCache } from 'lru-cache'\nimport { type Client, createSentioClient, PriceService } from '@sentio/api'\nimport { Code, ConnectError } from '@connectrpc/connect'\nimport path from 'path'\nimport fs from 'fs'\nimport os from 'os'\n\nfunction getApiKey() {\n try {\n const content = fs.readFileSync(path.join(os.homedir(), '.sentio', 'config.json'), 'utf8')\n const config = JSON.parse(content)\n return config['https://app.sentio.xyz']?.api_keys\n } catch (e) {}\n}\n\nexport function getPriceClient(basePath = Endpoints.INSTANCE.priceFeedAPI): PriceApi {\n if (basePath && !basePath.startsWith('http')) {\n basePath = 'http://' + basePath\n }\n if (basePath.endsWith('/')) {\n basePath = basePath.slice(0, -1)\n }\n return createSentioClient(PriceService, {\n baseUrl: basePath || 'https://api.sentio.xyz',\n apiKey: getApiKey()\n })\n}\n\nconst priceMap = new LRUCache<string, Promise<number | undefined>>({\n max: 100000,\n ttl: 1000 * 60 * 5 // 5 minutes\n})\n\ntype PriceApi = Client<typeof PriceService>\nlet priceClient: PriceApi\n\ninterface PriceOptions {\n toleranceInDays?: number\n}\nasync function getPriceByTypeOrSymbol(date: Date, coinId: CoinID, options?: PriceOptions): Promise<number | undefined> {\n if (!priceClient) {\n priceClient = getPriceClient()\n }\n return getPriceByTypeOrSymbolInternal(priceClient, date, coinId, options)\n}\n\nexport async function getPriceByTypeOrSymbolInternal(\n priceClient: PriceApi,\n date: Date,\n coinId: CoinID,\n options?: PriceOptions\n): Promise<number | undefined> {\n const dateStr = dateString(date)\n const todayDateString = dateString(new Date())\n\n const symbol = coinId.id.case === 'symbol' ? coinId.id.value : undefined\n const address = coinId.id.case === 'address' ? coinId.id.value : undefined\n\n let key: string\n if (symbol) {\n key = `${symbol}-${dateStr}`\n } else {\n key = `${address?.address}-${address?.chain}-${dateStr}`\n }\n let price = priceMap.get(key)\n if (price) {\n return price\n }\n\n processMetrics.process_pricecall_count.add(1)\n const response = priceClient.getPrice({\n timestamp: timestampFromDate(date),\n coinId: {\n id: symbol\n ? { case: 'symbol', value: symbol }\n : { case: 'address', value: { address: address?.address ?? '', chain: address?.chain ?? '' } }\n }\n })\n price = response\n .then((res) => {\n if (res.timestamp) {\n const responseDate = timestampDate(res.timestamp)\n const responseDateString = dateString(responseDate)\n if (responseDateString === todayDateString) {\n priceMap.delete(key)\n } else {\n // https://www.javatpoint.com/javascript-date-difference\n const diff = Math.abs(responseDate.getTime() - date.getTime())\n const daysDiff = diff / (1000 * 60 * 60 * 24)\n const tolerance = options?.toleranceInDays || 2\n if (daysDiff > tolerance) {\n priceMap.delete(key)\n return undefined\n }\n }\n } else {\n priceMap.delete(key)\n }\n return res.price\n })\n .catch((e) => {\n setTimeout(() => {\n priceMap.delete(key)\n }, 1000)\n\n if (e instanceof ConnectError && e.code === Code.NotFound) {\n console.error('price not found for ', JSON.stringify(coinId), ' at ', dateStr)\n return undefined\n }\n // TODO maybe use small set of error\n priceMap.delete(key)\n throw e\n })\n priceMap.set(key, price)\n return price\n}\n\n/**\n *\n * @param chainId chain id refers to CHAIN_MAP\n * @param coinType\n * @param date\n * @param options other behavior options\n */\nexport async function getPriceByType(\n chainId: ChainId,\n coinType: string,\n date: Date,\n options?: PriceOptions\n): Promise<number | undefined> {\n return getPriceByTypeOrSymbol(\n date,\n create(CoinIDSchema, {\n id: {\n case: 'address',\n value: {\n chain: chainId,\n address: coinType\n }\n }\n }),\n options\n )\n}\n\n/**\n * @param symbol token symbol like BTC, etc\n * @param date\n * @param options other behavior options\n */\nexport async function getPriceBySymbol(\n symbol: string,\n date: Date,\n options?: PriceOptions\n): Promise<number | undefined> {\n return getPriceByTypeOrSymbol(date, create(CoinIDSchema, { id: { case: 'symbol', value: symbol } }), options)\n}\n\nfunction dateString(date: Date) {\n return [date.getHours(), date.getUTCDate(), date.getUTCMonth() + 1, date.getUTCFullYear()].join('-')\n}\n\n/**\n * get coins that has price, return results as a list of `{ symbol, coin }`\n * pairs where `coin` is the address-keyed CoinID for that symbol on the chain\n * @param chainId\n */\nexport async function getCoinsThatHasPrice(chainId: ChainId) {\n if (!priceClient) {\n priceClient = getPriceClient()\n }\n const res = await priceClient.listCoins({\n chain: chainId,\n limit: 1000\n })\n\n return Object.entries(res.coinAddressesInChain).map(([symbol, coin]) => ({ symbol, coin }))\n}\n","import { SimpleEthersError } from '../eth/index.js'\n\n/**\n * ignore eth call exception and return undefined if that happened\n * @param promise promise return by eth call\n * @param logError whether to log error\n */\nexport async function ignoreEthCallException<Res>(promise: Promise<Res>, logError = false): Promise<Res | undefined> {\n try {\n return await promise\n } catch (err: any) {\n if (err instanceof SimpleEthersError || err?.code === 'CALL_EXCEPTION' || err?.code === 'BAD_DATA') {\n if (logError) {\n console.error('eth call exception, return undefined', err)\n }\n return undefined\n }\n throw err\n }\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,52,53,54,55,56,57,58,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAkBA,SAAgB,QAAQ,MAAM,MAAM,GAAG,OAAO;CAC1C,IAAI,MAAM,UAAU,GAChB,OAAO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ACA;GACA,uBAAuB;GACvB;GACA;EACF,CAAC;EACD,OAAO;CACT;CAEA,AAAO,QACL,WACA,SACA,aACA,oBAIiC,0BACjC;EACA,KAAK,cAAc,KAAK;GACtB;GACA,aAAa,eAAe;GAC5B;GACA;GACA,aAAa,OAAO,sBAAsB,eAAe,CAAC,CAAC;EAC7D,CAAC;EACD,OAAO;CACT;CAIA,AAAO,wBACL,SACA;EACA,KAAK,iBAAiB;CACxB;AACF;;;;AC5PA,MAAMC,SAAO;CACX;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,GACA;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,WAAW;EACX,QAAQ;GACN;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;EACF;EACA,MAAM;EACN,MAAM;CACR;CACA;EACE,WAAW;EACX,QAAQ;GACN;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;EACF;EACA,MAAM;EACN,MAAM;CACR;CACA;EACE,WAAW;EACX,QAAQ,CACN;GACE,SAAS;GACT,cAAc;GACd,MAAM;GACN,MAAM;EACR,GACA;GACE,SAAS;GACT,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,MAAM;CACR;CACA;EACE,WAAW;EACX,QAAQ,CACN;GACE,SAAS;GACT,cAAc;GACd,MAAM;GACN,MAAM;EACR,GACA;GACE,SAAS;GACT,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,MAAM;CACR;CACA;EACE,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CAAC;EACV,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CAAC;EACV,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS;GACP;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;EACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CAAC;EACT,MAAM;EACN,SAAS;GACP;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;EACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CAAC;EACV,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS;GACP;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;EACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CAAC;EACT,MAAM;EACN,SAAS;GACP;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;EACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CAAC;EACV,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CAAC;EACV,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;AACF;AAEA,IAAa,8BAAb,MAAyC;CACvC,OAAgB,MAAMA;CACtB,OAAO,kBAA+C;EACpD,OAAO,aAAaA,MAAI;CAC1B;CACA,OAAO,QACL,SACA,kBACoB;EACpB,OAAO,YAAY,SAASA,QAAM,gBAAgB;CACpD;AACF;;;;AC5gBA,MAAMC,SAAO;CACX;EACE,WAAW;EACX,QAAQ;GACN;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;EACF;EACA,MAAM;EACN,MAAM;CACR;CACA;EACE,WAAW;EACX,QAAQ;GACN;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;EACF;EACA,MAAM;EACN,MAAM;CACR;CACA;EACE,WAAW;EACX,QAAQ;GACN;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;EACF;EACA,MAAM;EACN,MAAM;CACR;CACA;EACE,WAAW;EACX,QAAQ,CACN;GACE,SAAS;GACT,cAAc;GACd,MAAM;GACN,MAAM;EACR,GACA;GACE,SAAS;GACT,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,GACA;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,GACA;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,GACA;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ;GACN;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;EACF;EACA,MAAM;EACN,SAAS,CAAC;EACV,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ;GACN;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;EACF;EACA,MAAM;EACN,SAAS,CAAC;EACV,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,GACA;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CAAC;EACV,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;AACF;AAEA,IAAa,mBAAb,MAA8B;CAC5B,OAAgB,MAAMA;CACtB,OAAO,kBAAoC;EACzC,OAAO,aAAaA,MAAI;CAC1B;CACA,OAAO,QACL,SACA,kBACS;EACT,OAAO,YAAY,SAASA,QAAM,gBAAgB;CACpD;AACF;;;;ACtUA,MAAMC,SAAO;CACX;EACE,QAAQ,CAAC;EACT,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,WAAW;EACX,QAAQ;GACN;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;EACF;EACA,MAAM;EACN,MAAM;CACR;CACA;EACE,WAAW;EACX,QAAQ,CACN;GACE,SAAS;GACT,cAAc;GACd,MAAM;GACN,MAAM;EACR,GACA;GACE,SAAS;GACT,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,MAAM;CACR;CACA;EACE,WAAW;EACX,QAAQ;GACN;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;EACF;EACA,MAAM;EACN,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,GACA;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,GACA;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CAAC;EACV,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,GACA;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CAAC;EACV,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,GACA;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,GACA;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CAAC;EACV,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CAAC;EACV,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,GACA;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ;GACN;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;EACF;EACA,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CAAC;EACV,iBAAiB;EACjB,MAAM;CACR;AACF;AAEA,IAAa,iBAAb,MAA4B;CAC1B,OAAgB,MAAMA;CACtB,OAAO,kBAAkC;EACvC,OAAO,aAAaA,MAAI;CAC1B;CACA,OAAO,QAAQ,SAAiB,kBAA4C;EAC1E,OAAO,YAAY,SAASA,QAAM,gBAAgB;CACpD;AACF;;;;AC3YA,MAAMC,SAAO;CACX;EACE,UAAU;EACV,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CACP;GACE,MAAM;GACN,MAAM;EACR,CACF;EACA,SAAS;EACT,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,UAAU;EACV,QAAQ,CACN;GACE,MAAM;GACN,MAAM;EACR,GACA;GACE,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CACP;GACE,MAAM;GACN,MAAM;EACR,CACF;EACA,SAAS;EACT,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,UAAU;EACV,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CACP;GACE,MAAM;GACN,MAAM;EACR,CACF;EACA,SAAS;EACT,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,UAAU;EACV,QAAQ;GACN;IACE,MAAM;IACN,MAAM;GACR;GACA;IACE,MAAM;IACN,MAAM;GACR;GACA;IACE,MAAM;IACN,MAAM;GACR;EACF;EACA,MAAM;EACN,SAAS,CACP;GACE,MAAM;GACN,MAAM;EACR,CACF;EACA,SAAS;EACT,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,UAAU;EACV,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CACP;GACE,MAAM;GACN,MAAM;EACR,CACF;EACA,SAAS;EACT,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,UAAU;EACV,QAAQ,CACN;GACE,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CACP;GACE,MAAM;GACN,MAAM;EACR,CACF;EACA,SAAS;EACT,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,UAAU;EACV,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CACP;GACE,MAAM;GACN,MAAM;EACR,CACF;EACA,SAAS;EACT,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,UAAU;EACV,QAAQ,CACN;GACE,MAAM;GACN,MAAM;EACR,GACA;GACE,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CACP;GACE,MAAM;GACN,MAAM;EACR,CACF;EACA,SAAS;EACT,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,UAAU;EACV,QAAQ,CACN;GACE,MAAM;GACN,MAAM;EACR,GACA;GACE,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CACP;GACE,MAAM;GACN,MAAM;EACR,CACF;EACA,SAAS;EACT,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ;GACN;IACE,MAAM;IACN,MAAM;GACR;GACA;IACE,MAAM;IACN,MAAM;GACR;GACA;IACE,MAAM;IACN,MAAM;GACR;EACF;EACA,SAAS;EACT,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,WAAW;EACX,QAAQ;GACN;IACE,SAAS;IACT,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,MAAM;IACN,MAAM;GACR;EACF;EACA,MAAM;EACN,MAAM;CACR;CACA;EACE,WAAW;EACX,QAAQ;GACN;IACE,SAAS;IACT,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,MAAM;IACN,MAAM;GACR;EACF;EACA,MAAM;EACN,MAAM;CACR;AACF;AAEA,IAAa,sBAAb,MAAiC;CAC/B,OAAgB,MAAMA;CACtB,OAAO,kBAAuC;EAC5C,OAAO,aAAaA,MAAI;CAC1B;CACA,OAAO,QACL,SACA,kBACY;EACZ,OAAO,YAAY,SAASA,QAAM,gBAAgB;CACpD;AACF;;;;ACxPA,MAAMC,SAAO;CACX;EACE,WAAW;EACX,QAAQ;GACN;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;EACF;EACA,MAAM;EACN,MAAM;CACR;CACA;EACE,WAAW;EACX,QAAQ;GACN;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;EACF;EACA,MAAM;EACN,MAAM;CACR;CACA;EACE,WAAW;EACX,QAAQ;GACN;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,cAAc;IACd,MAAM;IACN,MAAM;GACR;EACF;EACA,MAAM;EACN,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,GACA;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CAAC;EACV,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,UAAU;EACV,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CACP;GACE,MAAM;GACN,MAAM;EACR,CACF;EACA,SAAS;EACT,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,GACA;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ;GACN;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;EACF;EACA,MAAM;EACN,SAAS,CAAC;EACV,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ;GACN;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;EACF;EACA,MAAM;EACN,SAAS,CAAC;EACV,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,GACA;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CAAC;EACV,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACR,CACF;EACA,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,QAAQ;GACN;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;GACA;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACR;EACF;EACA,MAAM;EACN,SAAS,CAAC;EACV,iBAAiB;EACjB,MAAM;CACR;AACF;AAEA,IAAa,kBAAb,MAA6B;CAC3B,OAAgB,MAAMA;CACtB,OAAO,kBAAmC;EACxC,OAAO,aAAaA,MAAI;CAC1B;CACA,OAAO,QAAQ,SAAiB,kBAA6C;EAC3E,OAAO,YAAY,SAASA,QAAM,gBAAgB;CACpD;AACF;;;;ACnWA,MAAM,OAAO;CACX;EACE,UAAU;EACV,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CACP;GACE,MAAM;GACN,MAAM;EACR,CACF;EACA,SAAS;EACT,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,UAAU;EACV,QAAQ,CACN;GACE,MAAM;GACN,MAAM;EACR,GACA;GACE,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CACP;GACE,MAAM;GACN,MAAM;EACR,CACF;EACA,SAAS;EACT,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,UAAU;EACV,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CACP;GACE,MAAM;GACN,MAAM;EACR,CACF;EACA,SAAS;EACT,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,UAAU;EACV,QAAQ;GACN;IACE,MAAM;IACN,MAAM;GACR;GACA;IACE,MAAM;IACN,MAAM;GACR;GACA;IACE,MAAM;IACN,MAAM;GACR;EACF;EACA,MAAM;EACN,SAAS,CACP;GACE,MAAM;GACN,MAAM;EACR,CACF;EACA,SAAS;EACT,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,UAAU;EACV,QAAQ,CACN;GACE,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CAAC;EACV,SAAS;EACT,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,UAAU;EACV,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CACP;GACE,MAAM;GACN,MAAM;EACR,CACF;EACA,SAAS;EACT,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,UAAU;EACV,QAAQ,CACN;GACE,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CACP;GACE,MAAM;GACN,MAAM;EACR,CACF;EACA,SAAS;EACT,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,UAAU;EACV,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CACP;GACE,MAAM;GACN,MAAM;EACR,CACF;EACA,SAAS;EACT,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,UAAU;EACV,QAAQ,CACN;GACE,MAAM;GACN,MAAM;EACR,GACA;GACE,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CACP;GACE,MAAM;GACN,MAAM;EACR,CACF;EACA,SAAS;EACT,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,UAAU;EACV,QAAQ,CAAC;EACT,MAAM;EACN,SAAS,CAAC;EACV,SAAS;EACT,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,UAAU;EACV,QAAQ,CACN;GACE,MAAM;GACN,MAAM;EACR,GACA;GACE,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,SAAS,CACP;GACE,MAAM;GACN,MAAM;EACR,CACF;EACA,SAAS;EACT,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,SAAS;EACT,iBAAiB;EACjB,MAAM;CACR;CACA;EACE,WAAW;EACX,QAAQ;GACN;IACE,SAAS;IACT,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,MAAM;IACN,MAAM;GACR;EACF;EACA,MAAM;EACN,MAAM;CACR;CACA;EACE,WAAW;EACX,QAAQ;GACN;IACE,SAAS;IACT,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,MAAM;IACN,MAAM;GACR;GACA;IACE,SAAS;IACT,MAAM;IACN,MAAM;GACR;EACF;EACA,MAAM;EACN,MAAM;CACR;CACA;EACE,WAAW;EACX,QAAQ,CACN;GACE,SAAS;GACT,MAAM;GACN,MAAM;EACR,GACA;GACE,SAAS;GACT,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,MAAM;CACR;CACA;EACE,WAAW;EACX,QAAQ,CACN;GACE,SAAS;GACT,MAAM;GACN,MAAM;EACR,GACA;GACE,SAAS;GACT,MAAM;GACN,MAAM;EACR,CACF;EACA,MAAM;EACN,MAAM;CACR;AACF;AAEA,IAAa,iBAAb,MAA4B;CAC1B,OAAgB,MAAM;CACtB,OAAO,kBAAkC;EACvC,OAAO,aAAa,IAAI;CAC1B;CACA,OAAO,QAAQ,SAAiB,kBAA4C;EAC1E,OAAO,YAAY,SAAS,MAAM,gBAAgB;CACpD;AACF;;;;AC3IA,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,IACA,SACA,aACc;GACd,OAAO,eACL,aACA,WACA,qCACA,CAAC,IAAI,OAAO,CACd;EACF;EACA,YAAY,aAA2C;GACrD,OAAO,eACL,aACA,eACA,0BACA,CAAC,CACH;EACF;EACA,UAAU,OAAe,aAA2C;GAClE,OAAO,eACL,aACA,aACA,+BACA,CAAC,KAAK,CACR;EACF;EACA,YACE,SACA,aACc;GACd,OAAO,eACL,aACA,eACA,iCACA,CAAC,OAAO,CACV;EACF;EACA,iBACE,OACA,UACA,aACc;GACd,OAAO,eACL,aACA,oBACA,8CACA,CAAC,OAAO,QAAQ,CAClB;EACF;EACA,KAAK,aAA2C;GAC9C,OAAO,eAAe,aAAa,QAAQ,mBAAmB,CAAC,CAAC;EAClE;EACA,QAAQ,SAAuB,aAA2C;GACxE,OAAO,eACL,aACA,WACA,6BACA,CAAC,OAAO,CACV;EACF;EACA,yCACE,MACA,IACA,SACA,aACc;GACd,OAAO,eACL,aACA,oBACA,sDACA;IAAC;IAAM;IAAI;GAAO,CACpB;EACF;EACA,+CACE,MACA,IACA,SACA,MACA,aACc;GACd,OAAO,eACL,aACA,oBACA,4DACA;IAAC;IAAM;IAAI;IAAS;GAAI,CAC1B;EACF;EACA,kBACE,UACA,WACA,aACc;GACd,OAAO,eACL,aACA,qBACA,4CACA,CAAC,UAAU,SAAS,CACtB;EACF;EACA,kBACE,aACA,aACc;GACd,OAAO,eACL,aACA,qBACA,sCACA,CAAC,WAAW,CACd;EACF;EACA,OAAO,aAA2C;GAChD,OAAO,eAAe,aAAa,UAAU,qBAAqB,CAAC,CAAC;EACtE;EACA,SAAS,SAAuB,aAA2C;GACzE,OAAO,eACL,aACA,YACA,8BACA,CAAC,OAAO,CACV;EACF;EACA,aACE,MACA,IACA,SACA,aACc;GACd,OAAO,eACL,aACA,gBACA,kDACA;IAAC;IAAM;IAAI;GAAO,CACpB;EACF;CACF;AACF;AAEA,IAAa,0BAAb,cAA6C,kBAG3C;CACA,MAAM,YAAY,WAAwC;EACxD,OA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F;CACF;CAEA,kBACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,uBACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,WACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,cACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,+CACE,SAIA,gBAIA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,qDACE,SAIA,gBAIA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,wBACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,wBACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,aACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,eACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,mBACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,OAAc,UAAU;EACtB,SACE,OACA,UACA,SACqB;GACrB,OAAOA,mBAAiB,QAAQ,oCAAoC,CAClE,OACA,UACA,OACF;EACF;EACA,eACE,OACA,UACA,UAC2B;GAC3B,OAAOA,mBAAiB,QAAQ,uCAAuC,CACrE,OACA,UACA,QACF;EACF;EACA,SACE,MACA,IACA,SACqB;GACrB,OAAOA,mBAAiB,QAAQ,oCAAoC,CAClE,MACA,IACA,OACF;EACF;CACF;CAEA,AAAU,0BAAmD;EAC3D,MAAM,OAAO,kBAAkB,KAAK,OAAO,SAAS,KAAK,OA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GACd,OAAO,eACL,aACA,WACA,qCACA,CAAC,SAAS,MAAM,CAClB;EACF;EACA,UAAU,SAAiB,aAA2C;GACpE,OAAO,eACL,aACA,aACA,+BACA,CAAC,OAAO,CACV;EACF;EACA,KAAK,QAAsB,aAA2C;GACpE,OAAO,eAAe,aAAa,QAAQ,0BAA0B,CACnE,MACF,CAAC;EACH;EACA,SACE,SACA,QACA,aACc;GACd,OAAO,eACL,aACA,YACA,sCACA,CAAC,SAAS,MAAM,CAClB;EACF;EACA,SAAS,aAA2C;GAClD,OAAO,eAAe,aAAa,YAAY,uBAAuB,CAAC,CAAC;EAC1E;EACA,kBACE,SACA,iBACA,aACc;GACd,OAAO,eACL,aACA,qBACA,+CACA,CAAC,SAAS,eAAe,CAC3B;EACF;EACA,kBACE,SACA,YACA,aACc;GACd,OAAO,eACL,aACA,qBACA,+CACA,CAAC,SAAS,UAAU,CACtB;EACF;EACA,OAAO,aAA2C;GAChD,OAAO,eAAe,aAAa,UAAU,qBAAqB,CAAC,CAAC;EACtE;EACA,KAAK,aAA2C;GAC9C,OAAO,eAAe,aAAa,QAAQ,mBAAmB,CAAC,CAAC;EAClE;EACA,MAAM,aAA2C;GAC/C,OAAO,eAAe,aAAa,SAAS,oBAAoB,CAAC,CAAC;EACpE;EACA,kBAAkB,aAA2C;GAC3D,OAAO,eACL,aACA,qBACA,gCACA,CAAC,CACH;EACF;EACA,UAAU,SAAiB,aAA2C;GACpE,OAAO,eACL,aACA,aACA,+BACA,CAAC,OAAO,CACV;EACF;EACA,OAAO,aAA2C;GAChD,OAAO,eAAe,aAAa,UAAU,qBAAqB,CAAC,CAAC;EACtE;EACA,YAAY,aAA2C;GACrD,OAAO,eACL,aACA,eACA,0BACA,CAAC,CACH;EACF;EACA,SACE,WACA,QACA,aACc;GACd,OAAO,eACL,aACA,YACA,sCACA,CAAC,WAAW,MAAM,CACpB;EACF;EACA,aACE,QACA,WACA,QACA,aACc;GACd,OAAO,eACL,aACA,gBACA,kDACA;IAAC;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,gBACA,mBAKM;EACN,IAAI,CAAC,QACH,SAASA,mBAAiB,QAAQ,oCAAoC,CACpE,MACA,MACA,IACF;EAEF,OAAO,MAAM,WACX,SACA,QACA,gBACA,iBACF;CACF;CAEA,gBACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,cACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,gBACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,WACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,eACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,eACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,wBACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,wBACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,aACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,WACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,YACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,wBACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,gBACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,aACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,kBACE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OAAO,MAAM,WACX,SACA,QACA,gBACA,iBACF;CACF;CAEA,WACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,cACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,kBACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,mBACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,eACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,gBACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,aACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,eACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,gBACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,OAAc,UAAU;EACtB,SACE,OACA,SACA,OACqB;GACrB,OAAOA,mBAAiB,QAAQ,oCAAoC,CAClE,OACA,SACA,KACF;EACF;EACA,SACE,MACA,IACA,OACqB;GACrB,OAAOA,mBAAiB,QAAQ,oCAAoC,CAClE,MACA,IACA,KACF;EACF;CACF;CAEA,AAAU,0BAAuD;EAC/D,MAAM,OAAO,sBACX,KAAK,OAAO,SACZ,KAAK,OAAO,OACd;EACA,OAAO,IAAI,4BAA4B,KAAK,OAAO,SAAS,IAAI;CAClE;CAEA,OAAc,KAAK,SAA2C;EAC5D,IAAI,CAAC,QAAQ,MACX,QAAQ,OAAO;EAEjB,IAAI,YAAY,aAAa,OAAO;EACpC,IAAI,CAAC,WAAW;GACd,YAAY,IAAI,oBAAoB,OAAO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S,aAA2C;GAClD,OAAO,eAAe,aAAa,YAAY,uBAAuB,CAAC,CAAC;EAC1E;EACA,YAAY,aAA2C;GACrD,OAAO,eACL,aACA,eACA,0BACA,CAAC,CACH;EACF;EACA,UACE,UACA,aACc;GACd,OAAO,eACL,aACA,aACA,+BACA,CAAC,QAAQ,CACX;EACF;EACA,aACE,UACA,aACc;GACd,OAAO,eACL,aACA,gBACA,iCACA,CAAC,QAAQ,CACX;EACF;EACA,aACE,UACA,aACc;GACd,OAAO,eACL,aACA,gBACA,kCACA,CAAC,QAAQ,CACX;EACF;EACA,aAAa,aAA2C;GACtD,OAAO,eACL,aACA,gBACA,2BACA,CAAC,CACH;EACF;EACA,YAAY,aAA2C;GACrD,OAAO,eACL,aACA,eACA,0BACA,CAAC,CACH;EACF;EACA,gBAAgB,aAA2C;GACzD,OAAO,eACL,aACA,mBACA,8BACA,CAAC,CACH;EACF;EACA,gBAAgB,aAA2C;GACzD,OAAO,eACL,aACA,mBACA,8BACA,CAAC,CACH;EACF;EACA,MAAM,aAA2C;GAC/C,OAAO,eAAe,aAAa,SAAS,oBAAoB,CAAC,CAAC;EACpE;EACA,iBACE,MACA,aACc;GACd,OAAO,eACL,aACA,oBACA,qCACA,CAAC,IAAI,CACP;EACF;EACA,QAAQ,aAA2C;GACjD,OAAO,eAAe,aAAa,WAAW,sBAAsB,CAAC,CAAC;EACxE;EACA,kBACE,aACA,aACc;GACd,OAAO,eACL,aACA,qBACA,uCACA,CAAC,WAAW,CACd;EACF;EACA,mBAAmB,aAA2C;GAC5D,OAAO,eACL,aACA,sBACA,iCACA,CAAC,CACH;EACF;EACA,qBACE,UACA,aACc;GACd,OAAO,eACL,aACA,wBACA,yCACA,CAAC,QAAQ,CACX;EACF;EACA,wBAAwB,aAA2C;GACjE,OAAO,eACL,aACA,2BACA,sCACA,CAAC,CACH;EACF;EACA,cACE,mBACA,aACc;GACd,OAAO,eACL,aACA,iBACA,mCACA,CAAC,iBAAiB,CACpB;EACF;EACA,kB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SAAS;GAC9C,CAAC,CACH;EACF;CACF;AACF;AAOA,IAAa,8BAAb,MAAa,oCAAoC,cAG/C;CACA,qBACE,SAIA,QACA,gBACA,mBAKM;EACN,IAAI,CAAC,QACH,SAAS,iBAAiB,QACxB,wCACD,CAAC,MAAM,MAAM,IAAI;EAEpB,OAAO,MAAM,WACX,SACA,QACA,gBACA,iBACF;CACF;CAEA,gBACE,SACA,QACA,gBACA,mBAKM;EACN,IAAI,CAAC,QACH,SAAS,iBAAiB,QAAQ,oCAAoC,CACpE,MACA,MACA,IACF;EAEF,OAAO,MAAM,WACX,SACA,QACA,gBACA,iBACF;CACF;CAEA,kCACE,SAIA,QAGA,gBAIA,mBAKM;EACN,IAAI,CAAC,QACH,SAAS,iBAAiB,QACxB,8CACD,CAAC,MAAM,IAAI;EAEd,OAAO,MAAM,WACX,SACA,QACA,gBACA,iBACF;CACF;CAEA,4BACE,SAIA,QAGA,gBACA,mBAKM;EACN,IAAI,CAAC,QACH,SAAS,iBAAiB,QACxB,wCACD,CAAC,MAAM,IAAI;EAEd,OAAO,MAAM,WACX,SACA,QACA,gBACA,iBACF;CACF;CAEA,sBACE,SAIA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,uBACE,SAIA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,iBACE,SAIA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,wBACE,SAIA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,eACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,kBACE,SAIA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,gBACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,mBACE,SAIA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,mBACE,SAIA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,mBACE,SAIA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,kBACE,SAIA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,sBACE,SAIA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,sBACE,SAIA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,YACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,uBACE,SAIA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,cACE,SACA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,wBACE,SAIA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,yBACE,SAIA,gBAIA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,2BACE,SAIA,gBAIA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,8BACE,SAIA,gBAIA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,oBACE,SAIA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,wBACE,SAIA,gBACA,mBAIM;EACN,OAAO,MAAM,WACX,cACA,SACA,gBACA,iBACF;CACF;CAEA,cACE,SACA,gBACA,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